Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

master_hella_20240701
ljlong_2630 5 months ago
parent
commit
9e542d1866
  1. 3
      README.md
  2. 10
      index.html
  3. 63
      src/api/eam/basicSpotCheckOption/index.ts
  4. 8
      src/api/eam/equipmentRepairJobMain/index.ts
  5. 5
      src/api/eam/equipmentReportRepairRequest/index.ts
  6. 9
      src/api/eam/inspectionItem/index.ts
  7. 91
      src/api/eam/planInspection/index.ts
  8. 91
      src/api/eam/planSpotCheck/index.ts
  9. 58
      src/api/eam/sparePartsInLocationDetail/index.ts
  10. 87
      src/api/eam/sparePartsInLocationMain/index.ts
  11. 58
      src/api/eam/sparePartsInLocationRecordDetail/index.ts
  12. 72
      src/api/eam/sparePartsInLocationRecordMain/index.ts
  13. 54
      src/api/eam/sparePartsOutLocationRecordDetail/sparePartsOutLocationDetailRecord.js
  14. 71
      src/api/eam/sparePartsOutLocationRecordMain/index.ts
  15. 5
      src/api/wms/areabasic/index.ts
  16. 4
      src/api/wms/countJobMain/index.ts
  17. 4
      src/api/wms/countPlanMain/index.ts
  18. 4
      src/api/wms/countRecordMain/index.ts
  19. 4
      src/api/wms/countRequestMain/index.ts
  20. 4
      src/api/wms/countadjustRecordMain/index.ts
  21. 2
      src/api/wms/countadjustRequestMain/index.ts
  22. 5
      src/api/wms/itembasic/index.ts
  23. 9
      src/api/wms/preparetoissueDetail/index.ts
  24. 1
      src/api/wms/productreceiptRequestDetail/index.ts
  25. 11
      src/api/wms/purchasePlanDetail/index.ts
  26. 10
      src/api/wms/purchasereceiptJobMain/index.ts
  27. 12
      src/api/wms/purchasereceiptRecordMain/index.ts
  28. 10
      src/api/wms/purchasereceiptRequestMain/index.ts
  29. 8
      src/api/wms/saleDetail/index.ts
  30. 2
      src/api/wms/supplierinvoiceRequestDetail/index.ts
  31. 11
      src/api/wms/warehouse/index.ts
  32. 10
      src/components/BasicForm/src/BasicForm.vue
  33. 65
      src/components/Detail/src/Detail.vue
  34. 2
      src/components/DetailTable/src/DetailTable.vue
  35. 9
      src/components/Form/src/Form.vue
  36. 2
      src/components/Form/src/helper.ts
  37. 15
      src/components/Search/src/Search.vue
  38. 153
      src/components/TableFormCountPlan/src/TableFormCountPlan.vue
  39. 13
      src/components/XButton/src/ButtonBase.vue
  40. 2
      src/config/axios/config.ts
  41. 5
      src/locales/en-US.ts
  42. 5
      src/locales/zh-CN.ts
  43. 8
      src/utils/dict.ts
  44. 25
      src/utils/disposition/defaultButtons.ts
  45. 300
      src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts
  46. 374
      src/views/eam/SparePartsOutLocationRecord/index.vue
  47. 27
      src/views/eam/basicInspectionOption/index.vue
  48. 393
      src/views/eam/basicInspectionOption/itemSelectSetForm.vue
  49. 5
      src/views/eam/basicMaintenanceOption/itemSelectSetForm.vue
  50. 200
      src/views/eam/basicSpotCheckOption/basicSpotCheckOption.data.ts
  51. 300
      src/views/eam/basicSpotCheckOption/index.vue
  52. 387
      src/views/eam/basicSpotCheckOption/itemSelectSetForm.vue
  53. 107
      src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts
  54. 4
      src/views/eam/equipmentRepairJobMain/finishForm1.vue
  55. 151
      src/views/eam/equipmentRepairJobMain/index.vue
  56. 344
      src/views/eam/equipmentRepairJobMain/transferForm.vue
  57. 157
      src/views/eam/equipmentRepairRecordMain/equipmentRepairRecordMain.data.ts
  58. 29
      src/views/eam/equipmentRepairRecordMain/index.vue
  59. 13
      src/views/eam/equipmentReportRepairRequest/equipmentReportRepairRequest.data.ts
  60. 215
      src/views/eam/equipmentReportRepairRequest/index.vue
  61. 18
      src/views/eam/inspectionItem/index.vue
  62. 8
      src/views/eam/inspectionItem/inspectionItem.data.ts
  63. 2
      src/views/eam/inspectionItemSelectSet/inspectionItemSelectSet.data.ts
  64. 353
      src/views/eam/itemAccounts/itemAccounts.data.ts
  65. 27
      src/views/eam/maintenance/audiForm.vue
  66. 2
      src/views/eam/maintenanceItemSelectSet/maintenanceItemSelectSet.data.ts
  67. 126
      src/views/eam/planInspection/audiForm.vue
  68. 419
      src/views/eam/planInspection/index.vue
  69. 395
      src/views/eam/planInspection/planInspection.data.ts
  70. 125
      src/views/eam/planSpotCheck/audiForm.vue
  71. 422
      src/views/eam/planSpotCheck/index.vue
  72. 394
      src/views/eam/planSpotCheck/planSpotCheck.data.ts
  73. 3
      src/views/eam/sparePart/sparePart.data.ts
  74. 16
      src/views/eam/sparePartsApplyMain/SparePartsApply.data.ts
  75. 438
      src/views/eam/sparepartsinlocation/index.vue
  76. 297
      src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts
  77. 6
      src/views/eam/spotCheckItem/spotCheckItem.data.ts
  78. 2
      src/views/eam/spotCheckSelectSet/spotCheckSelectSet.data.ts
  79. 2
      src/views/login/forgetPassword.vue
  80. 2
      src/views/qms/inspectionJob/addForm.vue
  81. 8
      src/views/qms/inspectionScheme/addForm.vue
  82. 74
      src/views/wms/basicDataManage/customerManage/customerdock/customerdock.data.ts
  83. 28
      src/views/wms/basicDataManage/customerManage/customerdock/index.vue
  84. 2
      src/views/wms/basicDataManage/customerManage/customeritem/customeritem.data.ts
  85. 24
      src/views/wms/basicDataManage/customerManage/customeritem/index.vue
  86. 1
      src/views/wms/basicDataManage/customerManage/project/project.data.ts
  87. 2
      src/views/wms/basicDataManage/customerManage/saleprice/index.vue
  88. 2
      src/views/wms/basicDataManage/customerManage/saleprice/saleprice.data.ts
  89. 1
      src/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data.ts
  90. 1
      src/views/wms/basicDataManage/factoryModeling/areabasic/index.vue
  91. 1
      src/views/wms/basicDataManage/factoryModeling/dock/dock.data.ts
  92. 1
      src/views/wms/basicDataManage/factoryModeling/dock/index.vue
  93. 3
      src/views/wms/basicDataManage/factoryModeling/location/location.data.ts
  94. 1
      src/views/wms/basicDataManage/factoryModeling/locationgroup/index.vue
  95. 2
      src/views/wms/basicDataManage/factoryModeling/locationgroup/locationgroup.data.ts
  96. 2
      src/views/wms/basicDataManage/factoryModeling/process/process.data.ts
  97. 1
      src/views/wms/basicDataManage/factoryModeling/productionline/productionline.data.ts
  98. 2
      src/views/wms/basicDataManage/factoryModeling/workstation/index.vue
  99. 4
      src/views/wms/basicDataManage/factoryModeling/workstation/workstation.data.ts
  100. 3
      src/views/wms/basicDataManage/itemManage/bom/bom.data.ts

3
README.md

@ -1,9 +1,10 @@
## dev发布2024-06-01-001
## dev发布2024-06-01-002
**xxxx.data.ts 文件配置说明**
**form表单查询弹窗配置**
form: {
labelMessage: '信息提示说明!!!',
componentProps: {
value:'undefined',//默认值,设置为'undefined'-->实际是undefined(解决SelectV2不显示占位符placeholder)
enterSearch: true, //可输入回车 对应绑定事件:@onEnter="onEnter"
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本

10
index.html

@ -6,14 +6,8 @@
<link rel="icon" href="/src/assets/imgs/logo1.png" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="keywords"
content="富维海拉智慧工厂管理平台 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
/>
<meta
name="description"
content="富维海拉智慧工厂管理平台 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
/>
<meta name="keywords" content="富维海拉智慧工厂管理平台" />
<meta name="description" content="富维海拉智慧工厂管理平台" />
<title>%VITE_APP_TITLE%</title>
</head>
<body>

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

@ -0,0 +1,63 @@
import request from '@/config/axios'
export interface BasicSpotCheckOptionVO {
id: number
code: string
name: string
selectId: number
describing: string
isUpdated: boolean
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询点检方案列表
export const getBasicSpotCheckOptionPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/basic-spotCheck-option/senior', data })
} else {
return await request.get({ url: `/eam/basic-spotCheck-option/page`, params })
}
}
// 查询点检方案详情
export const getBasicSpotCheckOption = async (id: number) => {
return await request.get({ url: `/eam/basic-spotCheck-option/get?id=` + id })
}
// 新增点检方案
export const createBasicSpotCheckOption = async (data: BasicSpotCheckOptionVO) => {
return await request.post({ url: `/eam/basic-spotCheck-option/create`, data })
}
// 修改点检方案
export const updateBasicSpotCheckOption = async (data: BasicSpotCheckOptionVO) => {
return await request.put({ url: `/eam/basic-spotCheck-option/update`, data })
}
// 删除点检方案
export const deleteBasicSpotCheckOption = async (id: number) => {
return await request.delete({ url: `/eam/basic-spotCheck-option/delete?id=` + id })
}
// 导出点检方案 Excel
export const exportBasicSpotCheckOption = async (params) => {
return await request.download({ url: `/eam/basic-spotCheck-option/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/basic-spotCheck-option/get-import-template' })
}
// 启用 / 禁用
export const updateEnableCode = async (data: BasicSpotCheckOptionVO) => {
return await request.post({ url: `/eam/basic-spotCheck-option/ables` , data })
}

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

@ -79,6 +79,7 @@ export const updateEquipmentRepairMain = async (data: EquipmentRepairJobMainVO)
return await request.post({ url: `/eam/equipment-repair-job-main/updateRepair`, data })
}
// 完成维修工单主
export const executeEquipmentRepairJobMain = async (data: EquipmentRepairJobMainVO) => {
return await request.post({ url: `/eam/equipment-repair-job-main/execute`, data })
@ -104,8 +105,13 @@ export const updateEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO)
return await request.post({ url: `/eam/equipment-repair-job-main/updateOrder`, data })
}
//验证不通过,打回维修工单
//维修验证不通过,打回维修工单
export const backEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => {
return await request.post({ url: `/eam/equipment-repair-job-main/fallback`, data })
}
//报修验证不通过,生成新工单
export const createEquipmentRepairNewOrder = async (data: EquipmentRepairJobMainVO) => {
return await request.post({ url: `/eam/equipment-repair-job-main/createNew`, data })
}

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

@ -81,3 +81,8 @@ export const updateEquipmentReportRepairOrder = async (data: EquipmentReportRepa
export const createEquipmentWeixiuOrder = async (data: EquipmentReportRepairRequestVO) => {
return await request.post({ url: `/eam/equipment-report-repair-request/updateCreateOrder`, data })
}
// 查询报修工单文件附件
export const getEquipmentReportFileInfo = async (data) => {
return await request.post({ url: `/eam/equipment-report-repair-request/fileListInfo`, data })
}

9
src/api/eam/inspectionItem/index.ts

@ -1,4 +1,5 @@
import request from '@/config/axios'
import {InspectionItemSelectSetVO} from "@/api/eam/inspectionItemSelectSet";
export interface InspectionItemVO {
id: number
@ -59,4 +60,10 @@ export const exportInspectionItem = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/basic/inspection-item/get-import-template' })
}
}
// 启用 / 禁用
export const updateEnableCode = async (data: InspectionItemVO) => {
return await request.post({ url: `/eam/basic/inspection-item/ables` , data })
}

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

@ -0,0 +1,91 @@
import request from '@/config/axios'
import {MaintenanceVO} from "@/api/eam/maintenance";
export interface PlanInspectionVO {
id: number
number: string
name: string
equipmentCode: string
type: string
optionCode: string
cycle: string
startTime: Date
endTime: Date
status: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: string
factoryAreaCode: string
workshopCode: string
lineCode: string
processCode: string
workstationCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询巡检计划列表
export const getPlanInspectionPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/plan-inspection/senior', data })
} else {
return await request.get({ url: `/eam/plan-inspection/page`, params })
}
}
// 查询巡检计划详情
export const getPlanInspection = async (id: number) => {
return await request.get({ url: `/eam/plan-inspection/get?id=` + id })
}
// 新增巡检计划
export const createPlanInspection = async (data: PlanInspectionVO) => {
return await request.post({ url: `/eam/plan-inspection/create`, data })
}
// 修改巡检计划
export const updatePlanInspection = async (data: PlanInspectionVO) => {
return await request.put({ url: `/eam/plan-inspection/update`, data })
}
// 修改巡检计划-审核
export const updateInspectionPlanAudi = async (data: PlanInspectionVO) => {
return await request.post({ url: `/eam/plan-inspection/updateAudi`, data })
}
// 删除巡检计划
export const deletePlanInspection = async (id: number) => {
return await request.delete({ url: `/eam/plan-inspection/delete?id=` + id })
}
// 导出巡检计划 Excel
export const exportPlanInspection = async (params) => {
return await request.download({ url: `/eam/plan-inspection/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/plan-inspection/get-import-template' })
}
// 启用 / 禁用
export const updateEnableCode = async (data: PlanInspectionVO) => {
return await request.post({ url: `/eam/plan-inspection/ables` , data })
}
// 修改计划状态
export const updateInspectionPlan = async (data: PlanInspectionVO) => {
return await request.post({ url: `/eam/plan-inspection/updatePlan`, data })
}

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

@ -0,0 +1,91 @@
import request from '@/config/axios'
import {PlanInspectionVO} from "@/api/eam/planInspection";
export interface PlanSpotCheckVO {
id: number
number: string
name: string
equipmentCode: string
type: string
optionCode: string
cycle: string
startTime: Date
endTime: Date
status: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
directCreateRecord: string
factoryAreaCode: string
workshopCode: string
lineCode: string
processCode: string
workstationCode: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询点检计划列表
export const getPlanSpotCheckPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/plan-spot-check/senior', data })
} else {
return await request.get({ url: `/eam/plan-spot-check/page`, params })
}
}
// 查询点检计划详情
export const getPlanSpotCheck = async (id: number) => {
return await request.get({ url: `/eam/plan-spot-check/get?id=` + id })
}
// 新增点检计划
export const createPlanSpotCheck = async (data: PlanSpotCheckVO) => {
return await request.post({ url: `/eam/plan-spot-check/create`, data })
}
// 修改点检计划
export const updatePlanSpotCheck = async (data: PlanSpotCheckVO) => {
return await request.put({ url: `/eam/plan-spot-check/update`, data })
}
// 修改巡检计划-审核
export const updateSpotCheckPlanAudi = async (data: PlanSpotCheckVO) => {
return await request.post({ url: `/eam/plan-spot-check/updateAudi`, data })
}
// 删除点检计划
export const deletePlanSpotCheck = async (id: number) => {
return await request.delete({ url: `/eam/plan-spot-check/delete?id=` + id })
}
// 导出点检计划 Excel
export const exportPlanSpotCheck = async (params) => {
return await request.download({ url: `/eam/plan-spot-check/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/plan-spot-check/get-import-template' })
}
// 启用 / 禁用
export const updateEnableCode = async (data: PlanSpotCheckVO) => {
return await request.post({ url: `/eam/plan-spot-check/ables` , data })
}
// 修改计划状态
export const updateSpotCheckPlan = async (data: PlanSpotCheckVO) => {
return await request.post({ url: `/eam/plan-spot-check/updatePlan`, data })
}

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' })
}

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

@ -0,0 +1,87 @@
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 })
}

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 getSparePartsInLocationDetailRecordPage = 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 getSparePartsInLocationDetailRecord = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-in-location-detail-record/get?id=` + id })
}
// 新增备件入库记录子
export const createSparePartsInLocationDetailRecord = async (data: SparePartsInLocationDetailRecordVO) => {
return await request.post({ url: `/eam/spare-parts-in-location-detail-record/create`, data })
}
// 修改备件入库记录子
export const updateSparePartsInLocationDetailRecord = async (data: SparePartsInLocationDetailRecordVO) => {
return await request.put({ url: `/eam/spare-parts-in-location-detail-record/update`, data })
}
// 删除备件入库记录子
export const deleteSparePartsInLocationDetailRecord = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-in-location-detail-record/delete?id=` + id })
}
// 导出备件入库记录子 Excel
export const exportSparePartsInLocationDetailRecord = 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 getSparePartsInLocationMainRecordPage = 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 getSparePartsInLocationMainRecord = async (id: number) => {
return await request.get({ url: `/eam/spare-parts-in-location-main-record/get?id=` + id })
}
// 新增备件入库记录主
export const createSparePartsInLocationMainRecord = async (
data: SparePartsInLocationMainRecordVO
) => {
return await request.post({ url: `/eam/spare-parts-in-location-main-record/create`, data })
}
// 修改备件入库记录主
export const updateSparePartsInLocationMainRecord = async (
data: SparePartsInLocationMainRecordVO
) => {
return await request.put({ url: `/eam/spare-parts-in-location-main-record/update`, data })
}
// 删除备件入库记录主
export const deleteSparePartsInLocationMainRecord = async (id: number) => {
return await request.delete({ url: `/eam/spare-parts-in-location-main-record/delete?id=` + id })
}
// 导出备件入库记录主 Excel
export const exportSparePartsInLocationMainRecord = 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 '@/utils/request'
// 创建领用出库记录子
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' })
}

5
src/api/wms/areabasic/index.ts

@ -23,6 +23,11 @@ export const getAreaPage = async (params) => {
return await request.get({ url: `/wms/areabasic/page`, params })
}
}
// 查询库区列表
export const selectAreabasicDOByCode = async (locationCode: String) => {
return await request.get({ url: `/wms/areabasic/getArea?locationCode=`+locationCode })
}
// 查询库区列表
export const getAreaList = async (params) => {
return await request.get({ url: `/wms/areabasic/list`, params })

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

@ -76,7 +76,7 @@ export const exportCountJobMain = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/count-job-main/export-excel-senior', data })
return request.downloadPost({ url: '/wms/count-job-main/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/count-job-main/export-excel`, params })
}
@ -98,4 +98,4 @@ export const handleExportCountJob = async (id: number) => {
masterId:id
}
return await request.download({ url: `/wms/count-job-main/export-excel-single`, params })
}
}

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

@ -63,7 +63,7 @@ export const exportCountPlanMain = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/count-plan-main/export-excel-senior', data })
return request.downloadPost({ url: '/wms/count-plan-main/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/count-plan-main/export-excel`, params })
}
@ -107,4 +107,4 @@ export const publish = (id) => {
// 重置
export const resetting = (id) => {
return request.put({ url: '/wms/count-plan-main/resetting?id=' + id })
}
}

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

@ -59,7 +59,7 @@ export const exportCountRecordMain = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/count-record-main/export-excel-senior', data })
return request.downloadPost({ url: '/wms/count-record-main/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/count-record-main/export-excel`, params })
}
@ -73,4 +73,4 @@ export const importTemplate = () => {
// 生成盘点调整
export const generateCountRecordMain = async (id) => {
return await request.put({ url: `/wms/count-record-main/generate?id=` + id})
}
}

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

@ -58,7 +58,7 @@ export const exportCountRequestMain = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/count-request-main/export-excel-senior', data })
return request.downloadPost({ url: '/wms/count-request-main/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/count-request-main/export-excel`, params })
}
@ -115,4 +115,4 @@ export const generateCountadjustRequest = async (id) => {
//解冻
export const thaw = async (id) => {
return await request.put({ url: `/wms/count-request-main/thaw?id=` + id })
}
}

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

@ -57,7 +57,7 @@ export const exportCountadjustRecordMain = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/countadjust-record-main/export-excel-senior', data })
return request.downloadPost({ url: '/wms/countadjust-record-main/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/countadjust-record-main/export-excel`, params })
}
@ -66,4 +66,4 @@ export const exportCountadjustRecordMain = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/countadjust-record-main/get-import-template' })
}
}

2
src/api/wms/countadjustRequestMain/index.ts

@ -57,7 +57,7 @@ export const exportCountadjustRequestMain = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/countadjust-request-main/export-excel-senior', data })
return request.downloadPost({ url: '/wms/countadjust-request-main/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/countadjust-request-main/export-excel`, params })
}

5
src/api/wms/itembasic/index.ts

@ -108,4 +108,9 @@ export const selectConfigToItembasic = async (params) => {
} else {
return await request.get({ url: `/wms/itembasic/pageConfigToItembasic`, params })
}
}
// 根据物料代码查计量单位
export const getQueryItemCodeInfo = async (data) => {
return await request.post({ url: 'wms/itembasic/queryItemCodeInfo', data })
}

9
src/api/wms/preparetoissueDetail/index.ts

@ -18,7 +18,14 @@ export interface PreparetoissueDetailVO {
// 查询备料计划子列表
export const getPreparetoissueDetailPage = async (params) => {
return await request.get({ url: `/wms/preparetoissue-detail/page`, params })
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/preparetoissue-detail/senior', data })
} else {
return await request.get({ url: `/wms/preparetoissue-detail/page`, params })
}
}
// 查询备料计划子详情

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

@ -66,6 +66,7 @@ export const getProductreceiptRequestDetailPageScrap = async (params) => {
}
}
// 查询制品收货申请子详情
export const getProductreceiptRequestDetail = async (id: number) => {
return await request.get({ url: `/wms/productreceipt-request-detail/get?id=` + id })

11
src/api/wms/purchasePlanDetail/index.ts

@ -56,3 +56,14 @@ export const deletePurchasePlanDetail = async (id: number) => {
export const exportPurchasePlanDetail = async (params) => {
return await request.download({ url: `/wms/purchase-plan-detail/export-excel`, params })
}
// WMS查询要货计划子列表
export const getPurchasePlanDetailPagewms = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchase-plan-detail/seniorWMS', data })
} else {
return await request.get({ url: `/wms/purchase-plan-detail/pageWMS`, params })
}
}

10
src/api/wms/purchasereceiptJobMain/index.ts

@ -100,6 +100,16 @@ export const exportPurchasereceiptJobMain = async (params) => {
}
}
// 导出备件收货任务
export const exportSparereceiptJobMain = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/purchasereceipt-job-main/export-excel-spare-senior`, data })
} else {
return await request.download({ url: `/wms/purchasereceipt-job-main/export-excel-spare`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchasereceipt-job-main/get-import-template' })

12
src/api/wms/purchasereceiptRecordMain/index.ts

@ -89,6 +89,16 @@ export const exportPurchasereceiptRecordMain = async (params) => {
}
}
// 导出备件收货记录
export const exportSparereceiptRecordMain = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/purchasereceipt-record-main/export-excel-spare-senior`, data })
} else {
return await request.download({ url: `/wms/purchasereceipt-record-main/export-excel-spare`, params })
}
}
// 导出采购收货记录主 Excel
export const exportPurchasereceiptRecordMainSCP = async (params) => {
if (params.isSearch) {
@ -112,4 +122,4 @@ export const createPutawayRequest = async (number:string) => {
// 创建检验申请
export const createInspectRequest = async (number:string) => {
return await request.post({ url: `/wms/purchasereceipt-record-main/createInspectRequest?number=`+number })
}
}

10
src/api/wms/purchasereceiptRequestMain/index.ts

@ -88,6 +88,16 @@ export const exportPurchasereceiptRequestMain = async (params) => {
}
}
// 导出备件收货申请
export const exportSparereceiptRequestMain = async (params) => {
if (params.isSearch) {
const data = {...params}
return await request.downloadPost({ url: `/wms/purchasereceipt-request-main/export-excel-spare-senior`, data })
} else {
return await request.download({ url: `/wms/purchasereceipt-request-main/export-excel-spare`, params })
}
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/purchasereceipt-request-main/get-import-template' })

8
src/api/wms/saleDetail/index.ts

@ -27,7 +27,13 @@ export interface SaleDetailVO {
// 查询销售订单子列表
export const getSaleDetailPage = async (params) => {
return await request.get({ url: `/wms/sale-detail/page`, params })
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/sale-detail/senior', data })
} else {
return await request.get({ url: `/wms/sale-detail/page`, params })
}
}
// 查询销售订单子详情

2
src/api/wms/supplierinvoiceRequestDetail/index.ts

@ -51,7 +51,7 @@ export const getSupplierinvoiceRequestDetail = async (id: number) => {
}
// 新增供应商发票申请子
export const createSupplierinvoiceRequestDetail = async (data: SupplierinvoiceRequestDetailVO) => {
export const createSupplierinvoiceRequestDetail = async (data) => {
return await request.post({ url: `/wms/supplierinvoice-request-detail/create`, data })
}

11
src/api/wms/warehouse/index.ts

@ -58,4 +58,15 @@ export const exportWarehouse = async (params) => {
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/warehouse/get-import-template' })
}
// 查询仓库列表
export const pageBusinessTypeToWarehouse = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/warehouse/pageBusinessTypeToWarehouseSenior', data })
} else {
return await request.get({ url: `/wms/warehouse/pageBusinessTypeToWarehouse`, params })
}
}

10
src/components/BasicForm/src/BasicForm.vue

@ -566,9 +566,15 @@ const buttonBaseClick = (val) => {
}
//
else if (val == 'save') {
debounce(() => {
let timer = null
if(!timer){
submitForm()
}, 2000)()
timer = setTimeout(()=>{
if(timer){
clearTimeout(timer)
}
},2000)
}
}
//
else if (val == 'close') {

65
src/components/Detail/src/Detail.vue

@ -359,6 +359,12 @@ const props = defineProps({
type: Boolean,
required: false,
default: true
},
//
detailButtonIsShowAddStatusArray:{
type: Array,
required: false,
default: () => ['1']
},
//
detailButtonIsShowEdit:{
@ -378,12 +384,23 @@ const props = defineProps({
required: false,
default: false
},
fieldTableColumn:{
type: String,
required: false,
default: ''
},
//
otherHeadButttonData:{
type:Array,
required: false,
default: () => []
}
},
//--
mainSubmitCreateApi:{
type: Boolean,
required: false,
default: false
},
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
@ -627,7 +644,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
//
detailButtonAdd = [
defaultButtons.defaultAddBtn({
hide: isShowMainButton(row, ['1'])
hide: isShowMainButton(row, props.detailButtonIsShowAddStatusArray)
})
]
}
@ -646,7 +663,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
//
detailButtonEdit = [
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1'])
hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray)
})
]
}
@ -654,7 +671,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
//
detailButtonDelete = [
defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['1'])
hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray)
})
]
}
@ -665,7 +682,10 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
}
}
}
defineExpose({ openDetail, formRef }) // open
const updateList = ()=>{
getList()
}
defineExpose({ openDetail, formRef ,updateList}) // open
//
const getRemarkList = async () => {
@ -722,16 +742,19 @@ const buttonBaseClick = (val, item) => {
masterId: masterParmas.value.masterId,
number: masterParmas.value.number
})
const item = props.detailAllSchemas.formSchema[0]
opensearchTable(
item.field, item?.componentProps?.searchField,
item?.componentProps?.searchTitle,
item?.componentProps?.searchAllSchemas,
item?.componentProps?.searchPage,
item?.componentProps?.searchCondition,
item?.componentProps?.multiple,
undefined,undefined
)
if(props.fieldTableColumn!=''){
const item = props.detailAllSchemas.formSchema.find(item=>item.field == props.fieldTableColumn)
opensearchTable(
item.field, item?.componentProps?.searchField,
item?.componentProps?.searchTitle,
item?.componentProps?.searchAllSchemas,
item?.componentProps?.searchPage,
item?.componentProps?.searchCondition,
item?.componentProps?.multiple,
undefined,undefined
)
}
}else{
openForm('create')
}
@ -861,13 +884,19 @@ const submitForm = async (formType, data) => {
const searchTableSuccess1 = (formField, searchField, val, formRef) => {
searchTableFormModel.value[formField] = val.map(item=>item[searchField]).join(',')
console.log('searchTableSuccess1',searchTableFormModel)
submitForm(searchTableFormType.value,searchTableFormModel.value)
emit('searchTableSuccessDetail', formField, searchField, val, formRef)
if(props.mainSubmitCreateApi){
emit('searchTableSuccessDetail', formField, searchField, val, formRef,searchTableFormModel.value)
}else{
submitForm(searchTableFormType.value,searchTableFormModel.value)
emit('searchTableSuccessDetail', formField, searchField, val, formRef)
}
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
emit('searchTableSuccessDetail', formField, searchField, val, formRef)
}
//
const emit = defineEmits([
'searchTableSuccessDetail',
@ -879,7 +908,7 @@ const emit = defineEmits([
'onBlur',
'detailBasicFormOnChange',
'formFormDateChange',
'buttonBaseClick'
'buttonBaseClick',
])
/** 删除按钮操作 */
const handleDelete = async (id: number) => {

2
src/components/DetailTable/src/DetailTable.vue

@ -58,7 +58,7 @@ const countScopeType = ref(props.countScopeType)
const allList = ref(props.allList)
const forrmatter = (val) => {
if(val){
return countScopeType.value.find((cur) => cur.value == val).label
return countScopeType.value.find((cur) => cur.value == val)?.label || ''
}else{
return ''
}

9
src/components/Form/src/Form.vue

@ -55,7 +55,7 @@ export default defineComponent({
vLoading: propTypes.bool.def(false),
labelPosition: propTypes.string.def('left'),
},
emits: ['register','opensearchTable','clearSearchInput', 'onChange', 'onBlur','onEnter','hiddenFilterButton','changeDialogWidth'],
emits: ['register','opensearchTable','clearSearchInput', 'onChange', 'onBlur','onEnter','hiddenFilterButton','changeDialogWidth','onInput'],
setup(props, { slots, expose, emit }) {
// element form
const elFormRef = ref<ComponentRef<typeof ElForm>>()
@ -204,6 +204,9 @@ export default defineComponent({
const onBlur = (field, e) => {
emit('onBlur', field, e)
}
const onInput = (field,value) => {
emit('onInput', field,value)
}
// formItem
const renderFormItem = (item: FormSchema) => {
// options
@ -382,6 +385,7 @@ export default defineComponent({
style={item.componentProps?.style}
onChange={(e)=>{onChange(item.field, e)}}
onBlur={(e)=>{onBlur(item.field, e)}}
onInput={(value)=>{onInput(item.field,value)}}
{...(notRenderOptions.includes(item?.component as string) &&
item?.componentProps?.options
? { options: item?.componentProps?.options || [] }
@ -460,4 +464,7 @@ export default defineComponent({
margin-right: 0 !important;
margin-left: 0 !important;
}
::v-deep(.el-select-v2 .el-icon) {
display: inline-flex;
}
</style>

2
src/components/Form/src/helper.ts

@ -127,7 +127,7 @@ export const initModel = (schema: FormSchema[], formModel: Recordable) => {
} else if (v.component && v.component !== 'Divider') {
const hasField = Reflect.has(model, v.field)
// 如果先前已经有值存在,则不进行重新赋值,而是采用现有的值
model[v.field] = hasField ? model[v.field] : v.value !== void 0 ? v.value : ''
model[v.field] = hasField ? model[v.field] : v.value === 'undefined' ? undefined : v.value !== void 0 ? v.value : ''
}
})
return model

15
src/components/Search/src/Search.vue

@ -43,7 +43,7 @@ const props = defineProps({
}
})
const emit = defineEmits(['search', 'reset'])
const emit = defineEmits(['search', 'reset','onInput'])
const visible = ref(true)
@ -88,6 +88,14 @@ const { register, elFormRef, methods } = useForm({
model: props.model || {}
})
const onInput = (field,value) => {
emit('onInput', field,value)
}
const formRef = ref()
const setFormValues = (formData)=>{
formRef.value.setValues(formData)
}
const search = async () => {
await unref(elFormRef)?.validate(async (isValid) => {
if (isValid) {
@ -118,12 +126,14 @@ const setVisible = () => {
}
const Search = ref()
onMounted(() => {})
defineExpose({setFormValues}) // open
</script>
<template>
<!-- update by 芋艿class="-mb-15px" 用于降低和 ContentWrap 组件的底部距离避免空隙过大 -->
<div ref="Search">
<Form
<Form ref="formRef"
:inline="inline"
:is-col="isCol"
:is-custom="false"
@ -132,6 +142,7 @@ onMounted(() => {})
class="-mb-15px search"
hide-required-asterisk
@register="register"
@onInput="onInput"
>
<template #action>
<div v-if="layout === 'inline'">

153
src/components/TableFormCountPlan/src/TableFormCountPlan.vue

@ -13,82 +13,86 @@
@click="handleDeleteTable(row, $index)"
/>
</el-table-column>
<el-table-column :label="tableFields[0].label" align="center">
<template v-slot="{ row }">
<el-form
<el-table-column :label="tableFields[0].label" align="center" v-slot="{ row, $index }">
<el-form :key="'类型form'+$index"
ref="TableBaseForm_Ref"
:model="row"
style="width: 100%;"
:rules="tableFormRules"
:class="tableFormRules ? '' : 'noRulesForm'">
<el-form-item :prop="tableFields[0].field">
<el-select :key="row.id+$index"
v-model="row.type"
:placeholder="tableFields[0].placeholder || '请输入' + tableFields[0].label"
@change="tableFormChange(tableFields[0].field, $event, row)"
>
<el-option
v-for="dict in countScopeType"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-form-item :key="'类型formitem'+$index" :prop="tableFields[0].field">
<el-select :key="'类型select'+row.id+$index"
v-model="row.type"
:placeholder="tableFields[0].placeholder || '请输入' + tableFields[0].label"
@change="tableFormChange(tableFields[0].field, $event, row)"
>
<el-option
v-for="dict in countScopeType"
:key="'类型option'+dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column
:prop="tableFields[1].field"
:label="tableFields[1].label"
align="center"
align="center" v-slot="{ row, $index }"
>
<template v-slot="{ row }">
<el-form
<el-form :key="'值form'+$index"
ref="TableBaseForm_Ref1"
:model="row"
style="width: 100%;"
:rules="tableFormRules"
:class="tableFormRules ? '' : 'noRulesForm'">
<el-form-item :prop="tableFields[1].field">
<el-select :key="row.id+$index"
v-model="row.value"
:placeholder="
tableFields[1].placeholder ||
'请输入' + tableFields[1].label
"
v-if="
row.type == 'OWNER' ||
row.type == 'SUPPLIER' ||
row.type == 'CUSTOMER' ||
row.type == 'ABC' ||
row.type == 'ITEMS_TYPE' ||
row.type == 'ITEMS_GROUP' ||
row.type == 'ITEMS_CODE' ||
row.type == 'WAREHOUSE_CODE' ||
row.type == 'AREABASIC_CODE' ||
row.type == 'LOCATIONGROUP_CODE' ||
row.type == 'LOCATION_CODE'
"
>
<el-option
v-for="item in row.initOptions"
:key="item.value"
:label="item.label"
:value="item.value"
<el-form-item :key="'值formitem'+$index" :prop="tableFields[1].field">
<el-select :key="'值select'+row.id+$index"
v-model="row.value"
:placeholder="
tableFields[1].placeholder ||
'请输入' + tableFields[1].label
"
filterable
:filter-method="(value) =>filterMethod(value,row)"
@focus="focusValue(row)"
v-if="
row.type == 'OWNER' ||
row.type == 'SUPPLIER' ||
row.type == 'CUSTOMER' ||
row.type == 'ABC' ||
row.type == 'ITEMS_TYPE' ||
row.type == 'ITEMS_GROUP' ||
row.type == 'ITEMS_CODE' ||
row.type == 'WAREHOUSE_CODE' ||
row.type == 'AREABASIC_CODE' ||
row.type == 'LOCATIONGROUP_CODE' ||
row.type == 'LOCATION_CODE'
"
>
<el-option
v-for="item in currentList(initOptions_result)"
:key="'值option'+item.value"
:label="item.label"
:value="item.value"
/>
<div style="display: flex;align-items: center">
<span style="padding: 10px;">{{ pageCount }} </span>
<el-button text bg size="small" :disabled="pageCount<=1" @click="prexPage">上一页</el-button>
<el-button text bg size="small" :disabled="initOptions_result&&pageCount*15>=initOptions_result.length" @click="nextPage">下一页</el-button>
</div>
</el-select>
<el-input :key="'值input'+$index"
v-model="row.value"
:placeholder="
tableFields[1].placeholder ||
'请输入' + tableFields[1].label
"
v-else
/>
</el-select>
<el-input
v-model="row.value"
:placeholder="
tableFields[1].placeholder ||
'请输入' + tableFields[1].label
"
v-else
/>
</el-form-item>
</el-form-item>
</el-form>
</template>
</el-table-column>
</el-table>
<div class="button flex">
@ -127,7 +131,7 @@ const props = defineProps({
countScopeType: {
type: Array,
required: false,
default: null
default: []
},
})
const tableData = props.tableData
@ -162,6 +166,7 @@ const selectChange = (field, val) => {
}
const tableFormChange = (field, val, row) => {
pageCount.value = 1
emit('tableFormChange', field, val, row)
}
//
@ -172,6 +177,38 @@ const handleAddTable = () => {
const handleDeleteTable = (row, index) => {
emit('handleDeleteTable', row, index)
}
const pageCount = ref(1)
const currentList = (options)=>{
if(options&&options.length>0){
return options.slice((pageCount.value-1)*15,pageCount.value*15)
}else{
return []
}
}
const nextPage = ()=>{
pageCount.value++
}
const prexPage = ()=>{
pageCount.value--
}
const initOptions_result = ref([])
const filterMethod = (query,row)=>{
console.log('filterMethod')
if (query) {
initOptions_result.value = row.initOptions.filter((item) => {
return item.label.includes(query)
})
} else {
initOptions_result.value = [...row.initOptions]
}
}
const focusValue = (row)=>{
console.log('focusValue',row)
if(!row.value){
initOptions_result.value = [...row.initOptions]
}
}
// setup
defineExpose({
TableBaseComponents_Ref,

13
src/components/XButton/src/ButtonBase.vue

@ -72,8 +72,17 @@ const props = defineProps({
const emit = defineEmits(['buttonBaseClick', 'updataTableColumns'])
const buttonBaseClick = (val, item, $event) => {
clearButtonBlurHandle($event) //el-button
emit('buttonBaseClick', val, item, $event)
let timer = null
if(!timer){
clearButtonBlurHandle($event) //el-button
emit('buttonBaseClick', val, item, $event)
timer = setTimeout(()=>{
if(timer){
clearTimeout(timer)
}
},2000)
}
}
const popoverVisible = ref(false)
//

2
src/config/axios/config.ts

@ -16,7 +16,7 @@ const config: {
/**
*
*/
request_timeout: 300000,
request_timeout: 3000000,
/**
*

5
src/locales/en-US.ts

@ -44,6 +44,7 @@ export default {
importMessage: 'Whether to confirm import data item?',
createSuccess: 'Create Success',
updateSuccess: 'Update Success',
emailSentSuccess: 'Email sent successfully',
delMessage: 'Delete the selected data?',
delDataMessage: 'Delete the data?',
delNoData: 'Please select the data to delete',
@ -325,6 +326,7 @@ export default {
viewDetail:'Detailed list',
updataRecode:'Updata recode',
applyDecision:'Apply Decision',
auditing:'Auditing',
},
dialog: {
dialog: 'Dialog',
@ -992,6 +994,8 @@ export default {
'是否接受所选中数据?':'Do you accept the selected data?',
'接受成功!':'Accept Successfully!',
'是否驳回所选中数据?':'Do you reject the selected data?',
'是否撤回所选中数据?':'Do you revoke the selected data?',
'是否提交审核?':'Do you audit the selected data?',
'驳回成功!':'Reject Succussfully!',
'要货计划主':'Ask for master data of cargo plan',
'要货计划数量不得大于订单数量-已计划数量':'The planned quantity of the requested goods shall not be greater than the order quantity - the planned quantity',
@ -1052,6 +1056,7 @@ export default {
:'Supplier invoice request details',
:'Supplier invoice record master data',
:'Pass the audit',
:'Recall successful',
:'Cancellation',
'是否审批拒绝所选中数据?':'Do you want to approve and reject selected data?',
'审批成功!':'Approval is successful!',

5
src/locales/zh-CN.ts

@ -44,6 +44,7 @@ export default {
importMessage: '是否确认导入数据项?',
createSuccess: '新增成功',
updateSuccess: '修改成功',
emailSentSuccess: '邮件发送成功',
delMessage: '是否删除所选中数据?',
delDataMessage: '是否删除数据?',
delNoData: '请选择需要删除的数据',
@ -324,6 +325,7 @@ export default {
viewDetail:'明细列表',
updataRecode:'更新记录',
applyDecision:'使用决策',
auditing:'审核',
},
dialog: {
dialog: '弹窗',
@ -992,6 +994,8 @@ export default {
'是否接受所选中数据?':'是否接受所选中数据?',
'接受成功!':'接受成功!',
'是否驳回所选中数据?':'是否驳回所选中数据?',
'是否撤回所选中数据?':'是否撤回所选中数据?',
'是否提交审核?':'是否提交审核?',
'驳回成功!':'驳回成功!',
'要货计划主':'要货计划主',
'要货计划数量不得大于订单数量-已计划数量':'要货计划数量不得大于订单数量-已计划数量',
@ -1052,6 +1056,7 @@ export default {
:'供应商发票申请明细',
:'供应商发票记录主',
:'审核通过',
:'撤回成功',
:'作废',
'是否审批拒绝所选中数据?':'是否审批拒绝所选中数据?',
'审批成功!':'审批成功!',

8
src/utils/dict.ts

@ -354,6 +354,8 @@ export enum DICT_TYPE {
REPAIR_LEVEL = 'repair_level', //维修级别
IS_COMPLETED = 'is_completed', //是否完成
MAINTENANCE_CYCLE ='maintenance_cycle', // 保养周期
INSPECTION_CYCLE ='inspection_cycle', // 巡检周期
SPOTCHECK_CYCLE ='spotcheck_cycle', // 巡检周期
EAM_ORDER_STATUS = 'eam_order_status',// 工单状态
TOOL_CLASS = 'tool_class', //工装类型
TOOL_OUT_TYPE = 'tool_out_type', //工装出库类型
@ -363,5 +365,9 @@ export enum DICT_TYPE {
EAM_MAINTENANCE_URGENCY = 'eam_maintenance_urgency', // 维保紧急程度
EAM_MAINTENANCE_LEVEL = 'eam_maintenance_level', // 维保维修级别
EAM_REPAIR_STATUS = 'eam_repair_status', // 维修状态
OFF_BACK_STATUS = 'off_back_status'
EAM_COMPLETE_RESULT = 'eam_complete_result', // 维修状态
OFF_BACK_STATUS = 'off_back_status',
SPAREPARTS_APPLY_STATUS_ENUM = 'spareparts_apply_status_enum',// 流程状态
IS_LINE_ITEM = 'is_line_item', // 是否是线边
PUT_IN_TYPE = 'put_in_type',// 入库类型
}

25
src/utils/disposition/defaultButtons.ts

@ -389,6 +389,19 @@ export function mainListExecuteBtn(option:any) {
})
}
// 主列表-转办按钮
export function mainListTransferBtn(option:any) {
return __defaultBtnOption(option,{
label: t(`ts.转办`).replace('ts.', ''),
name: 'transfer',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-完成按钮
export function mainListFinishBtn(option:any) {
return __defaultBtnOption(option,{
@ -440,6 +453,18 @@ export function mainListValidateRepairBtn(option:any) {
hasPermi: ''
})
}
// 主列表-预览按钮
export function viewBtn(option:any) {
return __defaultBtnOption(option,{
label: '预览',
name: 'view',
hide: false,
type: 'success',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-审核按钮
export function mainListAuditingBtn(option:any) {

300
src/views/eam/SparePartsOutLocationRecord/SparePartsOutLocationRecord.data.ts

@ -0,0 +1,300 @@
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 SparePartsOutLocationRecordMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '申请编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '描述',
field: 'description',
sort: 'custom',
isSearch: true
},
{
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,
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: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
])
)
//表单校验
export const SparePartsOutLocationRecordMainRules = reactive({
description: [{ required: true, message: '描述不能为空', trigger: 'change' }]
})
/**
* @returns {Array}
*/
export const SparePartsOutLocationRecordDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '备件编号',
field: 'sparePartsCode',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'itemNumber', // 查询弹窗赋值字段
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: 'type',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
isSearch: false,
table: {
width: 150
},
tableForm: {
type: 'Select'
}
},
{
label: '设备工装编号',
field: 'equipmentCode',
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: 'currentQty',
sort: 'custom',
isSearch: false,
tableForm: {
disabled: true
}
},
{
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 SparePartsOutLocationRecordDetailRules = reactive({
applyQty: [{ required: true, message: '请输入标包数量', trigger: 'blur' }]
})

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/sparePartsOutLocationDetailRecord.js'
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>

27
src/views/eam/basicInspectionOption/index.vue

@ -39,16 +39,17 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="BasicInspectionOptionRules"
:formAllSchemas="BasicInspectionOption.allSchemas"
:apiUpdate="BasicInspectionOptionApi.updateBasicInspectionOption"
:apiCreate="BasicInspectionOptionApi.createBasicInspectionOption"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- <BasicForm-->
<!-- ref="basicFormRef"-->
<!-- @success="formsSuccess"-->
<!-- :rules="BasicInspectionOptionRules"-->
<!-- :formAllSchemas="BasicInspectionOption.allSchemas"-->
<!-- :apiUpdate="BasicInspectionOptionApi.updateBasicInspectionOption"-->
<!-- :apiCreate="BasicInspectionOptionApi.createBasicInspectionOption"-->
<!-- @searchTableSuccess="searchTableSuccess"-->
<!-- :isBusiness="false"-->
<!-- />-->
<ItemForm ref="basicFormRef" @success="getData"/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="BasicInspectionOption.allSchemas" />
@ -65,6 +66,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 ItemForm from "@/views/eam/basicInspectionOption/itemSelectSetForm.vue";
defineOptions({ name: 'BasicInspectionOption' })
@ -205,6 +207,11 @@ const formsSuccess = async (formType,data) => {
getList()
}
//
const getData = async() => {
getList();
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {

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

@ -0,0 +1,393 @@
<template>
<Dialog v-model="dialogVisible" :title="dialogTitle">
<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="code">
<el-input v-model="formData.code" placeholder="方案编号" :disabled="isDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="方案名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入方案名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否可修改" prop="isUpdated">
<el-select v-model="formData.isUpdated" style="width: 200px">
<el-option label="是" value="TRUE"></el-option>
<el-option label="否" value="FALSE"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="describing">
<el-input v-model="formData.describing" placeholder="请输入描述" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否可用" prop="available">
<el-select v-model="formData.available" style="width: 200px">
<el-option label="是" value="TRUE"></el-option>
<el-option label="否" value="FALSE"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="选择集ID" prop="selectId">
<div class="tag-container flex gap-2">
<el-tag v-for="ent in tags" :key="ent.selectId" closable :disable-transitions="false" @close="handleClose(ent.selectId)">
{{ ent.selectId}}
</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">
添加巡检选择集
</el-button>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table :data="inspectionItemData" style="width: 100%; height: 80%">
<el-table-column prop="itemCode" label="巡检项ID" />
<el-table-column prop="itemName" label="巡检名称" />
<el-table-column prop="isSelectd" label="" width="150" >
<template #header>
<span>是否必选默认是</span>
</template>
<template #default="scope">
<el-switch
v-model="scope.row.isSelectd"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="是"
inactive-text="否"
/>
</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>
</template>
</Dialog>
<!--添加巡检项弹窗-->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</template>
<script lang="ts" setup>
import * as BasicInspectionOptionApi from '@/api/eam/basicInspectionOption'
import request from "@/config/axios";
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";
defineOptions({ name: 'TeamForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const tags=ref([])
const inputValue = ref('')
const inputVisible = ref(false)
const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
//
const inspectionItemData = ref([])
const itemData = ref({
id: '',
content: '',
selectId:''
})
const formData = ref({
code: '',
name: '',
describing: '',
isUpdated: '',
remark: '',
available: '',
selectId: '',
optionItem:[]
})
const formRules = reactive({
code: [
{ required: true, message: '方案编号不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ required: true, message: '方案名称不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
isUpdated: [
{ required: true, message: '不能为空', trigger: 'blur' },
],
available: [
{ required: true, message: '不能为空', trigger: 'blur' },
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})
const basicFormRef = ref() // Ref
/** 删除巡检项 */
const handleClose = (id: string) => {
const index = tags.value.findIndex(tag => tag.selectId === id);
if (index !== -1) {
tags.value.splice(index, 1);
}
}
/** 弹窗相关参数 */
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 = inspectionItemItemSelectSetApi.getInspectionItemSelectSetPage
_searchTableAllSchemas.value = InspectionItemSelectSet.allSchemas
openCommon()
}
/** 弹窗选择之后 回调函数 添加选择集 */
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);
if (!isExist) {
const newItem = {};
newItem['itemCode'] = item.itemCode;
newItem['selectId'] = item.id;
tags.value = [];
tags.value.push(newItem);
}
itemsId = item.itemCode;
});
//
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)
const newItem = {};
newItem['itemCode'] = res.id;
newItem['itemName'] = res.name;
newItem['equipmentParts'] = res.equipmentParts;
newItem['isSelectd'] = true;
inspectionItemData.value.push(newItem);
}
} finally {
formLoading.value = false;
}
}
})
}
/*打开弹窗*/
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
dialogTitle.value = t('action.' + type)
formType.value = type
//
if (row) {
isDisabled.value = true;
formLoading.value = true
formData.value = row;
//
let item = (row.id.toString()).split(",")
try {
tags.value=[];
for (var i = 0; i < item.length; i++) {
itemData.value = await request.get({ url: `/eam/basic-inspection-option/get?id=` + item[i] });
tags.value.push(itemData.value);
}
} finally {
formLoading.value = false
}
//
let res = await request.get({url: `/eam/relation-inspection-option-item/getList?optionCode=` + row.code})
try {
inspectionItemData.value = [];
formLoading.value = true;
for (const item of res) {
const newItem = {};
newItem['id'] = item.id;
newItem['itemCode'] = item.itemCode;
newItem['itemName'] = item.itemName;
newItem['isSelectd'] = item.isSelectd;
inspectionItemData.value.push(newItem);
}
} finally {
formLoading.value = false;
}
}
//
else {
resetForm()
isDisabled.value = false;
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
if (inspectionItemData.value.length > 10 ){
message.warning('巡检项最多10个');
return
}
// ID
formData.value.selectId = tags.value[0].selectId
//
formLoading.value = true
try {
if (formType.value === 'create') {
for (var i = 0; i < inspectionItemData.value.length; i++) {
inspectionItemData.value[i].optionCode = formData.value.code
}
formData.value.optionItem = inspectionItemData.value
//
await BasicInspectionOptionApi.createBasicInspectionOption(formData.value)
message.success(t('common.createSuccess'))
} else {
for (var i = 0; i < inspectionItemData.value.length; i++) {
inspectionItemData.value[i].optionCode = formData.value.code
}
formData.value.optionItem = inspectionItemData.value
await BasicInspectionOptionApi.updateBasicInspectionOption(formData.value)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
code: '',
name: '',
describing: '',
isUpdated: '',
remark: '',
available: '',
selectId: ''
}
tags.value=[];
inspectionItemData.value = [];
basicFormRef.value?.resetFields()
}
</script>
<style scoped>
.tag-container {
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */
border: 1px solid #ccc; /* 添加边框样式 */
padding: 10px; /* 可根据需要调整容器内边距 */
width: 950px; /* 设置固定宽度为 950px */
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */
overflow-wrap: break-word; /* 兼容性更好的写法 */
flex-wrap: wrap;
}
.input-with-button {
display: flex;
align-items: center;
width: 100%;
}
.input-with-button > .el-input {
flex: 1;
/*margin-right: 10px;*/
}
</style>

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

@ -101,10 +101,6 @@ 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 {
BasicMaintenanceOptionVO,
createBasicMaintenanceOption, updateBasicMaintenanceOption
} from "@/api/eam/basicMaintenanceOption";
defineOptions({ name: 'TeamForm' })
@ -319,6 +315,7 @@ const submitForm = async () => {
// ID
formData.value.selectId = tags.value[0].selectId
console.log(formData.value)
//
formLoading.value = true
//formData.value.members = JSON.stringify(tags.value)

200
src/views/eam/basicSpotCheckOption/basicSpotCheckOption.data.ts

@ -0,0 +1,200 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as ItemApi from "@/api/eam/spotCheckSelectSet";
import {BasicSpotCheckSelectSet} from "@/views/eam/spotCheckSelectSet/spotCheckSelectSet.data";
// 表单校验
export const BasicSpotCheckOptionRules = reactive({
code: [required],
selectId: [required],
})
export const BasicSpotCheckOption = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '编号',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '方案名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '选择集ID',
field: 'selectId',
sort: 'custom',
isDetail: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '点检选择集信息', // 查询弹窗标题
searchAllSchemas: BasicSpotCheckSelectSet.allSchemas, // 查询弹窗所需类
searchField: 'id', // 查询弹窗赋值字段
searchPage: ItemApi.getBasicSpotCheckSelectSetPage, // 查询弹窗所需分页方法
multiple:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
}]
}
}
},
{
label: '描述',
field: 'describing',
sort: 'custom',
isSearch: true,
},
{
label: '项是否可修改',
field: 'isUpdated',
sort: 'custom',
dictType: DICT_TYPE.IS_UPDATED,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isTable: true,
isDetail: false,
isSearch: true,
isTableForm: false,
isForm: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
// {
// label: '保养项',
// field: 'type',
// sort: 'custom',
// isSearch: true,
// },
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail: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: '部门id',
field: 'departmentCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isTable: true,
isDetail: false,
isSearch: false,
isTableForm: false,
isForm: false,
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail: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: '删除人id',
field: 'deleterId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

300
src/views/eam/basicSpotCheckOption/index.vue

@ -0,0 +1,300 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="BasicSpotCheckOption.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="BasicSpotCheckOption.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<!-- <BasicForm-->
<!-- ref="basicFormRef"-->
<!-- @success="formsSuccess"-->
<!-- :rules="BasicSpotCheckOptionRules"-->
<!-- :formAllSchemas="BasicSpotCheckOption.allSchemas"-->
<!-- :apiUpdate="BasicSpotCheckOptionApi.updateBasicSpotCheckOption"-->
<!-- :apiCreate="BasicSpotCheckOptionApi.createBasicSpotCheckOption"-->
<!-- @searchTableSuccess="searchTableSuccess"-->
<!-- :isBusiness="false"-->
<!-- />-->
<ItemForm ref="basicFormRef" @success="getData"/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="BasicSpotCheckOption.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/basic-spot-check-option/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { BasicSpotCheckOption,BasicSpotCheckOptionRules } from './basicSpotCheckOption.data'
import * as BasicSpotCheckOptionApi from '@/api/eam/basicSpotCheckOption'
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 ItemForm from "@/views/eam/basicSpotCheckOption/itemSelectSetForm.vue";
defineOptions({ name: 'BasicSpotCheckOption' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(BasicSpotCheckOption.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: BasicSpotCheckOptionApi.getBasicSpotCheckOptionPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:basicSpotCheckOption:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:basicSpotCheckOption:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:basicSpotCheckOption: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({hasPermi:'eam:basicSpotCheckOption:update'}), //
//defaultButtons.mainListDeleteBtn({hasPermi:'eam:basicSpotCheckOption:delete'}), //
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:basicSpotCheckOption:update'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:basicSpotCheckOption:update'}),
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'enable') {
handleEnable(row.id)
}else if (val == 'disable') {
handleDisable(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =BasicSpotCheckOption.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await BasicSpotCheckOptionApi.createBasicSpotCheckOption(data)
message.success(t('common.createSuccess'))
} else {
await BasicSpotCheckOptionApi.updateBasicSpotCheckOption(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicBasicSpotCheckOption')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await BasicSpotCheckOptionApi.deleteBasicSpotCheckOption(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 启用 */
const handleEnable = async (id: number) => {
try {
const params = ref({
id: '',
available:'',
})
params.value.id = id
params.value.available = 'TRUE'
await BasicSpotCheckOptionApi.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 BasicSpotCheckOptionApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
//
const getData = async() => {
getList();
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await BasicSpotCheckOptionApi.exportBasicSpotCheckOption(tableObject.params)
download.excel(data, '点检方案.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '点检方案导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

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

@ -0,0 +1,387 @@
<template>
<Dialog v-model="dialogVisible" :title="dialogTitle">
<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="code">
<el-input v-model="formData.code" placeholder="方案编号" :disabled="isDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="方案名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入方案名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否可修改" prop="isUpdated">
<el-select v-model="formData.isUpdated" style="width: 200px">
<el-option label="是" value="TRUE"></el-option>
<el-option label="否" value="FALSE"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="describing">
<el-input v-model="formData.describing" placeholder="请输入描述" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否可用" prop="available">
<el-select v-model="formData.available" style="width: 200px">
<el-option label="是" value="TRUE"></el-option>
<el-option label="否" value="FALSE"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="选择集ID" prop="selectId">
<div class="tag-container flex gap-2">
<el-tag v-for="ent in tags" :key="ent.selectId" closable :disable-transitions="false" @close="handleClose(ent.selectId)">
{{ ent.selectId}}
</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">
添加点检选择集
</el-button>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table :data="spotCheckItemData" style="width: 100%; height: 80%">
<el-table-column prop="itemCode" label="点检项ID" />
<el-table-column prop="itemName" label="点检名称" />
<el-table-column prop="isSelectd" label="" width="150" >
<template #header>
<span>是否必选默认是</span>
</template>
<template #default="scope">
<el-switch
v-model="scope.row.isSelectd"
active-color="#13ce66"
inactive-color="#ff4949"
active-text="是"
inactive-text="否"
/>
</template>
</el-table-column>
</el-table>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
<!--添加巡检项弹窗-->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</template>
<script lang="ts" setup>
import request from "@/config/axios";
import { SearchTable } from '@/components/SearchTable'
import { BasicSpotCheckSelectSet} from "@/views/eam/spotCheckSelectSet/spotCheckSelectSet.data";
import * as SpotCheckSelectSetApi from "@/api/eam/spotCheckSelectSet";
import * as BasicSpotCheckOptionApi from "@/api/eam/basicSpotCheckOption";
import {ElInput} from "element-plus";
defineOptions({ name: 'TeamForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const tags=ref([])
const inputValue = ref('')
const inputVisible = ref(false)
const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
//
const spotCheckItemData = ref([])
const itemData = ref({
id: '',
content: '',
selectId:''
})
const formData = ref({
code: '',
name: '',
describing: '',
isUpdated: '',
remark: '',
available: '',
selectId: '',
optionItem:[]
})
const formRules = reactive({
code: [
{ required: true, message: '方案编号不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
name: [
{ required: true, message: '方案名称不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
isUpdated: [
{ required: true, message: '不能为空', trigger: 'blur' },
],
available: [
{ required: true, message: '不能为空', trigger: 'blur' },
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})
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);
}
}
/** 弹窗相关参数 */
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,'dianJianItem')
}
/** 选择巡检项弹窗 */
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 = SpotCheckSelectSetApi.getBasicSpotCheckSelectSetPage
_searchTableAllSchemas.value = BasicSpotCheckSelectSet.allSchemas
openCommon()
}
/** 弹窗选择之后 回调函数 添加选择集 */
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);
if (!isExist) {
const newItem = {};
newItem['itemCode'] = item.itemCode;
newItem['selectId'] = item.id;
tags.value = [];
tags.value.push(newItem);
}
itemsId = item.itemCode;
});
//
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})
const newItem = {};
newItem['itemCode'] = res.id;
newItem['itemName'] = res.name;
newItem['equipmentParts'] = res.equipmentParts;
newItem['isSelectd'] = true;
spotCheckItemData.value.push(newItem);
}
} finally {
formLoading.value = false;
}
}
})
}
/*打开弹窗*/
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
dialogTitle.value = t('action.' + type)
formType.value = type
//
if (row) {
isDisabled.value = true;
formLoading.value = true
formData.value = row;
//
let item = (row.id.toString()).split(",")
try {
tags.value=[];
for (var i = 0; i < item.length; i++) {
itemData.value = await request.get({ url: `/eam/basic-spotCheck-option/get?id=` + item[i] });
tags.value.push(itemData.value);
}
} finally {
formLoading.value = false
}
//
let res = await request.get({url: `/eam/relation-spotCheck-option-item/getList?optionCode=` + row.code})
try {
spotCheckItemData.value = [];
formLoading.value = true;
for (const item of res) {
const newItem = {};
newItem['id'] = item.id;
newItem['itemCode'] = item.itemCode;
newItem['itemName'] = item.itemName;
newItem['isSelectd'] = item.isSelectd;
spotCheckItemData.value.push(newItem);
}
} finally {
formLoading.value = false;
}
}
//
else {
resetForm()
isDisabled.value = false;
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
if (spotCheckItemData.value.length > 10 ){
message.warning('点检项最多10个');
return
}
// ID
formData.value.selectId = tags.value[0].selectId
//
formLoading.value = true
//formData.value.members = JSON.stringify(tags.value)
try {
if (formType.value === 'create') {
for (var i = 0; i < spotCheckItemData.value.length; i++) {
spotCheckItemData.value[i].optionCode = formData.value.code
}
formData.value.optionItem = spotCheckItemData.value
//
await BasicSpotCheckOptionApi.createBasicSpotCheckOption(formData.value)
message.success(t('common.createSuccess'))
} else {
for (var i = 0; i < spotCheckItemData.value.length; i++) {
spotCheckItemData.value[i].optionCode = formData.value.code
}
formData.value.optionItem = spotCheckItemData.value
console.log(formData.value)
await BasicSpotCheckOptionApi.updateBasicSpotCheckOption(formData.value)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
code: '',
name: '',
describing: '',
isUpdated: '',
remark: '',
available: '',
selectId: ''
}
tags.value=[];
spotCheckItemData.value = [];
basicFormRef.value?.resetFields()
}
</script>
<style scoped>
.tag-container {
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */
border: 1px solid #ccc; /* 添加边框样式 */
padding: 10px; /* 可根据需要调整容器内边距 */
width: 950px; /* 设置固定宽度为 950px */
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */
overflow-wrap: break-word; /* 兼容性更好的写法 */
flex-wrap: wrap;
}
.input-with-button {
display: flex;
align-items: center;
width: 100%;
}
.input-with-button > .el-input {
flex: 1;
/*margin-right: 10px;*/
}
</style>

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

@ -4,7 +4,10 @@ import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {BasicFaultCause} from "@/views/eam/basicFaultCause/basicFaultCause.data";
import * as ItemApi from "@/api/eam/basicFaultCause";
import {getBasicFaultCausePage} from "@/api/eam/basicFaultCause";
import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data";
import * as WorkshopApi from "@/api/wms/workshop";
import {BasicFaultType} from "@/views/eam/basicFaultType/basicFaultType.data";
import * as BasicFaultTypeApi from "@/api/eam/basicFaultType";
// 表单校验
export const EquipmentRepairJobMainRules = reactive({
@ -14,9 +17,9 @@ export const EquipmentRepairJobMainRules = reactive({
urgency: [required],
level: [required],
equipmentCode: [required],
totalMinutes: [required],
faultType: [required],
status: [required],
shutDown:[required],
})
export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
@ -34,6 +37,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number',
sort: 'custom',
isSearch: true,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '设备类别',
@ -48,20 +54,30 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'repairNumber',
sort: 'custom',
isSearch: true,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '来源字典',
label: '来源',
field: 'sources',
sort: 'custom',
dictType: DICT_TYPE.EAM_MAINTENANCE_SOURCES,
dictClass: 'string',
isSearch: false,
isForm: true,
form:{
value:'1'
}
},
{
label: '维修描述',
field: 'maintenanceDesc',
sort: 'custom',
isSearch: false,
isSearch: true,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '紧急程度',
@ -121,6 +137,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: {
component: 'DatePicker',
componentProps: {
@ -143,6 +162,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: {
component: 'DatePicker',
componentProps: {
@ -164,18 +186,27 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'totalMinutes',
sort: 'custom',
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '维修验证人',
field: 'verifyerRepair',
sort: 'custom',
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '维修验证内容',
field: 'verifyContentRepair',
sort: 'custom',
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '维修验证时间',
@ -183,6 +214,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: {
component: 'DatePicker',
componentProps: {
@ -204,12 +238,18 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'verifyerReport',
sort: 'custom',
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '报修验证内容',
field: 'verifyContentReport',
sort: 'custom',
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '报修验证时间',
@ -217,6 +257,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: {
component: 'DatePicker',
componentProps: {
@ -238,18 +281,29 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'maintenancer',
sort: 'custom',
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '维修人联系电话',
field: 'maintenancePhone',
sort: 'custom',
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '结果',
field: 'completeResult',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.EAM_COMPLETE_RESULT,
dictClass: 'string',
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '完成时间',
@ -257,6 +311,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: {
component: 'DatePicker',
componentProps: {
@ -304,6 +361,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
search: {
component: 'DatePicker',
componentProps: {
@ -325,14 +385,30 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'repairer',
sort: 'custom',
isSearch: false,
isTable: true,
isForm: false,
isDetail:true,
},
{
label: '故障类型',
field: 'faultType',
dictType: DICT_TYPE.FAILURE_REASON,
dictClass: 'string',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择故障类型', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: BasicFaultType.allSchemas, // 查询弹窗所需类
searchPage: BasicFaultTypeApi.getBasicFaultTypePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '流程状态',
@ -383,6 +459,23 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'workshopCode',
sort: 'custom',
isSearch: false,
required: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
// {
// label: '产线编号',

4
src/views/eam/equipmentRepairJobMain/finishForm1.vue

@ -63,6 +63,7 @@ const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
sources:'',
verifyerRepair: '',
verifyContentRepair: '',
verifyTimeRepair: '',
@ -158,6 +159,7 @@ const open = async (type: string, row?: object) => {
//
formData.value.id = row.id
formData.value.number = row.number
formData.value.sources = row.sources
}
defineExpose({ open }) // open
@ -172,7 +174,7 @@ const submitForm = async (val) => {
//
await EquipmentRepairJobMainApi.updateEquipmentRepairJobMain(formData.value)
//success
emit('success',formData.value.id)
emit('success',formData.value.id,formData.value.sources)
dialogVisible.value = false
}

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

@ -48,11 +48,13 @@
:apiCreate="EquipmentRepairJobMainApi.createEquipmentRepairJobMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<FinishForm1 ref="finishForm1Ref" @success="getData1" @close="getClosed1"/>
<FinishForm2 ref="finishForm2Ref" @success="getData2" @close="getClosed2"/>
<FinishForm3 ref="finishForm3Ref" @success="getData3" @close="getClosed3"/>
<TransferForm ref="transferForm" @success="getData4" @close="getClosed4"/>
<!-- 详情 -->
<Detail ref="detailRef"
@ -88,6 +90,11 @@ import Detail from '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail.
import FinishForm1 from '@/views/eam/equipmentRepairJobMain/finishForm1.vue'
import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue'
import FinishForm3 from '@/views/eam/equipmentRepairJobMain/finishForm3.vue'
import TransferForm from '@/views/eam/equipmentRepairJobMain/transferForm.vue'
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data";
import * as ToolItemApi from "@/api/eam/toolAccounts";
defineOptions({ name: 'EquipmentRepairJobMain' })
@ -163,6 +170,15 @@ const isShowStatusButton = (row,val) => {
}
}
//true
const isShowBaoXiuButton = (row) => {
if(row.sources =='0' && row.status == '7'){
return false
}else{
return true
}
}
// -
const butttondata = (row) => {
@ -170,9 +186,10 @@ const butttondata = (row) => {
defaultButtons.mainListEditBtn({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'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListValidateRepairBtn({hide: isShowStatusButton(row,['6']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListValidateReportBtn({hide: isShowStatusButton(row,['7']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListValidateReportBtn({hide: isShowBaoXiuButton(row),hasPermi:'eam:equipmentRepairJobMain:update'}), //
]
}
@ -192,6 +209,8 @@ const buttonTableClick = async (val, row) => {
handleValidateRepair(row)
} else if (val == 'validate_report') { //
handleValidateReport(row)
} else if (val == 'transfer') { //
handleTransferReport(row)
}
@ -200,6 +219,27 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "create"){
EquipmentRepairJobMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'sources'){
item.value = '1'
item.componentProps.disabled = true
}
if(item.field == 'status'){
item.value = '3'
item.componentProps.disabled = true
}
})
}else{
EquipmentRepairJobMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'sources'){
item.componentProps.disabled = true
}
if(item.field == 'status'){
item.componentProps.disabled = true
}
})
}
basicFormRef.value.open(type, row)
}
@ -261,26 +301,40 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
})
}
/** 转办按钮操作 */
const transferForm = ref()
const handleTransferReport = async (row) => {
await message.delConfirm('是否转办所选中工单?');
transferForm.value.open('update', row);
}
/** 报修验证按钮操作 */
const finishForm3Ref = ref()
const handleValidateReport = async (row) => {
await message.delConfirm('是否验证所选中工单?');
message.confirmPassword(t('')).then(async () => {
//
//
finishForm3Ref.value.open('update', row);
const params = ref({id: '', status:''})
params.value.id = row.id
params.value.status = '8'
//
await EquipmentRepairJobMainApi.createEquipmentRepairNewOrder(params.value)
message.success(t('工单已结束'))
//
await getList()
}).catch (async (action: Action) => {
if(action === 'cancel'){
const params = ref({id: '', status:''})
params.value.id = row.id
params.value.status = '5'
//
await EquipmentRepairJobMainApi.backEquipmentRepairOrder(params.value)
message.success(t('工单已打回'))
//
await getList()
}
if(action === 'cancel'){
const params = ref({id: '', number:''})
params.value.id = row.id
params.value.number = row.number
//
await EquipmentRepairJobMainApi.createEquipmentRepairNewOrder(params.value)
message.success(t('工单已结束'))
//
await getList()
}
})
}
@ -378,16 +432,20 @@ const getClosed1=(val)=> {
}
//finishForm1
const getData1=(val)=> {
const getData1=(val1,val2)=> {
nextTick?.(async () => {
console.log(val)
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '7'
params.value.id = val1
if(val2 == '1'){
params.value.status = '8'
}
if(val2 == '0'){
params.value.status = '7'
}
await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value)
message.success(t('工单已流转'))
//
@ -455,6 +513,63 @@ const getData3=(val)=> {
)
}
//finishForm4
const getClosed4=(val)=> {
nextTick?.(() => {
console.log(val)
getList()
})
}
//finishForm4
const getData4=(val)=> {
nextTick?.(async () => {
console.log(val)
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '3'
await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value)
message.success(t('工单已流转'))
//
await getList()
} catch {}
}
)
}
const onChange = (field, item) => {
//
if(field == 'type' && item == 'DEVICE'){
EquipmentRepairJobMain.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
})
items.componentProps.searchAllSchemas = EquipmentAccounts.allSchemas
items.componentProps.searchPage = EquipmentItemApi.getEquipmentAccountsPage
}
})
}
//
if(field == 'type' && item == 'EQUIPMENT'){
EquipmentRepairJobMain.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
})
items.componentProps.searchAllSchemas = ToolAccounts.allSchemas
items.componentProps.searchPage = ToolItemApi.getToolAccountsPage
}
})
}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {

344
src/views/eam/equipmentRepairJobMain/transferForm.vue

@ -0,0 +1,344 @@
<template>
<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="transferType">
<el-select v-model="formData.transferType" placeholder="请选择转办类型" style="width: 150px" @change="onChangeSec">
<el-option label="人员转办" value="0"></el-option>
<el-option label="类型转办" value="1"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="故障类型" prop="faultType">
<el-input v-model="formData.faultType" style="width: 150px" disabled></el-input>
<el-button :icon="Search" @click="chooseFaultType" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备类别" prop="type" >
<el-select v-model="formData.type" placeholder="请选择设备类别" style="width: 150px" :disabled = "isDisabled1" @change="onChangeType">
<el-option label="设备" value="DEVICE"></el-option>
<el-option label="工装" value="EQUIPMENT"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编号" prop="equipmentCode" >
<el-input v-model="formData.equipmentCode" style="width: 150px" disabled></el-input>
<el-button :icon="Search" @click="chooseEquipmentCode" :disabled = "isDisabled1"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="车间" prop="workshopCode">
<el-input v-model="formData.workshopCode" style="width: 150px" disabled></el-input>
<el-button :icon="Search" @click="chooseWorkshopCode" :disabled = "isDisabled2"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维修人" prop="maintenancer">
<el-input v-model="formData.maintenancer" style="width: 150px" :disabled = "isDisabled2"></el-input>
<!-- <el-button :icon="Search" @click="chooseWorkshopCode" />-->
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="班组" prop="classType">
<el-select v-model="formData.classType" placeholder="请选择班组类别" style="width: 150px">
<el-option label="白班" value="0"></el-option>
<el-option label="夜班" value="1"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')"> </el-button>
<el-button @click="handleClose('close')"> </el-button>
</template>
</Dialog>
<!--添加巡检项弹窗-->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</template>
<script lang="ts" setup>
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import { Search } from '@element-plus/icons-vue'
import * as EquipmentRepairJobMainApi from "@/api/eam/equipmentRepairJobMain";
import * as WorkshopApi from "@/api/wms/workshop";
import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data";
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data";
import * as ToolItemApi from "@/api/eam/toolAccounts";
import {BasicFaultType} from "@/views/eam/basicFaultType/basicFaultType.data";
import * as BasicFaultTypeApi from "@/api/eam/basicFaultType";
defineOptions({ name: 'TeamForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('转办') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const tags=ref([])
const typeValue = ref('')
const inputVisible = ref(false)
const isDisabled1 = ref(false)
const isDisabled2 = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
transferType:'',
faultType:'',
type:'',
equipmentCode:'',
workshopCode:'',
maintenancer: '',
classType: '',
})
const formRules = reactive({
transferType: [
{ required: true, message: '转办类型不能为空', trigger: 'change' },
{ max: 50, message: '不得超过50个字符', trigger: 'change' }
],
faultType: [
{ required: true, message: '故障类型不能为空', trigger: 'change' },
],
classType: [
{ required: true, message: '班次不能为空', trigger: 'change' },
],
workshopCode: [
{ required: false, message: '车间不能为空', trigger: 'change' },
],
maintenancer: [
{ required: false, message: '维修人不能为空', trigger: 'change' },
],
type: [
{ required: false, message: '设备类别不能为空', trigger: 'change' },
],
equipmentCode: [
{ required: false, message: '设备编号不能为空', trigger: 'change' },
],
})
const basicFormRef = ref() // Ref
// /** */
const searchTableRef = ref();
const _searchTableTitle = ref();
const _searchTableAllSchemas = ref();
const _searchTablePage = ref();
const _searchField = ref();
const _formField = ref();
const _multiple = ref();
const _searchCondition = ref({})
/** 选择故障类型弹窗 */
const chooseFaultType = (field) => {
_searchCondition.value = {}
const filters: any[] = []
filters.push({
key: 'available',
value: 'TRUE',
isMainValue: false
})
//
_searchCondition.value.isSearch = true
_searchCondition.value.filters = filters
_searchTableTitle.value = '选择故障类型'
_searchField.value = "faultType"
_formField.value = 'faultType'
_searchTablePage.value = BasicFaultTypeApi.getBasicFaultTypePage,
_searchTableAllSchemas.value = BasicFaultType.allSchemas,
openCommon()
}
/** 选择设备编码弹窗 */
const chooseEquipmentCode = (field) => {
_searchCondition.value = {}
const filters: any[] = []
filters.push({
key: 'status',
value: 'NORMAL',
action: '==',
isSearch: true,
isMainValue: false
})
//
_searchCondition.value.isSearch = true
_searchCondition.value.filters = filters
_searchField.value = "equipmentCode"
_formField.value = 'equipmentCode'
if(typeValue.value == 'DEVICE'){
_searchTableTitle.value = '选择设备编号'
_searchTablePage.value = EquipmentItemApi.getEquipmentAccountsPage,
_searchTableAllSchemas.value = EquipmentAccounts.allSchemas
}else{
_searchTableTitle.value = '选择工装编号'
_searchTablePage.value = ToolItemApi.getToolAccountsPage,
_searchTableAllSchemas.value = ToolAccounts.allSchemas
}
openCommon()
}
/** 选择车间弹窗 */
const chooseWorkshopCode = (field) => {
_searchCondition.value = {}
const filters: any[] = []
filters.push({
key: 'available',
value: 'TRUE',
isMainValue: false
})
//
_searchCondition.value.isSearch = true
_searchCondition.value.filters = filters
_searchTableTitle.value = '选择车间'
_searchField.value = "workshopCode"
_formField.value = 'workshopCode'
_searchTablePage.value = WorkshopApi.getWorkshopPage,
_searchTableAllSchemas.value = Workshop.allSchemas,
openCommon()
}
/*打开弹窗*/
const openCommon = () => {
searchTableRef.value.open(
_searchTableTitle.value,
_searchTableAllSchemas.value,
_searchTablePage.value,
_searchField.value,
_searchCondition.value
)
}
/** 弹窗选择之后 回调函数 */
const searchTableSuccess = (formField, searchField, val) => {
nextTick?.(() => {
console.log(formField)
if (formField === 'workshopCode') {
formData.value.workshopCode = val[0].code
}
if (formField === 'equipmentCode') {
formData.value.equipmentCode = val[0].code
}
if (formField === 'faultType') {
formData.value.faultType = val[0].code
}
})
}
/** 初始化弹窗 */
const open = async (type: string, row?: object) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
//
formData.value.id = row.id
formData.value.number = row.number
}
defineExpose({ open }) // open
const onChangeType = (field) => {
typeValue.value = ''
if(field == 'DEVICE'){
typeValue.value = 'DEVICE'
formData.value.equipmentCode = null
}else if(field == 'EQUIPMENT'){
typeValue.value = 'EQUIPMENT'
formData.value.equipmentCode = null
}
}
const onChangeSec = (field) => {
//
if(field == '0'){
formData.value.equipmentCode = null
formData.value.type = null
isDisabled1.value = true
isDisabled2.value = false
formRules.workshopCode[0].required = true
formRules.maintenancer[0].required = true
formRules.type[0].required = false
formRules.equipmentCode[0].required = false
}else{
//
formData.value.workshopCode = null
formData.value.maintenancer = null
isDisabled1.value = false
isDisabled2.value = true
formRules.workshopCode[0].required = false
formRules.maintenancer[0].required = false
formRules.type[0].required = true
formRules.equipmentCode[0].required = true
}
}
/** 提交表单 */
const submitForm = async (val) => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
await message.delConfirm('是否提交数据?');
//
await EquipmentRepairJobMainApi.updateEquipmentRepairJobMain(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false
}
const handleClose=(val)=>{
dialogVisible.value = false
emit('close',val)
}
//
const emit = defineEmits(['close','success'])
</script>
<style scoped>
.tag-container {
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */
border: 1px solid #ccc; /* 添加边框样式 */
padding: 10px; /* 可根据需要调整容器内边距 */
width: 950px; /* 设置固定宽度为 950px */
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */
overflow-wrap: break-word; /* 兼容性更好的写法 */
flex-wrap: wrap;
}
.input-with-button {
display: flex;
align-items: center;
width: 100%;
}
.input-with-button > .el-input {
flex: 1;
/*margin-right: 10px;*/
}
</style>

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

@ -1,5 +1,7 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
// 表单校验
export const EquipmentRepairRecordMainRules = reactive({
@ -11,7 +13,6 @@ export const EquipmentRepairRecordMainRules = reactive({
equipmentCode: [required],
totalMinutes: [required],
faultType: [required],
concurrencyStamp: [required]
})
export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
@ -28,12 +29,9 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '报修工单申请号',
label: '报修工单号',
field: 'repairNumber',
sort: 'custom',
isSearch: true
@ -42,43 +40,56 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '来源字典',
field: 'sources',
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
dictType: DICT_TYPE.EAM_MAINTENANCE_SOURCES,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
},
{
label: '维修描述',
field: 'maintenanceDesc',
sort: 'custom',
isSearch: true
isSearch: false
},
{
label: '紧急程度',
field: 'urgency',
sort: 'custom',
dictType: DICT_TYPE.REPAIR_DEGREE,
dictType: DICT_TYPE.EAM_MAINTENANCE_URGENCY,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '维修级别',
field: 'level',
sort: 'custom',
dictType: DICT_TYPE.REPAIR_LEVEL,
dictType: DICT_TYPE.EAM_MAINTENANCE_LEVEL,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '设备编号',
field: 'equipmentCode',
sort: 'custom',
isSearch: true
isSearch: true,
isForm: true,
form: {
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
}]
}
}
},
{
label: '是否停机',
@ -96,7 +107,7 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'startTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -118,7 +129,7 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'endTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -139,23 +150,25 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '维修时间',
field: 'totalMinutes',
sort: 'custom',
isSearch: true
isSearch: false
},
{
label: '验证人',
field: 'verifyer',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '验证内容',
field: 'verifyContent',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'Editor',
componentProps: {
@ -169,7 +182,10 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'verifyTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
@ -190,35 +206,31 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '执行人',
field: 'maintenancer',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
isSearch: false,
},
{
label: '维修人联系电话',
field: 'maintenancePhone',
sort: 'custom',
isSearch: true
isSearch: false
},
{
label: '结果枚举',
field: 'completeResult',
sort: 'custom',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictType: DICT_TYPE.EAM_COMPLETE_RESULT,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '完成时间',
field: 'completionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -240,7 +252,10 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'maintenanceTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
@ -262,7 +277,7 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'repairTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
@ -283,11 +298,7 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '报修人',
field: 'repairer',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
isSearch: false,
},
{
label: '故障类型',
@ -296,75 +307,86 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.FAILURE_REASON,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
}
},
{
label: '流程状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.EAM_REPAIR_STATUS,
dictClass: 'string',
isSearch: true,
form: {
component: 'Radio'
}
},
{
label: '自动接单',
field: 'autoOrder',
sort: 'custom',
isSearch: true
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '自动执行',
field: 'autoPerform',
sort: 'custom',
isSearch: true
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '自动验证',
field: 'autoVerify',
sort: 'custom',
isSearch: true
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: true
isSearch: false
},
{
label: '班组类型',
field: 'classType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
}
isSearch: false,
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: true
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: true
isSearch: false
},
{
label: '工段编号',
field: 'workshopSectionCode',
sort: 'custom',
isSearch: true
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '是否可用',
@ -372,7 +394,10 @@ export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '操作',

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

@ -27,9 +27,9 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
@ -51,7 +51,16 @@
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentRepairRecordMain.allSchemas" />
<Detail ref="detailRef"
:isBasic="false"
:allSchemas="EquipmentRepairRecordMain.allSchemas"
:detailAllSchemas="EquipmentRepairRecordDetail.allSchemas"
:detailAllSchemasRules="EquipmentRepairRecordDetailRules"
:apiPage="EquipmentRepairRecordDetailApi.getEquipmentRepairRecordDetailPage"
:detailButtonIsShowAdd=false
:detailButtonIsShowEdit=false
:detailButtonIsShowDelete=false
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-repair-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -60,7 +69,9 @@
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentRepairRecordMain,EquipmentRepairRecordMainRules } from './equipmentRepairRecordMain.data'
import { EquipmentRepairRecordDetail,EquipmentRepairRecordDetailRules } from '../equipmentRepairRecordDetail/equipmentRepairRecordDetail.data'
import * as EquipmentRepairRecordMainApi from '@/api/eam/equipmentRepairRecordMain'
import * as EquipmentRepairRecordDetailApi from '@/api/eam/equipmentRepairRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
@ -99,9 +110,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentRepairRecordMain:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentRepairRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentRepairRecordMain:export'}), //
// defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentRepairRecordMain:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'eam:equipmentRepairRecordMain:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipmentRepairRecordMain:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -133,8 +144,8 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentRepairRecordMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentRepairRecordMain:delete'}), //
// defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentRepairRecordMain:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipmentRepairRecordMain:delete'}), //
]
// -

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

@ -98,6 +98,19 @@ export const EquipmentReportRepairRequest = useCrudSchemas(reactive<CrudSchema[]
field: 'images',
sort: 'custom',
isSearch: false,
isForm: true,
isTable: true,
isDetail: false,
form: {
component: 'UploadImgs',
componentProps: {
limit:3,
upData:{
tableId:'1',
tableName:'request_equipment_report_repair'
}
}
}
},
// {
// label: '所属厂区编号',

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

@ -1,80 +1,73 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentReportRepairRequest.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search :schema="EquipmentReportRepairRequest.allSchemas.searchSchema" @search="setSearchParams"
@reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentReportRepairRequest.allSchemas"
/>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="EquipmentReportRepairRequest.allSchemas" />
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<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)" />
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
</template>
<template #images="{ row }">
<ButtonBase v-if="row.images === 'TRUE'" :Butttondata="butttondataView(row)"
@button-base-click="buttonTableClick($event, row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentReportRepairRequestRules"
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="EquipmentReportRepairRequestRules"
:formAllSchemas="EquipmentReportRepairRequest.allSchemas"
:apiUpdate="EquipmentReportRepairRequestApi.updateEquipmentReportRepairRequest"
:apiCreate="EquipmentReportRepairRequestApi.createEquipmentReportRepairRequest"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
@searchTableSuccess="searchTableSuccess" :isBusiness="false" @onChange="onChange" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentReportRepairRequest.allSchemas" />
<Dialog ref="basicFormViewRef" v-model="showView" :key="viewKey" :closeOnClickModal="true" :title="viewTitle">
<el-image v-for="url in urls" :key="url" :src="url" lazy />
</Dialog>
<!-- 审核页面 -->
<AudiForm ref="audiFormRef" @success="getData" @close="getClosed"/>
<AudiForm ref="audiFormRef" @success="getData" @close="getClosed" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-report-repair-request/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm ref="importFormRef" url="/eam/equipment-report-repair-request/import"
:importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentReportRepairRequest,EquipmentReportRepairRequestRules } from './equipmentReportRepairRequest.data'
import { EquipmentReportRepairRequest, EquipmentReportRepairRequestRules } from './equipmentReportRepairRequest.data'
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import AudiForm from '@/views/eam/equipmentReportRepairRequest/audiForm.vue'
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import { EquipmentAccounts } from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data";
import { ToolAccounts } from "@/views/eam/toolAccounts/toolAccounts.data";
import * as ToolItemApi from "@/api/eam/toolAccounts";
import {createEquipmentWeixiuOrder} from "@/api/eam/equipmentReportRepairRequest";
import * as EquipmentReportRepairApi from "@/api/eam/equipmentReportRepairRequest";
defineOptions({ name: 'EquipmentReportRepairRequest' })
@ -84,6 +77,10 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const showView = ref(false)
const urls = ref([])
const viewKey = ref(0)
const viewTitle = ref('图片预览')
const tableColumns = ref(EquipmentReportRepairRequest.allSchemas.tableColumns)
//
@ -109,9 +106,9 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentReportRepairRequest:create'}), //
defaultButtons.defaultAddBtn({ hasPermi: 'eam:equipmentReportRepairRequest:create' }), //
//defaultButtons.defaultImportBtn({hasPermi:'eam:equipmentReportRepairRequest:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipmentReportRepairRequest:export'}), //
defaultButtons.defaultExportBtn({ hasPermi: 'eam:equipmentReportRepairRequest:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -125,6 +122,13 @@ const HeadButttondata = [
// },
]
// -
const butttondataView = (row) => {
return [
defaultButtons.viewBtn(null),
]
}
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
@ -142,7 +146,7 @@ const buttonBaseClick = (val, item) => {
}
const isShowStatusButton = (row,val) => {
const isShowStatusButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -153,12 +157,12 @@ const isShowStatusButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hide: isShowStatusButton(row, ['0']),hasPermi: 'eam:equipmentReportRepairRequest:update'}), //
defaultButtons.mainListAuditingBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update'}), //
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.mainListEditBtn({hide: isShowStatusButton(row, ['0']),hasPermi: 'eam:equipmentReportRepairRequest:update'}), //
defaultButtons.mainListAuditingBtn({ hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:equipmentReportRepairRequest:update' }), //
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' }), //
]
}
@ -176,39 +180,70 @@ const buttonTableClick = async (val, row) => {
handleAudited(row)
} else if (val == 'finish') { //
handleFinish(row.id)
} else if (val == 'view') { //
openForm('view', row)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "create"){
//
const basicFormViewRef = ref()
const openForm = async (type: string, row?: any) => {
if (type == "create") {
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
if (item.field == 'status') {
}
})
}else{
} else {
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
if (item.field == 'status') {
}
})
}
basicFormRef.value.open(type, row)
if (type == 'view') {
const formData = ref({
number: row.number,
funcCode: 'equipment_report',
fileBusiType: 'EAM',
})
urls.value = []
let newVar = await EquipmentReportRepairApi.getEquipmentReportFileInfo(formData.value);
newVar.forEach((item: any) => {
urls.value.push(item.url);
})
showView.value = true
viewKey.value += 1
} else {
basicFormRef.value.open(type, row)
}
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentReportRepairRequest.allSchemas.formSchema.some(function (item) {
const formsSuccess = async (formType, data) => {
var isHave = EquipmentReportRepairRequest.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
if (isHave) {
if (data.activeTime && data.expireTime && data.activeTime >= data.expireTime) {
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (data.activeTime == 0) data.activeTime = null;
if (data.expireTime == 0) data.expireTime = null;
const tags = ref([])
if (data.images != null && data.images != "") {
data.images.forEach((item: any) => {
const newItem = {};
newItem['name'] = item.name;
newItem['size'] = item.size;
newItem['uid'] = item.uid;
newItem['url'] = item.url;
tags.value.push(newItem);
})
}
data.fileInfoList = tags.value
if (formType === 'create') {
await EquipmentReportRepairRequestApi.createEquipmentReportRepairRequest(data)
message.success(t('common.createSuccess'))
@ -232,7 +267,7 @@ const handleFinish = async (id: number) => {
try {
const params = ref({
id: '',
status:'',
status: '',
})
params.value.id = id
params.value.status = '5'
@ -240,7 +275,7 @@ const handleFinish = async (id: number) => {
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
} catch { }
}
//
@ -249,10 +284,10 @@ const handleAudited = async (row) => {
//
audiFormRef.value.open('update', row);
}).catch(async (action: Action) => {
if(action === 'cancel'){
if (action === 'cancel') {
const params = ref({
id: '',
status:'',
status: '',
})
params.value.id = row.id
params.value.status = '4'
@ -271,7 +306,7 @@ const handleAuditing = async (id: number) => {
try {
const params = ref({
id: '',
status:'',
status: '',
})
params.value.id = id
params.value.status = '2'
@ -279,7 +314,7 @@ const handleAuditing = async (id: number) => {
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
} catch { }
}
/** 撤回按钮操作 */
@ -288,7 +323,7 @@ const handleRevoke = async (id: number) => {
try {
const params = ref({
id: '',
status:'',
status: '',
})
params.value.id = id
params.value.status = '1'
@ -296,7 +331,7 @@ const handleRevoke = async (id: number) => {
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
} catch { }
}
/** 删除按钮操作 */
@ -309,7 +344,7 @@ const handleDelete = async (id: number) => {
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
} catch { }
}
/** 导出按钮操作 */
@ -344,41 +379,41 @@ const importSuccess = () => {
}
//audiForm
const getClosed=(val)=> {
const getClosed = (val) => {
nextTick?.(() => {
getList()
})
}
//audiForm
const getData=(val)=> {
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 {}
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 { }
}
}
)
}
const onChange = (field, item) => {
//
if(field == 'type' && item == 'DEVICE'){
if (field == 'type' && item == 'DEVICE') {
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
equipmentCode: ''
})
items.componentProps.searchAllSchemas = EquipmentAccounts.allSchemas
items.componentProps.searchPage = EquipmentItemApi.getEquipmentAccountsPage
@ -386,17 +421,25 @@ const onChange = (field, item) => {
})
}
//
if(field == 'type' && item == 'EQUIPMENT'){
if (field == 'type' && item == 'EQUIPMENT') {
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
equipmentCode: ''
})
items.componentProps.searchAllSchemas = ToolAccounts.allSchemas
items.componentProps.searchPage = ToolItemApi.getToolAccountsPage
}
})
}
//
if (field == 'images') {
EquipmentReportRepairRequest.allSchemas.formSchema.forEach((items) => {
if (items.field == 'images') {
console.log(items.value);
}
})
}
}
//

18
src/views/eam/inspectionItem/index.vue

@ -65,6 +65,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 * as InspectionItemSelectSetApi from "@/api/eam/inspectionItemSelectSet";
defineOptions({ name: 'InspectionItem' })
@ -253,11 +254,20 @@ const searchFormClick = (searchData) => {
}
const handleEnable = (row,enable) =>{
message.confirm(t('您确定'+(enable=='TRUE'?'启用':'禁用')+'该项吗, 是否继续?')).then(() => {
row.available = enable
InspectionItemApi.updateInspectionItem(row).then(res => {
message.confirm(t('您确定'+(enable=='TRUE'?'启用':'禁用')+'该项吗, 是否继续?')).then(async () => {
try {
const params = ref({
id: '',
available: '',
})
params.value.id = row.id
params.value.available = 'TRUE'
await InspectionItemApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
})
//
await getList()
} catch {
}
})
}

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

@ -27,6 +27,12 @@ export const InspectionItem = useCrudSchemas(reactive<CrudSchema[]>([
component:'InputNumber'
},
},
{
label: '巡检名称',
field: 'name',
sort: 'custom',
isSearch: true
},
{
label: '巡检内容',
field: 'content',
@ -40,7 +46,7 @@ export const InspectionItem = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
label: '保养部位',
label: '巡检部位',
field: 'equipmentParts',
sort: 'custom',
isSearch: true

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

@ -14,7 +14,7 @@ export const InspectionItemSelectSet = useCrudSchemas(reactive<CrudSchema[]>([
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isTable: true,
isForm: false,
isDetail:false,
},

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

@ -68,10 +68,25 @@ export const ItemAccounts = useCrudSchemas(
}
}
},
{
label: '备件分类',
field: 'classification',
sort: 'custom',
dictType: DICT_TYPE.PART_CLASS,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
form: {
component: 'Select',
componentProps: {
disabled: true
}
}
},
{
label: '单价',
field: 'singlePrice',
sort: 'custom',
isTable: false,
isSearch: false,
form: {
component: 'InputNumber',
@ -79,17 +94,18 @@ export const ItemAccounts = useCrudSchemas(
}
},
{
label: '库存数量',
field: 'qty',
label: '规格型号',
field: 'specifications',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
componentProps: {
disabled: true
}
}
},
{
label: '库位编号',
label: '存放位置',
field: 'locationNumber',
sort: 'custom',
table: {
@ -125,6 +141,7 @@ export const ItemAccounts = useCrudSchemas(
label: '库区编号',
field: 'areaNumber',
sort: 'custom',
isTable: false,
isSearch: true,
table: {
width: 180
@ -136,108 +153,96 @@ export const ItemAccounts = useCrudSchemas(
}
},
{
label: '品牌',
field: 'brand',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '规格型号',
field: 'specifications',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '是否全局',
field: 'isOverall',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '科目',
field: 'subject',
sort: 'custom',
dictType: DICT_TYPE.SUBJECT,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
form: {
component: 'Select',
componentProps: {
disabled: true
}
}
},
{
label: '科目代码',
field: 'subjectCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '类别',
field: 'type',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '区域',
field: 'region',
sort: 'custom',
dictType: DICT_TYPE.REGION,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
form: {
component: 'Select',
componentProps: {
disabled: true
}
}
},
{
label: '备件分类',
field: 'classification',
label: '库存数量',
field: 'qty',
sort: 'custom',
dictType: DICT_TYPE.PART_CLASS,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
form: {
component: 'Select',
componentProps: {
disabled: true
}
component: 'InputNumber',
value: 0
}
},
// {
// label: '品牌',
// field: 'brand',
// sort: 'custom',
// isSearch: false,
// form: {
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '是否全局',
// field: 'isOverall',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: false,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE',
// disabled: true
// }
// }
// },
// {
// label: '科目',
// field: 'subject',
// sort: 'custom',
// dictType: DICT_TYPE.SUBJECT,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: false,
// form: {
// component: 'Select',
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '科目代码',
// field: 'subjectCode',
// sort: 'custom',
// isSearch: false,
// form: {
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '类别',
// field: 'type',
// sort: 'custom',
// isSearch: false,
// form: {
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '区域',
// field: 'region',
// sort: 'custom',
// dictType: DICT_TYPE.REGION,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: false,
// form: {
// component: 'Select',
// componentProps: {
// disabled: true
// }
// }
// },
{
label: '计量单位',
field: 'uom',
@ -263,79 +268,77 @@ export const ItemAccounts = useCrudSchemas(
}
}
},
{
label: '库存下限',
field: 'minInventory',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0,
componentProps: {
disabled: true
}
}
},
{
label: '库存上限',
field: 'maxInventory',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0,
componentProps: {
disabled: true
}
}
},
{
label: '更换周期',
field: 'replacementCycle',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0,
componentProps: {
disabled: true
}
}
},
{
label: '存放位置描述',
field: 'storageLocation',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
componentProps: {
disabled: true
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail: false,
componentProps: {
disabled: true
}
},
// {
// label: '库存下限',
// field: 'minInventory',
// sort: 'custom',
// isSearch: false,
// form: {
// component: 'InputNumber',
// value: 0,
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '库存上限',
// field: 'maxInventory',
// sort: 'custom',
// isSearch: false,
// form: {
// component: 'InputNumber',
// value: 0,
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '更换周期',
// field: 'replacementCycle',
// sort: 'custom',
// isSearch: false,
// form: {
// component: 'InputNumber',
// value: 0,
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '存放位置描述',
// field: 'storageLocation',
// sort: 'custom',
// isSearch: false,
// form: {
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '备注',
// field: 'remark',
// sort: 'custom',
// isSearch: false,
// componentProps: {
// disabled: true
// }
// },
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// isSearch: false,
// isTable: false,
// isForm: false,
// isDetail: false,
// componentProps: {
// disabled: true
// }
// },
{
label: '操作',
field: 'action',

27
src/views/eam/maintenance/audiForm.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="approver">
<el-input v-model="formData.approver" placeholder="请输入审核人" :disabled="isDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="24">
<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 type="textarea" :input-style="{height:'200px'}" maxlength="300" v-model="formData.approveContent" placeholder="请输入审核内容" />
</el-form-item>
</el-col>
</el-row>
@ -95,8 +78,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */
const submitForm = async (val) => {
//success
emit('success',formData.value.id)
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
@ -104,6 +86,9 @@ const submitForm = async (val) => {
//
await MaintenanceApi.updateMaintenanceAudi(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false
}

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

@ -14,7 +14,7 @@ export const BasicMaintenanceItemSelectSet = useCrudSchemas(reactive<CrudSchema[
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isTable: true,
isForm: false,
isDetail:false,
},

126
src/views/eam/planInspection/audiForm.vue

@ -0,0 +1,126 @@
<template>
<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="24">
<el-form-item label="审核内容" prop="approveContent">
<el-input type="textarea" :input-style="{height:'200px'}" maxlength="300" v-model="formData.approveContent" placeholder="请输入审核内容" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')"> </el-button>
<el-button @click="handleClose('close')"> </el-button>
</template>
</Dialog>
<!--添加巡检项弹窗-->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</template>
<script lang="ts" setup>
import * as PlanInspectionApi from '@/api/eam/planInspection'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
defineOptions({ name: 'TeamForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const tags=ref([])
const inputValue = ref('')
const inputVisible = ref(false)
const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
approver: '',
approveContent: '',
approveTime: '',
})
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' },
],
})
const basicFormRef = ref() // Ref
/** 初始化弹窗 */
const open = async (type: string, row?: object) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
//
formData.value.id = row.id
formData.value.number = row.number
}
defineExpose({ open }) // open
/** 提交表单 */
const submitForm = async (val) => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
//
await PlanInspectionApi.updateInspectionPlanAudi(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false
}
const handleClose=(val)=>{
dialogVisible.value = false
emit('close',val)
}
//
const emit = defineEmits(['close','success'])
</script>
<style scoped>
.tag-container {
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */
border: 1px solid #ccc; /* 添加边框样式 */
padding: 10px; /* 可根据需要调整容器内边距 */
width: 950px; /* 设置固定宽度为 950px */
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */
overflow-wrap: break-word; /* 兼容性更好的写法 */
flex-wrap: wrap;
}
.input-with-button {
display: flex;
align-items: center;
width: 100%;
}
.input-with-button > .el-input {
flex: 1;
/*margin-right: 10px;*/
}
</style>

419
src/views/eam/planInspection/index.vue

@ -0,0 +1,419 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PlanInspection.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PlanInspection.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="basicFormRef"
@success="formsSuccess"
:rules="PlanInspectionRules"
:formAllSchemas="PlanInspection.allSchemas"
:apiUpdate="PlanInspectionApi.updatePlanInspection"
:apiCreate="PlanInspectionApi.createPlanInspection"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="PlanInspection.allSchemas" />
<AudiForm ref="audiFormRef" @success="getData" @close="getClosed"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/plan-inspection/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PlanInspection,PlanInspectionRules } from './planInspection.data'
import * as PlanInspectionApi from '@/api/eam/planInspection'
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 {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data";
import * as ToolItemApi from "@/api/eam/toolAccounts";
import AudiForm from '@/views/eam/planInspection/audiForm.vue'
defineOptions({ name: 'PlanInspection' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PlanInspection.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: PlanInspectionApi.getPlanInspectionPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:planInspection:create'}), //
//defaultButtons.defaultImportBtn({hasPermi:'eam:planInspection:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:planInspection: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 isShowStatusButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hasPermi:'eam:planInspection:update'}), //
defaultButtons.mainListAuditingBtn({hide: isShowStatusButton(row,['0']),hasPermi:'eam:planInspection:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:planInspection:update'}), //
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:planInspection:update'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:planInspection:update'}),
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'enable') {
handleEnable(row.id)
} else if (val == 'disable') {
handleDisable(row.id)
} else if (val == 'auditing') { //
handleAuditing(row.id)
} else if (val == 'finish') { //
handleFinish(row)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "create"){
PlanInspection.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
item.componentProps.disabled = true
}
})
}else{
PlanInspection.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =PlanInspection.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await PlanInspectionApi.createPlanInspection(data)
message.success(t('common.createSuccess'))
} else {
await PlanInspectionApi.updatePlanInspection(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicPlanInspection')
}
//
const handleFinish = async (row) => {
message.confirmAudi(t('')).then(async () => {
//
audiFormRef.value.open('update', row);
}).catch(async (action: Action) => {
if(action === 'cancel'){
const params = ref({
id: '',
status:'',
})
params.value.id = row.id
params.value.status = '5'
await PlanInspectionApi.updateInspectionPlan(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
}
})
}
//
const audiFormRef = ref()
const handleAuditing = async (id: number) => {
await message.delConfirm('是否审核所选中工单?');
const params = ref({
id: '',
status:'',
})
params.value.id = id
params.value.status = '3'
await PlanInspectionApi.updateInspectionPlan(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
}
/** 启用 */
const handleEnable = async (id: number) => {
try {
const params = ref({
id: '',
available:'',
})
params.value.id = id
params.value.available = 'TRUE'
await PlanInspectionApi.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 PlanInspectionApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PlanInspectionApi.deletePlanInspection(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
const onChange = (field, item) => {
//
if(field == 'type' && item == 'DEVICE'){
PlanInspection.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
})
items.componentProps.searchAllSchemas = EquipmentAccounts.allSchemas
items.componentProps.searchPage = EquipmentItemApi.getEquipmentAccountsPage
}
})
}
//
if(field == 'type' && item == 'EQUIPMENT'){
PlanInspection.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
})
items.componentProps.searchAllSchemas = ToolAccounts.allSchemas
items.componentProps.searchPage = ToolItemApi.getToolAccountsPage
}
})
}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PlanInspectionApi.exportPlanInspection(tableObject.params)
download.excel(data, '巡检计划.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
//audiForm
const getClosed=(val)=> {
nextTick?.(() => {
getList()
})
}
//audiForm
const getData=(val)=> {
nextTick?.(async () => {
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '4'
await PlanInspectionApi.updateInspectionPlan(params.value)
message.success(t('计划已流转'))
//
await getList()
} catch {}
}
)
}
/** 导入 */
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()
})
</script>

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

@ -0,0 +1,395 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import * as BasicInspectionApi from "@/api/eam/basicInspectionOption";
import {BasicInspectionOption} from "@/views/eam/basicInspectionOption/basicInspectionOption.data";
import {getBasicInspectionOptionPage} from "@/api/eam/basicInspectionOption";
import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data";
import * as WorkshopApi from "@/api/wms/workshop";
// 表单校验
export const PlanInspectionRules = reactive({
number: [required],
name: [required],
equipmentCode: [required],
optionCode: [required],
cycle: [required],
startTime: [required],
endTime: [required],
})
export const PlanInspection = 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,
isDetail:true,
},
{
label: '计划名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '设备类别',
field: 'type',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
},
{
label: '设备工装编号',
field: 'equipmentCode',
sort: 'custom',
isSearch: true,
isForm: true,
form: {
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
}]
}
}
},
{
label: '方案编号',
field: 'optionCode',
sort: 'custom',
isSearch: true,
isForm: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '巡检方案信息', // 查询弹窗标题
searchListPlaceholder: '请选择巡检方案', // 输入框占位文本
searchAllSchemas: BasicInspectionOption.allSchemas, // 查询弹窗所需类
searchField: 'code', // 查询弹窗赋值字段
searchPage: BasicInspectionApi.getBasicInspectionOptionPage, // 查询弹窗所需分页方法
multiple:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
}]
}
}
},
{
label: '计划类型',
field: 'cycle',
dictType: DICT_TYPE.INSPECTION_CYCLE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
},
{
label: '计划开始时间',
field: 'startTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '计划结束时间',
field: 'endTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.EAM_PLAN_STATUS,
dictClass: 'string',
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: false,
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
},
{
label: '审核时间',
field: 'approveTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '自动审核',
field: 'autoExamine',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: false,
required: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '车间', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '产线编号',
field: 'lineCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '工序编号',
field: 'processCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '工位编号',
field: 'workstationCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail: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: '部门id',
field: 'departmentCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isTable: true,
isDetail: false,
isSearch: true,
isTableForm: false,
isForm: false,
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail: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: '删除人id',
field: 'deleterId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

125
src/views/eam/planSpotCheck/audiForm.vue

@ -0,0 +1,125 @@
<template>
<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="24">
<el-form-item label="审核内容" prop="approveContent">
<el-input type="textarea" :input-style="{height:'200px'}" maxlength="300" v-model="formData.approveContent" placeholder="请输入审核内容" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')"> </el-button>
<el-button @click="handleClose('close')"> </el-button>
</template>
</Dialog>
<!--添加巡检项弹窗-->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</template>
<script lang="ts" setup>
import * as SpotCheckApi from '@/api/eam/planSpotCheck'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
defineOptions({ name: 'TeamForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const tags=ref([])
const inputValue = ref('')
const inputVisible = ref(false)
const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
approver: '',
approveContent: '',
approveTime: '',
})
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' },
],
})
const basicFormRef = ref() // Ref
/** 初始化弹窗 */
const open = async (type: string, row?: object) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
//
formData.value.id = row.id
formData.value.number = row.number
}
defineExpose({ open }) // open
/** 提交表单 */
const submitForm = async (val) => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
//
await SpotCheckApi.updateSpotCheckPlanAudi(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false
}
const handleClose=(val)=>{
dialogVisible.value = false
emit('close',val)
}
//
const emit = defineEmits(['close','success'])
</script>
<style scoped>
.tag-container {
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */
border: 1px solid #ccc; /* 添加边框样式 */
padding: 10px; /* 可根据需要调整容器内边距 */
width: 950px; /* 设置固定宽度为 950px */
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */
overflow-wrap: break-word; /* 兼容性更好的写法 */
flex-wrap: wrap;
}
.input-with-button {
display: flex;
align-items: center;
width: 100%;
}
.input-with-button > .el-input {
flex: 1;
/*margin-right: 10px;*/
}
</style>

422
src/views/eam/planSpotCheck/index.vue

@ -0,0 +1,422 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PlanSpotCheck.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="PlanSpotCheck.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="basicFormRef"
@success="formsSuccess"
:rules="PlanSpotCheckRules"
:formAllSchemas="PlanSpotCheck.allSchemas"
:apiUpdate="PlanSpotCheckApi.updatePlanSpotCheck"
:apiCreate="PlanSpotCheckApi.createPlanSpotCheck"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="PlanSpotCheck.allSchemas" />
<AudiForm ref="audiFormRef" @success="getData" @close="getClosed"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/plan-spot-check/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { PlanSpotCheck,PlanSpotCheckRules } from './planSpotCheck.data'
import * as PlanSpotCheckApi from '@/api/eam/planSpotCheck'
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 {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import {ToolAccounts} from "@/views/eam/toolAccounts/toolAccounts.data";
import * as ToolItemApi from "@/api/eam/toolAccounts";
import AudiForm from '@/views/eam/planSpotCheck/audiForm.vue'
import {updateSpotCheckPlan} from "@/api/eam/planSpotCheck";
defineOptions({ name: 'PlanSpotCheck' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PlanSpotCheck.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: PlanSpotCheckApi.getPlanSpotCheckPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:planSpotCheck:create'}), //
//defaultButtons.defaultImportBtn({hasPermi:'eam:planSpotCheck:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:planSpotCheck: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 isShowStatusButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({hasPermi:'eam:planSpotCheck:update'}), //
defaultButtons.mainListAuditingBtn({hide: isShowStatusButton(row,['0']),hasPermi:'eam:planSpotCheck:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:planSpotCheck:update'}), //
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'eam:planSpotCheck:update'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'eam:planSpotCheck:update'}),
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'enable') {
handleEnable(row.id)
} else if (val == 'disable') {
handleDisable(row.id)
} else if (val == 'auditing') { //
handleAuditing(row.id)
} else if (val == 'finish') { //
handleFinish(row)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "create"){
PlanSpotCheck.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
item.componentProps.disabled = true
}
})
}else{
PlanSpotCheck.allSchemas.formSchema.forEach((item) => {
if(item.field == 'status'){
item.componentProps.disabled = false
}
})
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =PlanSpotCheck.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await PlanSpotCheckApi.createPlanSpotCheck(data)
message.success(t('common.createSuccess'))
} else {
await PlanSpotCheckApi.updatePlanSpotCheck(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicPlanSpotCheck')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PlanSpotCheckApi.deletePlanSpotCheck(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
//
const handleFinish = async (row) => {
message.confirmAudi(t('')).then(async () => {
//
audiFormRef.value.open('update', row);
}).catch(async (action: Action) => {
if(action === 'cancel'){
const params = ref({
id: '',
status:'',
})
params.value.id = row.id
params.value.status = '5'
await PlanSpotCheckApi.updateSpotCheckPlan(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
}
})
}
//
const audiFormRef = ref()
const handleAuditing = async (id: number) => {
await message.delConfirm('是否审核所选中工单?');
try {
const params = ref({
id: '',
status:'',
})
params.value.id = id
params.value.status = '3'
await PlanSpotCheckApi.updateSpotCheckPlan(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
/** 启用 */
const handleEnable = async (id: number) => {
try {
const params = ref({
id: '',
available:'',
})
params.value.id = id
params.value.available = 'TRUE'
await PlanSpotCheckApi.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 PlanSpotCheckApi.updateEnableCode(params.value)
message.success(t('common.updateSuccess'))
//
await getList()
} catch {}
}
const onChange = (field, item) => {
//
if(field == 'type' && item == 'DEVICE'){
PlanSpotCheck.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
})
items.componentProps.searchAllSchemas = EquipmentAccounts.allSchemas
items.componentProps.searchPage = EquipmentItemApi.getEquipmentAccountsPage
}
})
}
//
if(field == 'type' && item == 'EQUIPMENT'){
PlanSpotCheck.allSchemas.formSchema.forEach((items) => {
if (items.field == 'equipmentCode') {
basicFormRef.value.formRef.setValues({
equipmentCode:''
})
items.componentProps.searchAllSchemas = ToolAccounts.allSchemas
items.componentProps.searchPage = ToolItemApi.getToolAccountsPage
}
})
}
}
//audiForm
const getClosed=(val)=> {
nextTick?.(() => {
getList()
})
}
//audiForm
const getData=(val)=> {
nextTick?.(async () => {
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '4'
await PlanSpotCheckApi.updateSpotCheckPlan(params.value)
message.success(t('计划已流转'))
//
await getList()
} catch {}
}
)
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PlanSpotCheckApi.exportPlanSpotCheck(tableObject.params)
download.excel(data, '点检计划.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '点检计划导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

394
src/views/eam/planSpotCheck/planSpotCheck.data.ts

@ -0,0 +1,394 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
import * as SpotCheckOptionApi from "@/api/eam/basicSpotCheckOption";
import {BasicSpotCheckOption} from "@/views/eam/basicSpotCheckOption/basicSpotCheckOption.data";
import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data";
import * as WorkshopApi from "@/api/wms/workshop";
// 表单校验
export const PlanSpotCheckRules = reactive({
number: [required],
name: [required],
equipmentCode: [required],
optionCode: [required],
cycle: [required],
startTime: [required],
endTime: [required],
})
export const PlanSpotCheck = 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,
isDetail:true,
},
{
label: '计划名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '设备类别',
field: 'type',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
},
{
label: '设备工装编号',
field: 'equipmentCode',
sort: 'custom',
isSearch: true,
isForm: true,
form: {
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
}]
}
}
},
{
label: '方案编号',
field: 'optionCode',
sort: 'custom',
isSearch: true,
isForm: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '点检方案信息', // 查询弹窗标题
searchListPlaceholder: '请选择点检方案', // 输入框占位文本
searchAllSchemas: BasicSpotCheckOption.allSchemas, // 查询弹窗所需类
searchField: 'code', // 查询弹窗赋值字段
searchPage: SpotCheckOptionApi.getBasicSpotCheckOptionPage, // 查询弹窗所需分页方法
multiple:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
}]
}
}
},
{
label: '计划类型',
field: 'cycle',
dictType: DICT_TYPE.SPOTCHECK_CYCLE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
},
{
label: '计划开始时间',
field: 'startTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '计划结束时间',
field: 'endTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.EAM_PLAN_STATUS,
dictClass: 'string',
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: false,
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
},
{
label: '审核时间',
field: 'approveTime',
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '自动审核',
field: 'autoExamine',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
},
{
label: '所属厂区编号',
field: 'factoryAreaCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: false,
required: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '车间', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '产线编号',
field: 'lineCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '工序编号',
field: 'processCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '工位编号',
field: 'workstationCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail: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: '部门id',
field: 'departmentCode',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isTable: true,
isDetail: false,
isSearch: true,
isTableForm: false,
isForm: false,
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail: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: '删除人id',
field: 'deleterId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

3
src/views/eam/sparePart/sparePart.data.ts

@ -25,7 +25,7 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
isDetail:false
},
{
label: '备件编号',
@ -197,7 +197,6 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '部门id',

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

@ -28,16 +28,18 @@ export const SparePartsApplyMain = useCrudSchemas(
field: 'sumVal',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
label: '流程状态',
field: 'status',
sort: 'custom',
isSearch: false,
isForm: false,
dictType: DICT_TYPE.SPAREPARTS_APPLY_STATUS_ENUM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Radio'
component: 'Select'
}
},
{
@ -45,6 +47,7 @@ export const SparePartsApplyMain = useCrudSchemas(
field: 'applyer',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
@ -52,6 +55,7 @@ export const SparePartsApplyMain = useCrudSchemas(
field: 'approver',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
form: {
component: 'InputNumber',
@ -63,6 +67,7 @@ export const SparePartsApplyMain = useCrudSchemas(
field: 'approveContent',
sort: 'custom',
isSearch: true,
isTable: false,
isForm: false
},
{
@ -71,6 +76,7 @@ export const SparePartsApplyMain = useCrudSchemas(
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
search: {
component: 'DatePicker',
@ -93,6 +99,7 @@ export const SparePartsApplyMain = useCrudSchemas(
field: 'autoExamine',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
@ -100,6 +107,7 @@ export const SparePartsApplyMain = useCrudSchemas(
field: 'autoAgree',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
@ -107,6 +115,7 @@ export const SparePartsApplyMain = useCrudSchemas(
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false
},
{
@ -115,6 +124,7 @@ export const SparePartsApplyMain = useCrudSchemas(
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
search: {
component: 'DatePicker',
componentProps: {

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

@ -0,0 +1,438 @@
<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="false"
/>
<!-- 审核页面 -->
<!-- <AudiForm ref="audiFormRef" @success="handleApprove"/> -->
<BasicForm
ref="formRefApproved"
:rules="SparePartsInLocationMainRules"
:formAllSchemas="SparePartsInLocationExamine.allSchemas"
@submitForm="approveSparePartsInLocation"
/>
<!-- 导入 -->
<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(() => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if (type == 'tableForm') {
if (formField == 'locationCode') {
// row['sparePartsCode'] = val[0].itemNumber
row['locationCode'] = val[0].code
row['areaCode'] = val[0].areaCode
row['sparePartsCode'] = val[0].sparePartsCode
row['currentQty'] = val[0].qty
row['isRadeIn'] = val[0].isRadeIn
}
} else {
if (formField == 'locationCode') {
setV['locationCode'] = val[0].code
setV['areaCode'] = val[0].areaCode
setV['sparePartsCode'] = val[0].sparePartsCode
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].code
setV['areaCode'] = val[0].areaCode
setV['sparePartsCode'] = val[0].sparePartsCode
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' }), //
]
}
// -
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 == '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
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)=> {
console.log(data)
try {
// const params = {
// id:
// }
await SparePartsInLocationMainApi.approveSparePartsInLocation(data)
message.success(t('ts.审核通过!'))
//
await getList()
} catch {}
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SparePartsInLocationMainApi.importTemplate()
})
</script>

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

@ -0,0 +1,297 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
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: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
// isInpuFocusShow: true,
// searchListPlaceholder: '请选择备件编号', // 输入框占位文本
// searchField: 'itemNumber', // 查询弹窗赋值字段
// searchTitle: '备件信息', // 查询弹窗标题
// searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
// searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
// 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,
isTable: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:{
componentProps:{
}
}
},
]))

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

@ -26,6 +26,12 @@ export const SpotCheckItem = useCrudSchemas(reactive<CrudSchema[]>([
component:'InputNumber'
},
},
{
label: '点检名称',
field: 'name',
sort: 'custom',
isSearch: true
},
{
label: '点检内容',
field: 'content',

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

@ -14,7 +14,7 @@ export const BasicSpotCheckSelectSet = useCrudSchemas(reactive<CrudSchema[]>([
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isTable: true,
isForm: false,
isDetail:false,
},

2
src/views/login/forgetPassword.vue

@ -50,7 +50,7 @@
try {
const data = loginData as unknown as UserApi.UserVO
await UserApi.forgetPassword(data)
message.success(t('common.updateSuccess'))
message.success(t('common.emailSentSuccess'))
//
router.go(-1)
} finally {

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

@ -371,7 +371,7 @@
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
if (!item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList) {
//
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) {
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 2) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
for (let i = 0; i < parseInt(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty); i++) {

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

@ -157,7 +157,7 @@
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item label="拆分规则" prop="splitRule">
<el-select v-model="data.splitRule" placeholder="请选择拆分规则">
<el-option
@ -168,7 +168,7 @@
/>
</el-select>
</el-form-item>
</el-col>
</el-col> -->
<el-col :span="12" v-if="isShowField !=0">
<el-form-item label="aql" prop="aql">
<el-select v-model="data.aql" placeholder="请选择aql">
@ -733,7 +733,7 @@ const rules = ref({
description: [
{ required: true, message: '请选择描述', trigger: 'blur' }
],
splitRule: [{ required: true, message: '请选择拆分规则', trigger: ['blur', 'change'] }],
// splitRule: [{ required: true, message: '', trigger: ['blur', 'change'] }],
aql: [{ required: true, message: '请选择aql', trigger: ['blur', 'change'] }],
inspectionLevel: [
{ required: true, message: '请选择检验水平', trigger: ['blur', 'change'] },
@ -957,6 +957,8 @@ const validateForm = (formRef) => {
const submitForm = async () => {
try {
const aa = await getStrDictOptions(DICT_TYPE.SPLIT_RULES);//
data.value.splitRule = aa[0].value
const validateForm1 = await validateForm(formProcessRef.value)
await formMainRef.value.validate()
if (!data.value.process || data.value.process.length == 0) {

74
src/views/wms/basicDataManage/customerManage/customerdock/customerdock.data.ts

@ -26,27 +26,8 @@ export const Customerdock = useCrudSchemas(reactive<CrudSchema[]>([
field: 'code',
sort: 'custom',
table: {
width: 150,
fixed: 'left'
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择月台代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '月台基础信息', // 查询弹窗标题
searchAllSchemas: Dock.allSchemas, // 查询弹窗所需类
searchPage: DockApi.getDockPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
}]
}
}
},
{
label: '客户代码',
@ -58,6 +39,7 @@ export const Customerdock = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -130,6 +112,18 @@ export const Customerdock = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
isSearchList: true,
searchListPlaceholder: '请选择从仓库代码',
searchField: 'code',
searchTitle: '仓库基础信息',
searchAllSchemas: Warehouse.allSchemas,
searchPage: WarehouseApi.getWarehousePage,
}
}
},
{
label: '默认库位',
@ -142,20 +136,26 @@ export const Customerdock = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// // labelMessage: '信息提示说明!!!',
componentProps: {
// disabled:true
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择库位代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '库位基础信息', // 查询弹窗标题
// searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
// searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// action: '==',
// isSearch: true,
// isMainValue: false
// }]
enterSearch:true,
disabled:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位基础信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.selectConfigToLocation, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isSearch: true,
isMainValue: false
},
{
key: 'warehouseCode',
value: 'warehouseCode',
message: '请选择仓库',
isMainValue: true
}]
}
}
},
@ -313,6 +313,12 @@ export const CustomerdockRules = reactive({
customerCode: [
{ required: true, message: '请输入客户代码', trigger: 'blur' }
],
warehouseCode: [
{ required: true, message: '请选择仓库', trigger: 'blur' }
],
defaultLocationCode: [
{ required: true, message: '请选择默认库位', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],

28
src/views/wms/basicDataManage/customerManage/customerdock/index.vue

@ -150,26 +150,26 @@ const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if(type == "update"){
Customerdock.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
}
if (item.field == 'customerCode') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
}
})
if (item.field == 'code') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
}
if (item.field == 'customerCode') {
item.componentProps.disabled = true
item.componentProps.enterSearch = false
item.componentProps.isSearchList = false
}
})
}else {
Customerdock.allSchemas.formSchema.forEach((item) => {
if (item.field == 'code') {
item.componentProps.disabled = false
item.componentProps.isSearchList = true
}
if (item.field == 'customerCode') {
item.componentProps.disabled = false
item.componentProps.isSearchList = true
}
item.componentProps.disabled = false
item.componentProps.enterSearch = true
item.componentProps.isSearchList = true
}
})
}
basicFormRef.value.open(type, row)

2
src/views/wms/basicDataManage/customerManage/customeritem/customeritem.data.ts

@ -26,6 +26,7 @@ export const Customeritem = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -51,6 +52,7 @@ export const Customeritem = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段

24
src/views/wms/basicDataManage/customerManage/customeritem/index.vue

@ -41,12 +41,15 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
@success="formsSuccess"
:rules="CustomeritemRules"
:formAllSchemas="Customeritem.allSchemas"
:apiUpdate="CustomeritemApi.updateCustomeritem"
:apiCreate="CustomeritemApi.createCustomeritem"
@searchTableSuccess="searchTableSuccess"
@onEnter="onEnter"
:isBusiness="false"
/>
@ -66,6 +69,8 @@ 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 ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '../../itemManage/itembasic/itembasic.data'
defineOptions({ name: 'Customeritem' })
@ -199,7 +204,24 @@ const formsSuccess = async (formType,data) => {
basicFormRef.value.dialogVisible = false
getList()
}
const onEnter = async (field,value)=>{
console.log(field,value)
if(field=='itemCode'){
basicFormRef.value.opensearchTable('itemCode', 'code', '物料基础信息', Itembasic.allSchemas, ItembasicApi.getItembasicPage,[{
key: 'available',
value: 'TRUE',
action: '==',
isSearch: true,
isMainValue: false
},{
key: 'code',
value: value,
action: '==',
isSearch: true,
isMainValue: false
}])
}
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {

1
src/views/wms/basicDataManage/customerManage/project/project.data.ts

@ -35,6 +35,7 @@ export const Project = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段

2
src/views/wms/basicDataManage/customerManage/saleprice/index.vue

@ -156,6 +156,7 @@ const openForm = (type: string, row?: any) => {
}
if (item.field == 'itemCode') {
item.componentProps.disabled = true
item.componentProps.enterSearch = false
item.componentProps.isSearchList = false
}
})
@ -167,6 +168,7 @@ const openForm = (type: string, row?: any) => {
}
if (item.field == 'itemCode') {
item.componentProps.disabled = false
item.componentProps.enterSearch = true
item.componentProps.isSearchList = true
}
})

2
src/views/wms/basicDataManage/customerManage/saleprice/saleprice.data.ts

@ -26,6 +26,7 @@ export const Saleprice = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择客户代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -51,6 +52,7 @@ export const Saleprice = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段

1
src/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data.ts

@ -41,6 +41,7 @@ export const Area = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段

1
src/views/wms/basicDataManage/factoryModeling/areabasic/index.vue

@ -58,6 +58,7 @@
</template>
<script setup lang="ts">
//
import download from '@/utils/download'
import * as AreaApi from '@/api/wms/areabasic'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'

1
src/views/wms/basicDataManage/factoryModeling/dock/dock.data.ts

@ -56,6 +56,7 @@ export const Dock = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段

1
src/views/wms/basicDataManage/factoryModeling/dock/index.vue

@ -59,6 +59,7 @@
</template>
<script setup lang="ts">
//
import download from '@/utils/download'
import * as DockApi from '@/api/wms/dock'
import BasicForm from '@/components/BasicForm/src/BasicForm.vue'

3
src/views/wms/basicDataManage/factoryModeling/location/location.data.ts

@ -47,6 +47,7 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -72,6 +73,7 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库区代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -101,6 +103,7 @@ export const Location = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位组代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段

1
src/views/wms/basicDataManage/factoryModeling/locationgroup/index.vue

@ -67,6 +67,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
//
defineOptions({ name: 'Locationgroup' })
const message = useMessage() //

2
src/views/wms/basicDataManage/factoryModeling/locationgroup/locationgroup.data.ts

@ -44,6 +44,7 @@ export const Locationgroup = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -69,6 +70,7 @@ export const Locationgroup = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库区代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段

2
src/views/wms/basicDataManage/factoryModeling/process/process.data.ts

@ -56,6 +56,7 @@ export const Process = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -80,6 +81,7 @@ export const Process = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段

1
src/views/wms/basicDataManage/factoryModeling/productionline/productionline.data.ts

@ -56,6 +56,7 @@ export const Productionline = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段

2
src/views/wms/basicDataManage/factoryModeling/workstation/index.vue

@ -67,7 +67,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
//
//
defineOptions({ name: 'Workstation' })
const message = useMessage() //

4
src/views/wms/basicDataManage/factoryModeling/workstation/workstation.data.ts

@ -65,6 +65,7 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -90,6 +91,7 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -119,6 +121,7 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -148,6 +151,7 @@ export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段

3
src/views/wms/basicDataManage/itemManage/bom/bom.data.ts

@ -25,6 +25,7 @@ export const Bom = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -45,6 +46,7 @@ export const Bom = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
@ -92,6 +94,7 @@ export const Bom = useCrudSchemas(reactive<CrudSchema[]>([
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择工序代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段

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

Loading…
Cancel
Save