Browse Source

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

master_hella_20240701
songguoqiang 6 months ago
parent
commit
df4bc87797
  1. 30
      .env.wyf
  2. 2
      README.md
  3. 46
      src/api/eam/adjustRecordDetail/index.ts
  4. 46
      src/api/eam/adjustRecordMain/index.ts
  5. 57
      src/api/eam/applicationRecordDetail/index.ts
  6. 67
      src/api/eam/applicationRecordMain/index.ts
  7. 51
      src/api/eam/countJobDetail/index.ts
  8. 56
      src/api/eam/countJobMain/index.ts
  9. 51
      src/api/eam/countRecordDetail/index.ts
  10. 61
      src/api/eam/countRecordMain/index.ts
  11. 51
      src/api/eam/countadjustPlan/index.ts
  12. 20
      src/api/eam/equipmentRepairJobMain/index.ts
  13. 63
      src/api/eam/itemAccounts/index.ts
  14. 57
      src/api/eam/itemApplyDetail/index.ts
  15. 50
      src/api/eam/itemInLocation/index.ts
  16. 49
      src/api/eam/itemLocationReplace/index.ts
  17. 52
      src/api/eam/itemMaintenance/index.ts
  18. 65
      src/api/eam/itemOrderDetail/index.ts
  19. 71
      src/api/eam/itemOrderMain/index.ts
  20. 50
      src/api/eam/itemOutLocation/index.ts
  21. 63
      src/api/eam/sparePartsApplyDetail/index.ts
  22. 65
      src/api/eam/sparePartsApplyMain/index.ts
  23. 58
      src/api/eam/sparePartsInLocationDetail/index.ts
  24. 65
      src/api/eam/sparePartsInLocationMain/index.ts
  25. 21
      src/api/eam/toolAccounts/index.ts
  26. 64
      src/api/eam/toolEquipmentIn/index.ts
  27. 64
      src/api/eam/toolEquipmentOut/index.ts
  28. 53
      src/api/eam/transaction/index.ts
  29. 5
      src/api/wms/process/index.ts
  30. 8
      src/api/wms/productionDetail/index.ts
  31. 6
      src/api/wms/productionline/index.ts
  32. 6
      src/api/wms/workstation/index.ts
  33. 12
      src/components/Detail/src/Detail.vue
  34. 111
      src/components/Detail/src/DetailLedger.vue
  35. 2
      src/components/DetailTable/src/DetailTable.vue
  36. 153
      src/components/TableFormCountPlan/src/TableFormCountPlan.vue
  37. 105
      src/components/rowDrop/index.vue
  38. 2
      src/config/axios/config.ts
  39. 3
      src/hooks/web/useMessage.ts
  40. 8
      src/utils/dict.ts
  41. 26
      src/utils/disposition/defaultButtons.ts
  42. 189
      src/views/eam/adjustRecord/adjustRecord.data.ts
  43. 322
      src/views/eam/adjustRecord/index.vue
  44. 329
      src/views/eam/applicationRecord/applicationRecordMain.data.ts
  45. 371
      src/views/eam/applicationRecord/index.vue
  46. 242
      src/views/eam/countRecord/countRecord.data.ts
  47. 339
      src/views/eam/countRecord/index.vue
  48. 78
      src/views/eam/countadjustPlan/countadjustPlan.data.ts
  49. 244
      src/views/eam/countadjustPlan/index.vue
  50. 156
      src/views/eam/countadjustWork/countadjustWork.data.ts
  51. 306
      src/views/eam/countadjustWork/index.vue
  52. 248
      src/views/eam/equipmentAccounts/equipmentAccounts.data.ts
  53. 54
      src/views/eam/equipmentAccounts/index.vue
  54. 5
      src/views/eam/equipmentMaintenanceMain/finishForm1.vue
  55. 18
      src/views/eam/equipmentMaintenanceMain/index.vue
  56. 46
      src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts
  57. 211
      src/views/eam/equipmentRepairJobMain/finishForm1.vue
  58. 209
      src/views/eam/equipmentRepairJobMain/finishForm3.vue
  59. 124
      src/views/eam/equipmentRepairJobMain/index.vue
  60. 173
      src/views/eam/equipmentShutdown/equipmentShutdown.data.ts
  61. 127
      src/views/eam/equipmentSigning/equipmentSigning.data.ts
  62. 270
      src/views/eam/equipmentSigning/index.vue
  63. 351
      src/views/eam/equipmentTransferRecord/equipmentTransferRecord.data.ts
  64. 32
      src/views/eam/equipmentTransferRecord/index.vue
  65. 399
      src/views/eam/itemAccounts/index.vue
  66. 349
      src/views/eam/itemAccounts/itemAccounts.data.ts
  67. 224
      src/views/eam/itemInLocation/index.vue
  68. 53
      src/views/eam/itemInLocation/itemInLocation.data.ts
  69. 244
      src/views/eam/itemLocationReplace/index.vue
  70. 55
      src/views/eam/itemLocationReplace/itemLocationReplace.data.ts
  71. 243
      src/views/eam/itemMaintenance/index.vue
  72. 110
      src/views/eam/itemMaintenance/itemMaintenance.data.ts
  73. 304
      src/views/eam/itemOrderMain/index.vue
  74. 310
      src/views/eam/itemOrderMain/itemOrderMain.data.ts
  75. 243
      src/views/eam/itemOutLocation/index.vue
  76. 53
      src/views/eam/itemOutLocation/itemOutLocation.data.ts
  77. 3
      src/views/eam/sparePart/sparePart.data.ts
  78. 290
      src/views/eam/sparePartsApplyMain/SparePartsApply.data.ts
  79. 372
      src/views/eam/sparePartsApplyMain/index.vue
  80. 379
      src/views/eam/sparepartsinlocation/index.vue
  81. 327
      src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts
  82. 231
      src/views/eam/toolAccounts/index.vue
  83. 405
      src/views/eam/toolAccounts/toolAccounts.data.ts
  84. 290
      src/views/eam/toolEquipmentIn/index.vue
  85. 350
      src/views/eam/toolEquipmentIn/toolEquipmentIn.data.ts
  86. 253
      src/views/eam/toolEquipmentOut/index.vue
  87. 230
      src/views/eam/toolEquipmentOut/toolEquipmentOut.data.ts
  88. 241
      src/views/eam/transaction/index.vue
  89. 94
      src/views/eam/transaction/transaction.data.ts
  90. 8
      src/views/wms/basicDataManage/customerManage/customerdock/customerdock.data.ts
  91. 13
      src/views/wms/basicDataManage/itemManage/itempackage/itempackage.data.ts
  92. 16
      src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/index.vue
  93. 289
      src/views/wms/countManage/count/countPlanMain/index.vue
  94. 9
      src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts
  95. 101
      src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue
  96. 2
      src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue
  97. 19
      src/views/wms/deliversettlementManage/stockup/stockupMainJob/stockupMainJob.data.ts
  98. 5
      src/views/wms/deliversettlementManage/stockup/stockupMainRecord/stockupMainRecord.data.ts
  99. 13
      src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts
  100. 2
      src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRecordMain/index.vue

30
.env.wyf

@ -3,16 +3,16 @@ NODE_ENV=test
VITE_DEV=false VITE_DEV=false
# 请求路径 # # # 请求路径
VITE_BASE_URL='http://192.168.0.108:12080' # VITE_BASE_URL='http://192.168.0.110:12080'
# 上传路径 # # 上传路径
VITE_UPLOAD_URL='http://192.168.0.108:12080/admin-api/infra/file/upload' # VITE_UPLOAD_URL='http://192.168.0.110:12080/admin-api/infra/file/upload'
# # 请求路径 # 请求路径
# VITE_BASE_URL='http://dev.ccwin-in.com:25300/api' VITE_BASE_URL='http://dev.ccwin-in.com:25300/api'
# # 上传路径 # 上传路径
# VITE_UPLOAD_URL='http://dev.ccwin-in.com:25300/api/admin-api/infra/file/upload' VITE_UPLOAD_URL='http://dev.ccwin-in.com:25300/api/admin-api/infra/file/upload'
# 接口前缀 # 接口前缀
VITE_API_BASEPATH= VITE_API_BASEPATH=
@ -35,17 +35,17 @@ VITE_BASE_PATH=/
# 输出路径 # 输出路径
VITE_OUT_DIR=sfms3.0 VITE_OUT_DIR=sfms3.0
# # 自定义接口路径
# VITE_INTERFACE_URL='http://192.168.0.108:12080/magic/web/index.html'
# # 积木报表请求路径
# VITE_JMREPORT_BASE_URL='http://192.168.0.108:12080'
# 自定义接口路径 # 自定义接口路径
VITE_INTERFACE_URL='http://192.168.0.108:12080/magic/web/index.html' VITE_INTERFACE_URL='http://dev.ccwin-in.com:25310/magic/web/index.html'
# 积木报表请求路径 # 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://192.168.0.108:12080' VITE_JMREPORT_BASE_URL='http://192.168.0.108:12080'
# # 自定义接口路径
# VITE_INTERFACE_URL='http://dev.ccwin-in.com:25310/magic/web/index.html'
# # 积木报表请求路径
# VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310'
# 租户配置 # 租户配置
VITE_TENANT='["长春","成都"]' VITE_TENANT='["长春","成都"]'

2
README.md

@ -1,4 +1,4 @@
## dev发布2024-06-01-001 ## dev发布2024-06-01-002
**xxxx.data.ts 文件配置说明** **xxxx.data.ts 文件配置说明**
**form表单查询弹窗配置** **form表单查询弹窗配置**
form: { form: {

46
src/api/eam/adjustRecordDetail/index.ts

@ -0,0 +1,46 @@
import request from '@/config/axios'
export interface AdjustRecordDetailVO {
number: string
planNumber: string
requestNumber: string
requestTime: Date
jobNumber: string
recordNumber: string
}
// 查询备件盘点调整记录主列表
export const getAdjustRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/adjustRecordDetail/senior', data })
} else {
return await request.get({ url: `/eam/adjustRecordDetail/page`, params })
}
}
// 查询备件盘点调整记录主详情
export const getAdjustRecordDetail = async (id: number) => {
return await request.get({ url: `/eam/adjustRecordDetail/get?id=` + id })
}
// 新增备件盘点调整记录主
export const createAdjustRecordDetail = async (data: AdjustRecordDetailVO) => {
return await request.post({ url: `/eam/adjustRecordDetail/create`, data })
}
// 修改备件盘点调整记录主
export const updateAdjustRecordDetail = async (data: AdjustRecordDetailVO) => {
return await request.put({ url: `/eam/adjustRecordDetail/update`, data })
}
// 删除备件盘点调整记录主
export const deleteAdjustRecordDetail = async (id: number) => {
return await request.delete({ url: `/eam/adjustRecordDetail/delete?id=` + id })
}
// 导出备件盘点调整记录主 Excel
export const exportAdjustRecordDetail = async (params) => {
return await request.download({ url: `/eam/adjustRecordDetail/export-excel`, params })
}

46
src/api/eam/adjustRecordMain/index.ts

@ -0,0 +1,46 @@
import request from '@/config/axios'
export interface AdjustRecordMainVO {
number: string
planNumber: string
requestNumber: string
requestTime: Date
jobNumber: string
recordNumber: string
}
// 查询备件盘点调整记录主列表
export const getAdjustRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/adjustRecordMain/senior', data })
} else {
return await request.get({ url: `/eam/adjustRecordMain/page`, params })
}
}
// 查询备件盘点调整记录主详情
export const getAdjustRecordMain = async (id: number) => {
return await request.get({ url: `/eam/adjustRecordMain/get?id=` + id })
}
// 新增备件盘点调整记录主
export const createAdjustRecordMain = async (data: AdjustRecordMainVO) => {
return await request.post({ url: `/eam/adjustRecordMain/create`, data })
}
// 修改备件盘点调整记录主
export const updateAdjustRecordMain = async (data: AdjustRecordMainVO) => {
return await request.put({ url: `/eam/adjustRecordMain/update`, data })
}
// 删除备件盘点调整记录主
export const deleteAdjustRecordMain = async (id: number) => {
return await request.delete({ url: `/eam/adjustRecordMain/delete?id=` + id })
}
// 导出备件盘点调整记录主 Excel
export const exportAdjustRecordMain = async (params) => {
return await request.download({ url: `/eam/adjustRecordMain/export-excel`, params })
}

57
src/api/eam/applicationRecordDetail/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface ItemApplyDetailVO {
number : string
name : string
type : string
applyId : number
applyDeptId : number
approveId : number
approveTime : Date
outId : number
outTime : Date
siteId : string
available : string
concurrencyStamp : number
}
// 查询备件申领记录主列表
export const getApplicationRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/item-apply-request-detail/senior', data })
} else {
return await request.get({ url: `/eam/item-apply-request-detail/page`, params })
}
}
// 查询备件申领记录主详情
export const getApplicationRecordDetail = async (id : number) => {
return await request.get({ url: `/eam/item-apply-request-detail/get?id=` + id })
}
// 新增备件申领记录主
export const createApplicationRecordDetail = async (data : ItemApplyDetailVO) => {
return await request.post({ url: `/eam/item-apply-request-detail/create`, data })
}
// 修改备件申领记录主
export const updateApplicationRecordDetail = async (data : ItemApplyDetailVO) => {
return await request.put({ url: `/eam/item-apply-request-detail/update`, data })
}
// 删除备件申领记录主
export const deleteApplicationRecordDetail = async (id : number) => {
return await request.delete({ url: `/eam/item-apply-request-detail/delete?id=` + id })
}
// 导出备件申领记录主 Excel
export const exportApplicationRecordDetail = async (params) => {
return await request.download({ url: `/eam/item-apply-request-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-apply-request-detail/get-import-template' })
}

67
src/api/eam/applicationRecordMain/index.ts

@ -0,0 +1,67 @@
import request from '@/config/axios'
export interface ItemApplyMainVO {
number: string
name: string
type: string
applyId: number
applyDeptId: number
approveId: number
approveTime: Date
outId: number
outTime: Date
siteId: string
available: string
concurrencyStamp: number
}
// 查询备件申领记录主列表
export const getApplicationRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-apply-request-main/senior', data })
} else {
return await request.get({ url: `/eam/item-apply-request-main/page`, params })
}
}
// 查询备件申领记录主详情
export const getApplicationRecordMain = async (id: number) => {
return await request.get({ url: `/eam/item-apply-request-main/get?id=` + id })
}
// 新增备件申领记录主
export const createApplicationRecordMain = async (data: ItemApplyMainVO) => {
return await request.post({ url: `/eam/item-apply-request-main/create`, data })
}
// 修改备件申领记录主
export const updateApplicationRecordMain = async (data: ItemApplyMainVO) => {
return await request.put({ url: `/eam/item-apply-request-main/update`, data })
}
// 删除备件申领记录主
export const deleteApplicationRecordMain = async (id: number) => {
return await request.delete({ url: `/eam/item-apply-request-main/delete?id=` + id })
}
// 审批通过备件申领记录主
export const agreeApplicationRecordMain = async (id: number) => {
return await request.get({ url: `/eam/item-apply-request-main/agree?id=` + id })
}
// 审批驳回备件申领记录主
export const disAgreeApplicationRecordMain = async (id: number) => {
return await request.get({ url: `/eam/item-apply-request-main/disAgree?id=` + id })
}
// 导出备件申领记录主 Excel
export const exportApplicationRecordMain = async (params) => {
return await request.download({ url: `/eam/item-apply-request-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-apply-request-main/get-import-template' })
}

51
src/api/eam/countJobDetail/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface CountJobDetailVO {
id : number
number : string
name : string
classification : string
isInAccount : string
status : string
}
// 查询备件盘点计划列表
export const getCountJobDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/countJobDetail/senior', data })
} else {
return await request.get({ url: `/eam/countJobDetail/page`, params })
}
}
// 查询备件盘点计划详情
export const getCountJobDetail = async (id : number) => {
return await request.get({ url: `/eam/countJobDetail/get?id=` + id })
}
// 新增备件盘点计划
export const createCountJobDetail = async (data : CountJobDetailVO) => {
return await request.post({ url: `/eam/countJobDetail/create`, data })
}
// 修改备件盘点计划
export const updateCountJobDetail = async (data : CountJobDetailVO) => {
return await request.put({ url: `/eam/countJobDetail/update`, data })
}
// 删除备件盘点计划
export const deleteCountJobDetail = async (id : number) => {
return await request.delete({ url: `/eam/countJobDetail/delete?id=` + id })
}
// 导出备件盘点计划 Excel
export const exportCountJobDetail = async (params) => {
return await request.download({ url: `/eam/countJobDetail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/countJobDetail/get-import-template' })
}

56
src/api/eam/countJobMain/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface CountJobMainVO {
id : number
number : string
name : string
classification : string
isInAccount : string
status : string
}
// 查询备件盘点计划列表
export const getCountJobMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/countJobMain/senior', data })
} else {
return await request.get({ url: `/eam/countJobMain/page`, params })
}
}
// 查询备件盘点计划详情
export const getCountJobMain = async (id : number) => {
return await request.get({ url: `/eam/countJobMain/get?id=` + id })
}
// 新增备件盘点计划
export const createCountJobMain = async (data : CountJobMainVO) => {
return await request.post({ url: `/eam/countJobMain/create`, data })
}
// 修改备件盘点计划
export const updateCountJobMain = async (data : CountJobMainVO) => {
return await request.put({ url: `/eam/countJobMain/update`, data })
}
// 删除备件盘点计划
export const deleteCountJobMain = async (id : number) => {
return await request.delete({ url: `/eam/countJobMain/delete?id=` + id })
}
// 导出备件盘点计划 Excel
export const handleMainExport = async (id : number) => {
return await request.download({ url: `/eam/countJobMain/handleMainExport?id=` + id })
}
// 导出备件盘点计划 Excel
export const exportCountJobMain = async (params) => {
return await request.download({ url: `/eam/countJobMain/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/countJobMain/get-import-template' })
}

51
src/api/eam/countRecordDetail/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface CountRecordDetailVO {
id : number
number : string
name : string
classification : string
isInAccount : string
status : string
}
// 查询备件盘点计划列表
export const getCountRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/countRecordDetail/senior', data })
} else {
return await request.get({ url: `/eam/countRecordDetail/page`, params })
}
}
// 查询备件盘点计划详情
export const getCountRecordDetail = async (id : number) => {
return await request.get({ url: `/eam/countRecordDetail/get?id=` + id })
}
// 新增备件盘点计划
export const createCountRecordDetail = async (data : CountRecordDetailVO) => {
return await request.post({ url: `/eam/countRecordDetail/create`, data })
}
// 修改备件盘点计划
export const updateCountRecordDetail = async (data : CountRecordDetailVO) => {
return await request.put({ url: `/eam/countRecordDetail/update`, data })
}
// 删除备件盘点计划
export const deleteCountRecordDetail = async (id : number) => {
return await request.delete({ url: `/eam/countRecordDetail/delete?id=` + id })
}
// 导出备件盘点计划 Excel
export const exportCountRecordDetail = async (params) => {
return await request.download({ url: `/eam/countRecordDetail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/countRecordDetail/get-import-template' })
}

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

@ -0,0 +1,61 @@
import request from '@/config/axios'
export interface CountRecordMainVO {
id : number
number : string
name : string
classification : string
isInAccount : string
status : string
}
// 查询备件盘点计划列表
export const getCountRecordMainPage = async (params) => {
params.status="CANGENERATE"
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/countRecordMain/senior', data })
} else {
return await request.get({ url: `/eam/countRecordMain/page`, params })
}
}
// 查询备件盘点计划详情
export const getCountRecordMain = async (id : number) => {
return await request.get({ url: `/eam/countRecordMain/get?id=` + id })
}
// 新增备件盘点计划
export const createCountRecordMain = async (data : CountRecordMainVO) => {
return await request.post({ url: `/eam/countRecordMain/create`, data })
}
// 修改备件盘点计划
export const updateCountRecordMain = async (data : CountRecordMainVO) => {
return await request.put({ url: `/eam/countRecordMain/update`, data })
}
// 删除备件盘点计划
export const deleteCountRecordMain = async (id : number) => {
return await request.delete({ url: `/eam/countRecordMain/delete?id=` + id })
}
// 盘点调整
export const adjustCountRecordMain = async (id : number) => {
return await request.get({ url: `/eam/countRecordMain/adjust?number=` + id })
}
// 导出备件盘点计划 Excel
export const handleMainExport = async (id : number) => {
return await request.download({ url: `/eam/countRecordMain/handleMainExport?id=` + id })
}
// 导出备件盘点计划 Excel
export const exportCounRecordMain = async (params) => {
return await request.download({ url: `/eam/countRecordMain/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/countRecordMain/get-import-template' })
}

51
src/api/eam/countadjustPlan/index.ts

@ -0,0 +1,51 @@
import request from '@/config/axios'
export interface CountadjustPlanVO {
id : number
number : string
name : string
classification : string
isInAccount : string
status : string
}
// 查询备件盘点计划列表
export const getCountadjustPlanPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = { ...params }
return await request.post({ url: '/eam/countadjust-plan/senior', data })
} else {
return await request.get({ url: `/eam/countadjust-plan/page`, params })
}
}
// 查询备件盘点计划详情
export const getCountadjustPlan = async (id : number) => {
return await request.get({ url: `/eam/countadjust-plan/get?id=` + id })
}
// 新增备件盘点计划
export const createCountadjustPlan = async (data : CountadjustPlanVO) => {
return await request.post({ url: `/eam/countadjust-plan/create`, data })
}
// 修改备件盘点计划
export const updateCountadjustPlan = async (data : CountadjustPlanVO) => {
return await request.put({ url: `/eam/countadjust-plan/update`, data })
}
// 删除备件盘点计划
export const deleteCountadjustPlan = async (id : number) => {
return await request.delete({ url: `/eam/countadjust-plan/delete?id=` + id })
}
// 导出备件盘点计划 Excel
export const exportCountadjustPlan = async (params) => {
return await request.download({ url: `/eam/countadjust-plan/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/countadjust-plan/get-import-template' })
}

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

@ -14,9 +14,12 @@ export interface EquipmentRepairJobMainVO {
startTime: Date startTime: Date
endTime: Date endTime: Date
totalMinutes: number totalMinutes: number
verifyer: number verifyerRepair: number
verifyContent: string verifyContentRepair: string
verifyTime: Date verifyTimeRepair: Date
verifyerReport: number
verifyContentReport: string
verifyTimeReport: Date
maintenancer: number maintenancer: number
maintenancePhone: string maintenancePhone: string
completeResult: string completeResult: string
@ -100,3 +103,14 @@ export const importTemplate = () => {
export const updateEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => { export const updateEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => {
return await request.post({ url: `/eam/equipment-repair-job-main/updateOrder`, data }) 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 })
}

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

@ -0,0 +1,63 @@
import request from '@/config/axios'
export interface ItemAccountsVO {
itemNumber: string
qty: number
areaNumber: string
isInAccount: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询备件台账列表
export const getItemAccountsPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-accounts/senior', data })
} else {
return await request.get({ url: `/eam/item-accounts/page`, params })
}
}
// 查询备件台账详情
export const getItemAccounts = async (id: number) => {
return await request.get({ url: `/eam/item-accounts/get?id=` + id })
}
// 新增备件台账
export const createItemAccounts = async (data: ItemAccountsVO) => {
return await request.post({ url: `/eam/item-accounts/create`, data })
}
// 修改备件台账
export const updateItemAccounts = async (data: ItemAccountsVO) => {
return await request.put({ url: `/eam/item-accounts/update`, data })
}
// 删除备件台账
export const deleteItemAccounts = async (id: number) => {
return await request.delete({ url: `/eam/item-accounts/delete?id=` + id })
}
// 导出备件台账 Excel
export const exportItemAccounts = async (params) => {
return await request.download({ url: `/eam/item-accounts/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-accounts/get-import-template' })
}
// 更改备件库位
export const replaceLocation = async (data: Array<ItemAccountsVO>) => {
return await request.post({url: `/eam/item-accounts/replaceLocation `, data });
};
// 备件不分页
export const getItemAccountsNoPage = async (params) => {
return await request.get({ url: `/eam/item-accounts/noPage`, params })
}

57
src/api/eam/itemApplyDetail/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface ItemApplyDetailVO {
number: string
name: string
type: string
applyId: number
applyDeptId: number
approveId: number
approveTime: Date
outId: number
outTime: Date
siteId: string
available: string
concurrencyStamp: number
}
// 查询备件申领记录主列表
export const getItemApplyDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-apply-request-detail/senior', data })
} else {
return await request.get({ url: `/eam/item-apply-request-detail/page`, params })
}
}
// 查询备件申领记录主详情
export const getItemApplyDetail = async (id: number) => {
return await request.get({ url: `/eam/item-apply-request-detail/get?id=` + id })
}
// 新增备件申领记录主
export const createItemApplyDetail = async (data: ItemApplyDetailVO) => {
return await request.post({ url: `/eam/item-apply-request-detail/create`, data })
}
// 修改备件申领记录主
export const updateItemApplyDetail = async (data: ItemApplyDetailVO) => {
return await request.put({ url: `/eam/item-apply-request-detail/update`, data })
}
// 删除备件申领记录主
export const deleteItemApplyDetail = async (id: number) => {
return await request.delete({ url: `/eam/item-apply-request-detail/delete?id=` + id })
}
// 导出备件申领记录主 Excel
export const exportItemApplyDetail = async (params) => {
return await request.download({ url: `/eam/item-apply-request-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-apply-request-detail/get-import-template' })
}

50
src/api/eam/itemInLocation/index.ts

@ -0,0 +1,50 @@
import request from '@/config/axios'
export interface ItemInLocationVO {
number: string
itemNumber: string
locationNumber: string
type: string
qty: number
}
// 查询备件入库记录列表
export const getItemInLocationPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-in-location/senior', data })
} else {
return await request.get({ url: `/eam/item-in-location/page`, params })
}
}
// 查询备件入库记录详情
export const getItemInLocation = async (id: number) => {
return await request.get({ url: `/eam/item-in-location/get?id=` + id })
}
// 新增备件入库记录
export const createItemInLocation = async (data: ItemInLocationVO) => {
return await request.post({ url: `/eam/item-in-location/create`, data })
}
// 修改备件入库记录
export const updateItemInLocation = async (data: ItemInLocationVO) => {
return await request.put({ url: `/eam/item-in-location/update`, data })
}
// 删除备件入库记录
export const deleteItemInLocation = async (id: number) => {
return await request.delete({ url: `/eam/item-in-location/delete?id=` + id })
}
// 导出备件入库记录 Excel
export const exportItemInLocation = async (params) => {
return await request.download({ url: `/eam/item-in-location/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-in-location/get-import-template' })
}

49
src/api/eam/itemLocationReplace/index.ts

@ -0,0 +1,49 @@
import request from '@/config/axios'
export interface ItemLocationReplaceVO {
locationNumber: string
describe: string
oldItemNumber: string
itemNumber: string
}
// 查询备件库位变更记录列表
export const getItemLocationReplacePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-location-replace/senior', data })
} else {
return await request.get({ url: `/eam/item-location-replace/page`, params })
}
}
// 查询备件库位变更记录详情
export const getItemLocationReplace = async (id: number) => {
return await request.get({ url: `/eam/item-location-replace/get?id=` + id })
}
// 新增备件库位变更记录
export const createItemLocationReplace = async (data: ItemLocationReplaceVO) => {
return await request.post({ url: `/eam/item-location-replace/create`, data })
}
// 修改备件库位变更记录
export const updateItemLocationReplace = async (data: ItemLocationReplaceVO) => {
return await request.put({ url: `/eam/item-location-replace/update`, data })
}
// 删除备件库位变更记录
export const deleteItemLocationReplace = async (id: number) => {
return await request.delete({ url: `/eam/item-location-replace/delete?id=` + id })
}
// 导出备件库位变更记录 Excel
export const exportItemLocationReplace = async (params) => {
return await request.download({ url: `/eam/item-location-replace/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-location-replace/get-import-template' })
}

52
src/api/eam/itemMaintenance/index.ts

@ -0,0 +1,52 @@
import request from '@/config/axios'
export interface ItemMaintenanceVO {
number: string
itemNumber: string
qty: number
result: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询备件维修记录列表
export const getItemMaintenancePage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-maintenance-record/senior', data })
} else {
return await request.get({ url: `/eam/item-maintenance-record/page`, params })
}
}
// 查询备件维修记录详情
export const getItemMaintenance = async (id: number) => {
return await request.get({ url: `/eam/item-maintenance-record/get?id=` + id })
}
// 新增备件维修记录
export const createItemMaintenance = async (data: ItemMaintenanceVO) => {
return await request.post({ url: `/eam/item-maintenance-record/create`, data })
}
// 修改备件维修记录
export const updateItemMaintenance = async (data: ItemMaintenanceVO) => {
return await request.put({ url: `/eam/item-maintenance-record/update`, data })
}
// 删除备件维修记录
export const deleteItemMaintenance = async (id: number) => {
return await request.delete({ url: `/eam/item-maintenance-record/delete?id=` + id })
}
// 导出备件维修记录 Excel
export const exportItemMaintenance = async (params) => {
return await request.download({ url: `/eam/item-maintenance-record/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-maintenance-record/get-import-template' })
}

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

@ -0,0 +1,65 @@
import request from '@/config/axios'
export interface ItemOrderDetailVO {
number: string
date: string
phone: string
fax: string
purchaser: string
supplierNumber: string
supplierName: string
supplierAddress: string
shipTo: string
invoiceTo: string
contacts: string
contactsPhone: string
paymentType: string
registLocation: string
bank: string
account: string
dutyParagraph: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询备件采购订单主列表
export const getItemOrderDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-order-detail/senior', data })
} else {
return await request.get({ url: `/eam/item-order-detail/page`, params })
}
}
// 查询备件采购订单主详情
export const getItemOrderDetail = async (id: number) => {
return await request.get({ url: `/eam/item-order-detail/get?id=` + id })
}
// 新增备件采购订单主
export const createItemOrderDetail = async (data: ItemOrderDetailVO) => {
return await request.post({ url: `/eam/item-order-detail/create`, data })
}
// 修改备件采购订单主
export const updateItemOrderDetail = async (data: ItemOrderDetailVO) => {
return await request.put({ url: `/eam/item-order-detail/update`, data })
}
// 删除备件采购订单主
export const deleteItemOrderDetail = async (id: number) => {
return await request.delete({ url: `/eam/item-order-detail/delete?id=` + id })
}
// 导出备件采购订单主 Excel
export const exportItemOrderDetail = async (params) => {
return await request.download({ url: `/eam/item-order-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-order-detail/get-import-template' })
}

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

@ -0,0 +1,71 @@
import request from '@/config/axios'
export interface ItemOrderMainVO {
number: string
date: string
phone: string
fax: string
purchaser: string
supplierNumber: string
supplierName: string
supplierAddress: string
shipTo: string
invoiceTo: string
contacts: string
contactsPhone: string
paymentType: string
registLocation: string
bank: string
account: string
dutyParagraph: string
siteId: string
available: string
concurrencyStamp: number
}
// 查询备件采购订单主列表
export const getItemOrderMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-order-main/senior', data })
} else {
return await request.get({ url: `/eam/item-order-main/page`, params })
}
}
// 查询备件采购订单主详情
export const getItemOrderMain = async (id: number) => {
return await request.get({ url: `/eam/item-order-main/get?id=` + id })
}
// 新增备件采购订单主
export const createItemOrderMain = async (data: ItemOrderMainVO) => {
return await request.post({ url: `/eam/item-order-main/create`, data })
}
// 修改备件采购订单主
export const updateItemOrderMain = async (data: ItemOrderMainVO) => {
return await request.put({ url: `/eam/item-order-main/update`, data })
}
// 删除备件采购订单主
export const deleteItemOrderMain = async (id: number) => {
return await request.delete({ url: `/eam/item-order-main/delete?id=` + id })
}
// 关闭采购订单主
export const closeItemOrderMain = async (id: number) => {
return await request.post({ url: `/eam/item-order-main/close?id=` + id })
}
// 导出备件采购订单主 Excel
export const exportItemOrderMain = async (params) => {
return await request.download({ url: `/eam/item-order-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-order-main/get-import-template' })
}

50
src/api/eam/itemOutLocation/index.ts

@ -0,0 +1,50 @@
import request from '@/config/axios'
export interface ItemOutLocationVO {
number: string
itemNumber: string
locationNumber: string
type: string
qty: number
}
// 查询备件出库记录列表
export const getItemOutLocationPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/item-out-location/senior', data })
} else {
return await request.get({ url: `/eam/item-out-location/page`, params })
}
}
// 查询备件出库记录详情
export const getItemOutLocation = async (id: number) => {
return await request.get({ url: `/eam/item-out-location/get?id=` + id })
}
// 新增备件出库记录
export const createItemOutLocation = async (data: ItemOutLocationVO) => {
return await request.post({ url: `/eam/item-out-location/create`, data })
}
// 修改备件出库记录
export const updateItemOutLocation = async (data: ItemOutLocationVO) => {
return await request.put({ url: `/eam/item-out-location/update`, data })
}
// 删除备件出库记录
export const deleteItemOutLocation = async (id: number) => {
return await request.delete({ url: `/eam/item-out-location/delete?id=` + id })
}
// 导出备件出库记录 Excel
export const exportItemOutLocation = async (params) => {
return await request.download({ url: `/eam/item-out-location/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/item-out-location/get-import-template' })
}

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

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

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

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

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

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

@ -0,0 +1,65 @@
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) => {
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' })
}

21
src/api/eam/toolAccounts/index.ts

@ -42,38 +42,43 @@ export const getToolAccountsPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {
delete params.isSearch delete params.isSearch
const data = {...params} const data = {...params}
return await request.post({ url: '/eam/tool-accounts/senior', data }) return await request.post({ url: '/eam/tool/tool-accounts/senior', data })
} else { } else {
return await request.get({ url: `/eam/tool-accounts/page`, params }) return await request.get({ url: `/eam/tool/tool-accounts/page`, params })
} }
} }
// 查询工装台账详情 // 查询工装台账详情
export const getToolAccounts = async (id: number) => { export const getToolAccounts = async (id: number) => {
return await request.get({ url: `/eam/tool-accounts/get?id=` + id }) return await request.get({ url: `/eam/tool/tool-accounts/get?id=` + id })
} }
// 新增工装台账 // 新增工装台账
export const createToolAccounts = async (data: ToolAccountsVO) => { export const createToolAccounts = async (data: ToolAccountsVO) => {
return await request.post({ url: `/eam/tool-accounts/create`, data }) return await request.post({ url: `/eam/tool/tool-accounts/create`, data })
} }
// 修改工装台账 // 修改工装台账
export const updateToolAccounts = async (data: ToolAccountsVO) => { export const updateToolAccounts = async (data: ToolAccountsVO) => {
return await request.put({ url: `/eam/tool-accounts/update`, data }) return await request.put({ url: `/eam/tool/tool-accounts/update`, data })
} }
// 删除工装台账 // 删除工装台账
export const deleteToolAccounts = async (id: number) => { export const deleteToolAccounts = async (id: number) => {
return await request.delete({ url: `/eam/tool-accounts/delete?id=` + id }) return await request.delete({ url: `/eam/tool/tool-accounts/delete?id=` + id })
} }
// 导出工装台账 Excel // 导出工装台账 Excel
export const exportToolAccounts = async (params) => { export const exportToolAccounts = async (params) => {
return await request.download({ url: `/eam/tool-accounts/export-excel`, params }) return await request.download({ url: `/eam/tool/tool-accounts/export-excel`, params })
} }
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/eam/tool-accounts/get-import-template' }) return request.download({ url: '/eam/tool/tool-accounts/get-import-template' })
}
// 查询工装台账列表
export const getToolAccountsNoPage = async (params) => {
return await request.get({ url: `/eam/tool/tool-accounts/noPage`, params })
} }

64
src/api/eam/toolEquipmentIn/index.ts

@ -0,0 +1,64 @@
import request from '@/config/axios'
export interface ToolEquipmentInVO {
id: number
describing: string
toolCode: string
status: string
approver: number
approveContent: string
approveTime: Date
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 getToolEquipmentInPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/tool/tool-equipment-in/senior', data })
} else {
return await request.get({ url: `/eam/tool/tool-equipment-in/page`, params })
}
}
// 查询工装入库记录详情
export const getToolEquipmentIn = async (id: number) => {
return await request.get({ url: `/eam/tool/tool-equipment-in/get?id=` + id })
}
// 新增工装入库记录
export const createToolEquipmentIn = async (data: ToolEquipmentInVO) => {
return await request.post({ url: `/eam/tool/tool-equipment-in/create`, data })
}
// 修改工装入库记录
export const updateToolEquipmentIn = async (data: ToolEquipmentInVO) => {
return await request.put({ url: `/eam/tool/tool-equipment-in/update`, data })
}
// 删除工装入库记录
export const deleteToolEquipmentIn = async (id: number) => {
return await request.delete({ url: `/eam/tool/tool-equipment-in/delete?id=` + id })
}
// 导出工装入库记录 Excel
export const exportToolEquipmentIn = async (params) => {
return await request.download({ url: `/eam/tool/tool-equipment-in/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/tool/tool-equipment-in/get-import-template' })
}

64
src/api/eam/toolEquipmentOut/index.ts

@ -0,0 +1,64 @@
import request from '@/config/axios'
export interface ToolEquipmentOutVO {
id: number
theme: string
toolCode: string
type: string
qty: number
status: string
applyer: string
approver: number
approveContent: string
approveTime: Date
autoExamine: string
autoAgree: string
departmentCode: string
remark: string
siteId: string
available: string
deletionTime: Date
deleterId: byte[]
concurrencyStamp: number
}
// 查询工装出库记录列表
export const getToolEquipmentOutPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/tool/tool-equipment-out/senior', data })
} else {
return await request.get({ url: `/eam/tool/tool-equipment-out/page`, params })
}
}
// 查询工装出库记录详情
export const getToolEquipmentOut = async (id: number) => {
return await request.get({ url: `/eam/tool/tool-equipment-out/get?id=` + id })
}
// 新增工装出库记录
export const createToolEquipmentOut = async (data: ToolEquipmentOutVO) => {
return await request.post({ url: `/eam/tool/tool-equipment-out/create`, data })
}
// 修改工装出库记录
export const updateToolEquipmentOut = async (data: ToolEquipmentOutVO) => {
return await request.put({ url: `/eam/tool/tool-equipment-out/update`, data })
}
// 删除工装出库记录
export const deleteToolEquipmentOut = async (id: number) => {
return await request.delete({ url: `/eam/tool/tool-equipment-out/delete?id=` + id })
}
// 导出工装出库记录 Excel
export const exportToolEquipmentOut = async (params) => {
return await request.download({ url: `/eam/tool/tool-equipment-out/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/tool/tool-equipment-out/get-import-template' })
}

53
src/api/eam/transaction/index.ts

@ -0,0 +1,53 @@
import request from '@/config/axios'
export interface TransactionVO {
itemNumber: string
locationNumber: string
transactionType: string
inventoryAction: string
businessType: string
inventoryStatus: string
uom: string
qty: number
}
// 查询库存事务列表
export const getTransactionPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/eam/transaction/senior', data })
} else {
return await request.get({ url: `/eam/transaction/page`, params })
}
}
// 查询库存事务详情
export const getTransaction = async (id: number) => {
return await request.get({ url: `/eam/transaction/get?id=` + id })
}
// 新增库存事务
export const createTransaction = async (data: TransactionVO) => {
return await request.post({ url: `/eam/transaction/create`, data })
}
// 修改库存事务
export const updateTransaction = async (data: TransactionVO) => {
return await request.put({ url: `/eam/transaction/update`, data })
}
// 删除库存事务
export const deleteTransaction = async (id: number) => {
return await request.delete({ url: `/eam/transaction/delete?id=` + id })
}
// 导出库存事务 Excel
export const exportTransaction = async (params) => {
return await request.download({ url: `/eam/transaction/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/eam/transaction/get-import-template' })
}

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

@ -58,3 +58,8 @@ export const exportProcess = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/process/get-import-template' }) return request.download({ url: '/wms/process/get-import-template' })
} }
// 查询工序列表
export const getProcessNoPage = async (params) => {
return await request.get({ url: `/wms/process/noPage`, params })
}

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

@ -18,7 +18,13 @@ export interface ProductionDetailVO {
// 查询生产计划子列表 // 查询生产计划子列表
export const getProductionDetailPage = async (params) => { export const getProductionDetailPage = async (params) => {
return await request.get({ url: `/wms/production-detail/page`, params }) if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/production-detail/senior', data })
} else {
return await request.get({ url: `/wms/production-detail/page`, params })
}
} }
// 查询生产计划子详情 // 查询生产计划子详情

6
src/api/wms/productionline/index.ts

@ -59,3 +59,9 @@ export const exportProductionline = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/productionline/get-import-template' }) return request.download({ url: '/wms/productionline/get-import-template' })
} }
// 查询生产线列表
export const getProductionlineNoPage = async (params) => {
return await request.get({ url: `/wms/productionline/noPage`, params })
}

6
src/api/wms/workstation/index.ts

@ -71,3 +71,9 @@ export const selectAreaTypeToLocation = async (params) => {
return await request.get({ url: `/wms/workstation/pageAreaToLocation`, params }) return await request.get({ url: `/wms/workstation/pageAreaToLocation`, params })
} }
} }
// 查询工位列表
export const getWorkstationNoPage = async (params) => {
return await request.get({ url: `/wms/workstation/noPage`, params })
}

12
src/components/Detail/src/Detail.vue

@ -359,6 +359,12 @@ const props = defineProps({
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true
},
//
detailButtonIsShowAddStatusArray:{
type: Array,
required: false,
default: () => ['1']
}, },
// //
detailButtonIsShowEdit:{ detailButtonIsShowEdit:{
@ -627,7 +633,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
// //
detailButtonAdd = [ detailButtonAdd = [
defaultButtons.defaultAddBtn({ defaultButtons.defaultAddBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row, props.detailButtonIsShowAddStatusArray)
}) })
] ]
} }
@ -646,7 +652,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
// //
detailButtonEdit = [ detailButtonEdit = [
defaultButtons.mainListEditBtn({ defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray)
}) })
] ]
} }
@ -654,7 +660,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
// //
detailButtonDelete = [ detailButtonDelete = [
defaultButtons.mainListDeleteBtn({ defaultButtons.mainListDeleteBtn({
hide: isShowMainButton(row, ['1']) hide: isShowMainButton(row,props.detailButtonIsShowAddStatusArray)
}) })
] ]
} }

111
src/components/Detail/src/DetailLedger.vue

@ -91,28 +91,16 @@
</template> </template>
</DetailTable> </DetailTable>
</ContentWrap> </ContentWrap>
<ContentWrap class="w-[100%]" v-show="tabsList[current].label==annexAlias.label" :style="{height:remarkHeight+'px'}"> <ContentWrap class="w-[100%]" v-show="tabsList[current].label=='动态信息'" :style="{height:remarkHeight+'px'}">
<el-tabs class="demo-tabs" v-model="fileParmas.fileBusiType" @tab-change="handleTabsChange"> <el-descriptions title="" :column="2">
<el-tab-pane <el-descriptions-item
v-for="item in subTabsList" v-for="(value, key) in dynamicInfo"
:key="item.value" :key="key"
:label="item.label" :label="key"
:name="item.value" :span="1">
/> <el-tag>{{ value }}</el-tag>
<!-- 附件组件 --> </el-descriptions-item>
<ElScrollbar ref="scrollbar" :style="{height:(remarkHeight-40)+'px'}"> </el-descriptions>
<AnnexLedger
:annexData="annexData"
:showDownload = "annexAlias.showDownload"
:hiddenDelete = "annexAlias.hiddenDelete"
@handleAnnexSuccess="handleAnnexSuccess"
@deleteAnnexSuccess="deleteAnnexSuccess"
:upData="remarksData.data"
:key="count"
@saveEdit="saveEdit"
/>
</ElScrollbar>
</el-tabs>
</ContentWrap> </ContentWrap>
<ContentWrap class="w-[100%]" v-show="tabsList[current].label=='操作记录'" :style="{height:remarkHeight+'px'}"> <ContentWrap class="w-[100%]" v-show="tabsList[current].label=='操作记录'" :style="{height:remarkHeight+'px'}">
<el-tabs class="demo-tabs" v-model="operationRecordType" @tab-change="handleOperationTabsChange"> <el-tabs class="demo-tabs" v-model="operationRecordType" @tab-change="handleOperationTabsChange">
@ -447,6 +435,11 @@ const props = defineProps({
required: false, required: false,
default: null default: null
}, },
dynamicInfoFields: {
type: Object,
required: false,
default: null
}
// //
}) })
const isShowDrawer = ref(false) const isShowDrawer = ref(false)
@ -457,6 +450,8 @@ const fileParmas = ref({
funcCode: props.funcCode, funcCode: props.funcCode,
fileBusiType: '' fileBusiType: ''
}) })
const dynamicInfo = ref()
const dynamicInfoName = ref("")
const operationRecordType = ref() const operationRecordType = ref()
const operationRecordList = ref(props.operationRecordList) const operationRecordList = ref(props.operationRecordList)
if (props.isBasic == true) { if (props.isBasic == true) {
@ -480,14 +475,15 @@ if (props.isBasic == true) {
const otherList = [...props.annexTable, const otherList = [...props.annexTable,
{ {
label: '动态信息',
prop: 'DynamicInfo'
},{
label: '拓展属性', label: '拓展属性',
prop: 'ExpandProps' prop: 'ExpandProps'
}, },{
{
label: '操作记录', label: '操作记录',
prop: 'OperationRecord' prop: 'OperationRecord'
}, },{
{
label:props.annexAlias.label, label:props.annexAlias.label,
prop:'Annex' prop:'Annex'
},{ },{
@ -521,6 +517,8 @@ const initialData = ref([])
const codeLabelPrefix = ref('属性编号') const codeLabelPrefix = ref('属性编号')
const valueLabelPrefix = ref('属性值') const valueLabelPrefix = ref('属性值')
const expandPropsFormRef = ref(); const expandPropsFormRef = ref();
const operate = ref(false)
const operationTabParam = ref({})
// //
const remarkHeight = computed(() => { const remarkHeight = computed(() => {
const tab = unref(tabRef) const tab = unref(tabRef)
@ -646,9 +644,13 @@ const change = (item, index) => {
getExtendedPropsList() getExtendedPropsList()
}else if(item.prop == 'OperationRecord'){ }else if(item.prop == 'OperationRecord'){
if(props.operationRecordList){ if(props.operationRecordList){
operate.value = true
operationRecordType.value = props.operationRecordList[0]?.value operationRecordType.value = props.operationRecordList[0]?.value
} }
} }
if(item.prop != 'OperationRecord'){
operate.value = false
}
} }
// //
@ -693,6 +695,9 @@ const titleValueRef = ref()
const count =ref(0) const count =ref(0)
const deviceNumber = ref('') const deviceNumber = ref('')
const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => { const openDetail = async (row: any, titleName: any, titleValue: any, tableName: any) => {
//
getDynamicInfo(row)
titleNameRef.value = titleName titleNameRef.value = titleName
titleValueRef.value = titleValue titleValueRef.value = titleValue
deviceNumber.value = row.number?row.number:row.code deviceNumber.value = row.number?row.number:row.code
@ -771,6 +776,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
detailLoading.value = false detailLoading.value = false
} }
} }
} }
defineExpose({ openDetail, formRef }) // open defineExpose({ openDetail, formRef }) // open
@ -1125,6 +1131,28 @@ const getExtendedPropsList = async () => {
} }
const handleOperationTabsChange = async (val) => { const handleOperationTabsChange = async (val) => {
if(val == 'report'){
operationTabParam.value = {
'equipmentCode' : deviceNumber.value,
}
}else if(val == 'repair'){
operationTabParam.value = {
'equipmentCode' : deviceNumber.value,
}
}else if(val == 'maintenance'){
operationTabParam.value = {
'equipmentCode' : deviceNumber.value,
}
}else if(val == 'inspection'){
operationTabParam.value = {
'equipmentCode' : deviceNumber.value,
}
}else if(val == 'spot_check'){
operationTabParam.value = {
'equipmentCode' : deviceNumber.value,
}
}
tableObjectRef.value.loading = false
emit("handleOperationTabsChange",val) emit("handleOperationTabsChange",val)
} }
@ -1140,7 +1168,6 @@ const dialogUploadNumber = ref()
const dialogUploadBusiCode = ref() const dialogUploadBusiCode = ref()
const dialogFormKey = ref(0) const dialogFormKey = ref(0)
const openDialog = async(row: any, titleName: any, titleValue: any) => { const openDialog = async(row: any, titleName: any, titleValue: any) => {
debugger
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: props.dialogApiPage, // getListApi: props.dialogApiPage, //
defaultParams: getDialogParams(row) defaultParams: getDialogParams(row)
@ -1172,7 +1199,8 @@ watch(
() => props.apiPage, () => props.apiPage,
() => { () => {
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage // getListApi: props.apiPage, //
defaultParams: getSubTabParams()
}) })
tableObject.params.masterId = masterParmas.value.masterId tableObject.params.masterId = masterParmas.value.masterId
detailAllSchemasRef.value = props.detailAllSchemas detailAllSchemasRef.value = props.detailAllSchemas
@ -1187,6 +1215,32 @@ watch(
getList() getList()
} }
) )
const getSubTabParams = () => {
if(operate.value){
return operationTabParam.value
}
}
const getDynamicInfo = (row) => {
dynamicInfoName.value = row.name?row.name:""
// 使 reduce
dynamicInfo.value = Object.keys(row).reduce((acc, key) => {
let name = "";
let value = row[key];
if (props.dynamicInfoFields?.includes(key)) {
props.allSchemas?.tableColumns?.find((item) => {
if (item.field == key) {
name = item.label;
}
});
}
if (name) {
acc[name] = value!=undefined&&value!=null&&value!=""?value:'undefined'; // 使 item.label row[key]
}
return acc;
}, {});
}
</script> </script>
<style lang="scss"> <style lang="scss">
@ -1197,5 +1251,6 @@ watch(
::v-deep(.label-class-name) { ::v-deep(.label-class-name) {
color: #dedede; color: #dedede;
} }
</style> </style>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

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

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

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

@ -13,82 +13,86 @@
@click="handleDeleteTable(row, $index)" @click="handleDeleteTable(row, $index)"
/> />
</el-table-column> </el-table-column>
<el-table-column :label="tableFields[0].label" align="center"> <el-table-column :label="tableFields[0].label" align="center" v-slot="{ row, $index }">
<template v-slot="{ row }"> <el-form :key="'类型form'+$index"
<el-form
ref="TableBaseForm_Ref" ref="TableBaseForm_Ref"
:model="row" :model="row"
style="width: 100%;" style="width: 100%;"
:rules="tableFormRules" :rules="tableFormRules"
:class="tableFormRules ? '' : 'noRulesForm'"> :class="tableFormRules ? '' : 'noRulesForm'">
<el-form-item :prop="tableFields[0].field"> <el-form-item :key="'类型formitem'+$index" :prop="tableFields[0].field">
<el-select :key="row.id+$index" <el-select :key="'类型select'+row.id+$index"
v-model="row.type" v-model="row.type"
:placeholder="tableFields[0].placeholder || '请输入' + tableFields[0].label" :placeholder="tableFields[0].placeholder || '请输入' + tableFields[0].label"
@change="tableFormChange(tableFields[0].field, $event, row)" @change="tableFormChange(tableFields[0].field, $event, row)"
> >
<el-option <el-option
v-for="dict in countScopeType" v-for="dict in countScopeType"
:key="dict.value" :key="'类型option'+dict.value"
:label="dict.label" :label="dict.label"
:value="dict.value" :value="dict.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:prop="tableFields[1].field" :prop="tableFields[1].field"
:label="tableFields[1].label" :label="tableFields[1].label"
align="center" align="center" v-slot="{ row, $index }"
> >
<template v-slot="{ row }"> <el-form :key="'值form'+$index"
<el-form
ref="TableBaseForm_Ref1" ref="TableBaseForm_Ref1"
:model="row" :model="row"
style="width: 100%;" style="width: 100%;"
:rules="tableFormRules" :rules="tableFormRules"
:class="tableFormRules ? '' : 'noRulesForm'"> :class="tableFormRules ? '' : 'noRulesForm'">
<el-form-item :prop="tableFields[1].field"> <el-form-item :key="'值formitem'+$index" :prop="tableFields[1].field">
<el-select :key="row.id+$index" <el-select :key="'值select'+row.id+$index"
v-model="row.value" v-model="row.value"
:placeholder=" :placeholder="
tableFields[1].placeholder || tableFields[1].placeholder ||
'请输入' + tableFields[1].label '请输入' + tableFields[1].label
" "
v-if=" filterable
row.type == 'OWNER' || :filter-method="(value) =>filterMethod(value,row)"
row.type == 'SUPPLIER' || @focus="focusValue(row)"
row.type == 'CUSTOMER' || v-if="
row.type == 'ABC' || row.type == 'OWNER' ||
row.type == 'ITEMS_TYPE' || row.type == 'SUPPLIER' ||
row.type == 'ITEMS_GROUP' || row.type == 'CUSTOMER' ||
row.type == 'ITEMS_CODE' || row.type == 'ABC' ||
row.type == 'WAREHOUSE_CODE' || row.type == 'ITEMS_TYPE' ||
row.type == 'AREABASIC_CODE' || row.type == 'ITEMS_GROUP' ||
row.type == 'LOCATIONGROUP_CODE' || row.type == 'ITEMS_CODE' ||
row.type == 'LOCATION_CODE' row.type == 'WAREHOUSE_CODE' ||
" row.type == 'AREABASIC_CODE' ||
> row.type == 'LOCATIONGROUP_CODE' ||
<el-option row.type == 'LOCATION_CODE'
v-for="item in row.initOptions" "
:key="item.value" >
:label="item.label" <el-option
:value="item.value" 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-form-item>
<el-input
v-model="row.value"
:placeholder="
tableFields[1].placeholder ||
'请输入' + tableFields[1].label
"
v-else
/>
</el-form-item>
</el-form> </el-form>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="button flex"> <div class="button flex">
@ -127,7 +131,7 @@ const props = defineProps({
countScopeType: { countScopeType: {
type: Array, type: Array,
required: false, required: false,
default: null default: []
}, },
}) })
const tableData = props.tableData const tableData = props.tableData
@ -162,6 +166,7 @@ const selectChange = (field, val) => {
} }
const tableFormChange = (field, val, row) => { const tableFormChange = (field, val, row) => {
pageCount.value = 1
emit('tableFormChange', field, val, row) emit('tableFormChange', field, val, row)
} }
// //
@ -172,6 +177,38 @@ const handleAddTable = () => {
const handleDeleteTable = (row, index) => { const handleDeleteTable = (row, index) => {
emit('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 // setup
defineExpose({ defineExpose({
TableBaseComponents_Ref, TableBaseComponents_Ref,

105
src/components/rowDrop/index.vue

@ -47,11 +47,14 @@ const allData = ref([]) // 字段设置列表展现字段 除操作外
const checkedDataList = ref([]) const checkedDataList = ref([])
const checkAll = ref(true) const checkAll = ref(true)
const handlecheckallchange = (val: boolean) => { const handlecheckallchange = (val: boolean) => {
// console.log('handlecheckallchange',val)
checkedDataList.value = val ? allData.value : [] checkedDataList.value = val ? allData.value : []
isIndeterminate.value = false isIndeterminate.value = false
save() save()
} }
const handlecheckedchange = (value: string[]) => { const handlecheckedchange = (value: string[]) => {
// console.log('handlecheckedchange',value)
// console.log('allData',allData.value)
const checkedCount = value.length const checkedCount = value.length
checkAll.value = checkedCount === allData.value.length checkAll.value = checkedCount === allData.value.length
isIndeterminate.value = checkedCount > 0 && checkedCount < allData.value.length isIndeterminate.value = checkedCount > 0 && checkedCount < allData.value.length
@ -80,42 +83,43 @@ const closeRowDrop = () => {
// //
const save = () => { const save = () => {
let saveDate:any[] = []
// //
let myTableColumns = props.allSchemas.tableColumns let myTableColumns = props.allSchemas.tableColumns
if(props.detailAllSchemas){ if(props.detailAllSchemas){
myTableColumns = [...props.allSchemas?.tableColumns,...props.detailAllSchemas?.tableMainColumns] myTableColumns = [...props.allSchemas?.tableColumns,...props.detailAllSchemas?.tableMainColumns]
} }
let actionData = myTableColumns.find(item=>item.field=='action') // console.log('myTableColumns',myTableColumns)
if(actionData){ // console.log('checkedDataList',checkedDataList)
myTableColumns.splice(myTableColumns[actionData],1) // console.log('allData',allData.value)
myTableColumns = [...myTableColumns,actionData]
} let leftArr = []
if(props.allSchemas?.tableColumns[0].fixed=='left'){ let rightArr = []
saveDate.push(props.allSchemas?.tableColumns[0]) myTableColumns.forEach(item=>{
} if(item.fixed=='left'){
allData.value.forEach((item) => { leftArr.push(item)
const _item:any = myTableColumns.find(itemColumns => (itemColumns.label == item )) }else if(item.fixed=='right'){
if(_item){ rightArr.push(item)
_item.isTable = false
if (checkedDataList.value.indexOf(_item.label) > -1) {
_item.isTable = true
saveDate.push(_item)
}
} }
}) })
// let saveDate:any[] = [...leftArr]
if(actionData&&!saveDate.includes(actionData)){ allData.value.forEach(itemLabel=>{
saveDate.push(actionData) const _item:any = myTableColumns.find(itemColumns => (itemColumns.label == itemLabel ))
} if(_item){
_item.isTable = checkedDataList.value.find(checkedLabel => checkedLabel==itemLabel)?true:false
if(_item.isTable){
saveDate.push(_item)
}
}
})
saveDate = [...saveDate,...rightArr]
updataTableColumns(saveDate) updataTableColumns(saveDate)
console.log(99, saveDate)
let paramsData = saveDate.map(item=>({ let paramsData = saveDate.map(item=>({
label:item.label, label:item.label,
fixed:item.fixed, fixed:item.fixed,
field:item.field field:item.field,
isTable:item.isTable
})) }))
// console.log('paramsData',paramsData)
RedisApi.addRedis({key: routeName.value,value: JSON.stringify(paramsData)}).then(() => { RedisApi.addRedis({key: routeName.value,value: JSON.stringify(paramsData)}).then(() => {
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
@ -147,46 +151,41 @@ const dragover = (e) => {
// //
const initSelectSta = () => { const initSelectSta = () => {
RedisApi.getRedis(routeName.value).then(res => { RedisApi.getRedis(routeName.value).then(res => {
let myTableColumns = [...props.allSchemas?.tableColumns]
let _myTableColumns = [...props.allSchemas?.tableColumns]
if(props.detailAllSchemas){ if(props.detailAllSchemas){
_myTableColumns = [...props.allSchemas?.tableColumns,...props.detailAllSchemas?.tableMainColumns] myTableColumns = [...props.allSchemas?.tableColumns,...props.detailAllSchemas?.tableMainColumns]
} }
updateSort(_myTableColumns) let leftArr = []
let rightArr = []
myTableColumns.forEach(item=>{
if(item.fixed=='left'){
leftArr.push(item)
}else if(item.fixed=='right'){
rightArr.push(item)
}
})
updateSort(myTableColumns)
// //
if (res) { if (res) {
checkedDataList.value = [] checkedDataList.value = []
allData.value = [] allData.value = []
// //
const _showTableColumns = [] const _showTableColumns = [...leftArr]
_showTableColumns.push(_myTableColumns[0])
// //
JSON.parse(res).forEach((item, index) => { JSON.parse(res).forEach((item, index) => {
// //
// //
if (!item.fixed) { if (!item.fixed) {
if (item.field != 'action') { if (item.isTable) {
checkedDataList.value.push(item.label) checkedDataList.value.push(item.label)
_showTableColumns.push(_myTableColumns.find(myItem => (myItem.label == item.label)))
allData.value.push(t(`ts.${item.label}`).replace('ts.',''))
} }
let itemColumn = myTableColumns.find(myItem => (myItem.label == item.label))
itemColumn.isTable = item.isTable
_showTableColumns.push(itemColumn)
allData.value.push(t(`ts.${item.label}`).replace('ts.',''))
} }
}) })
_showTableColumns = [..._showTableColumns,...rightArr]
//
_myTableColumns?.forEach((myTableItem, index) => {
//
//
if (!myTableItem.fixed) {
if (myTableItem.field != 'action') {
if (allData.value.indexOf(myTableItem.label) == -1) {
allData.value.push(t(`ts.${myTableItem.label}`).replace('ts.',''))
}
}
}
})
_showTableColumns.push(_myTableColumns[_myTableColumns.length-1])
if(checkedDataList.value.length>0){ if(checkedDataList.value.length>0){
if(allData.value?.length != checkedDataList.value.length){ if(allData.value?.length != checkedDataList.value.length){
isIndeterminate.value = true isIndeterminate.value = true
@ -204,18 +203,16 @@ const initSelectSta = () => {
} else { // } else { //
checkedDataList.value = [] checkedDataList.value = []
allData.value = [] allData.value = []
_myTableColumns?.forEach((item, index) => { myTableColumns?.forEach((item, index) => {
// //
// //
if (!item.fixed) { if (!item.fixed) {
if (item.field != 'action') { checkedDataList.value.push(item.label)
checkedDataList.value.push(item.label) allData.value.push(t(`ts.${item.label}`).replace('ts.',''))
allData.value.push(t(`ts.${item.label}`).replace('ts.',''))
}
} }
}) })
checkAll.value = true checkAll.value = true
updataTableColumns(_myTableColumns) updataTableColumns(myTableColumns)
} }
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)

2
src/config/axios/config.ts

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

3
src/hooks/web/useMessage.ts

@ -62,9 +62,10 @@ export const useMessage = () => {
// 验证窗体 // 验证窗体
confirmPassword(content: string, tip?: string) { confirmPassword(content: string, tip?: string) {
return ElMessageBox.confirm(content, tip ? tip : t('common.confirmTitle'), { return ElMessageBox.confirm(content, tip ? tip : t('common.confirmTitle'), {
distinguishCancelAndClose: true,
confirmButtonText: t('验证通过'), confirmButtonText: t('验证通过'),
cancelButtonText: t('验证不通过'), cancelButtonText: t('验证不通过'),
type: 'warning' type: 'warning',
}) })
}, },
// 审核窗体 // 审核窗体

8
src/utils/dict.ts

@ -354,12 +354,16 @@ export enum DICT_TYPE {
REPAIR_LEVEL = 'repair_level', //维修级别 REPAIR_LEVEL = 'repair_level', //维修级别
IS_COMPLETED = 'is_completed', //是否完成 IS_COMPLETED = 'is_completed', //是否完成
MAINTENANCE_CYCLE ='maintenance_cycle', // 保养周期 MAINTENANCE_CYCLE ='maintenance_cycle', // 保养周期
EAM_ORDER_STATUS = 'eam_order_status',// 保养工单状态 EAM_ORDER_STATUS = 'eam_order_status',// 工单状态
TOOL_CLASS = 'tool_class', //工装类型
TOOL_OUT_TYPE = 'tool_out_type', //工装出库类型
EAM_PLAN_STATUS = 'eam_plan_status', // 保养计划状态 EAM_PLAN_STATUS = 'eam_plan_status', // 保养计划状态
EAM_REPAIR_REPORT_STATUS = 'eam_repair_report_status', // 报修状态 EAM_REPAIR_REPORT_STATUS = 'eam_repair_report_status', // 报修状态
EAM_MAINTENANCE_SOURCES = 'eam_maintenance_sources', // 维保数据来源 EAM_MAINTENANCE_SOURCES = 'eam_maintenance_sources', // 维保数据来源
EAM_MAINTENANCE_URGENCY = 'eam_maintenance_urgency', // 维保紧急程度 EAM_MAINTENANCE_URGENCY = 'eam_maintenance_urgency', // 维保紧急程度
EAM_MAINTENANCE_LEVEL = 'eam_maintenance_level', // 维保维修级别 EAM_MAINTENANCE_LEVEL = 'eam_maintenance_level', // 维保维修级别
EAM_REPAIR_STATUS = 'eam_repair_status', // 维修状态 EAM_REPAIR_STATUS = 'eam_repair_status', // 维修状态
OFF_BACK_STATUS = 'off_back_status' OFF_BACK_STATUS = 'off_back_status',
SPAREPARTS_APPLY_STATUS_ENUM = 'spareparts_apply_status_enum',// 流程状态
IS_LINE_ITEM = 'is_line_item', // 是否是线边
} }

26
src/utils/disposition/defaultButtons.ts

@ -415,6 +415,32 @@ export function mainListValidateBtn(option:any) {
}) })
} }
// 主列表-报修验证按钮
export function mainListValidateReportBtn(option:any) {
return __defaultBtnOption(option,{
label: t(`ts.报修验证`).replace('ts.', ''),
name: 'validate_report',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-维修验证按钮
export function mainListValidateRepairBtn(option:any) {
return __defaultBtnOption(option,{
label: t(`ts.维修验证`).replace('ts.', ''),
name: 'validate_repair',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-审核按钮 // 主列表-审核按钮
export function mainListAuditingBtn(option:any) { export function mainListAuditingBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{

189
src/views/eam/adjustRecord/adjustRecord.data.ts

@ -0,0 +1,189 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const Rules = reactive({
number: [required],
planNumber: [required],
})
export const AdjustRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '调整编号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '计划编号',
field: 'planNumber',
sort: 'custom',
isSearch: true,
},
{
label: '任务编号',
field: 'jobNumber',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
//表单校验
export const AdjustRecordMainRules = reactive({
name: [
{ required: true, message: '请填写描述', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
})
/**
* @returns {Array}
*/
export const AdjustRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '任务编号',
field: 'number',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
},
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
},
{
label: '库区编号',
field: 'areaNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
},
{
label: '库存数量',
field: 'qty',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '盘点数量',
field: 'countQty',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '差异数量',
field: 'differenceQty',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
}
]))
//表单校验
export const AdjustRecordDetailRules = reactive({
lineNumber: [
{ required: true, message: '请输入行号', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
stdPackQty: [
{ required: true, message: '请输入标包数量', trigger: 'blur' }
],
})

322
src/views/eam/adjustRecord/index.vue

@ -0,0 +1,322 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="AdjustRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="AdjustRecordMain.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="AdjustRecordMainRules" :formAllSchemas="AdjustRecordMain.allSchemas"
:tableAllSchemas="AdjustRecordDetail.allSchemas" :tableFormRules="AdjustRecordDetailRules" :tableData="tableData"
:apiUpdate="AdjustRecordMainApi.updateAdjustRecordMain" :apiCreate="AdjustRecordMainApi.createAdjustRecordMain"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="AdjustRecordMain.allSchemas"
:detailAllSchemas="AdjustRecordDetail.allSchemas" :detailAllSchemasRules="AdjustRecordDetailRules"
:apiCreate="AdjustRecordDetailApi.createAdjustRecordDetail" :apiUpdate="AdjustRecordDetailApi.updateAdjustRecordDetail"
:apiPage="AdjustRecordDetailApi.getAdjustRecordDetailPage" :apiDelete="AdjustRecordDetailApi.deleteAdjustRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"/>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/adjustRecordDetail/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { AdjustRecordMain, AdjustRecordMainRules, AdjustRecordDetail, AdjustRecordDetailRules } from './adjustRecord.data'
import * as AdjustRecordMainApi from '@/api/eam/adjustRecordMain'
import * as AdjustRecordDetailApi from '@/api/eam/adjustRecordDetail'
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: 'AdjustRecord' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(AdjustRecordMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number']
row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const 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: AdjustRecordMainApi.getAdjustRecordMainPage //
})
//
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, 'basicAdjustRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await AdjustRecordMainApi.deleteAdjustRecordMain(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 AdjustRecordMainApi.exportAdjustRecordMain(id)
download.excel(data, '盘点工单.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 关闭按钮操作 */
const handleClose = async (id : number) => {
try {
//
await message.confirm('是否关闭所选中数据?')
//
await AdjustRecordMainApi.closeAdjustRecordMain(id)
message.success(t('关闭成功!'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await AdjustRecordMainApi.exportAdjustRecordMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
AdjustRecordDetail.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 AdjustRecordMainApi.createAdjustRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await AdjustRecordMainApi.updateAdjustRecordMain(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 AdjustRecordMainApi.importTemplate()
})
</script>

329
src/views/eam/applicationRecord/applicationRecordMain.data.ts

@ -0,0 +1,329 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/itemAccounts'
// import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import { validateHanset, validateEmail } from '@/utils/validator'
const { t } = useI18n() // 国际化
/**
* @returns {Array}
*/
export const ApplicationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '领用编号',
field: 'number',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '申领人',
field: 'applyId',
sort: 'custom',
isForm: false,
isSearch: false,
},
{
label: '审批人',
field: 'approveId',
sort: 'custom',
isForm: false,
isSearch: false,
},
{
label: '出库人',
field: 'outId',
sort: 'custom',
isForm: false,
isSearch: false,
},
{
label: '描述',
field: 'name',
sort: 'custom',
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.ITEM_APPLY_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))
//表单校验
export const ApplicationRecordMainRules = reactive({
name: [
{ required: true, message: '请填写描述', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
})
export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
field: 'number',
sort: 'custom',
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',
field: 'name',
sort: 'custom',
},
{
label: '规格型号',
field: 'specification',
sort: 'custom',
},
]))
/**
* @returns {Array}
*/
export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号',
searchField: 'number',
searchTitle: '库区信息',
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
},
},
{
label: '类型',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: false
}
},
// {
// label: '设备/模具编号',
// field: 'deviceNumber',
// sort: 'custom',
// isSearch: true,
// tableForm: {
// isInpuFocusShow: true,
// searchListPlaceholder: '请选择单号',
// searchField: 'number',
// searchTitle: '单号信息',
// searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
// searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'available',
// value: "TRUE",
// isMainValue: false
// }, {
// key: 'type',
// value: "type",
// isMainValue: true
// }
// ]
// },
// },
{
label: '申领数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '库存数量',
field: 'currentQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '是否以旧换新',
field: 'isRadeIn',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '备注',
field: 'remark',
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
}
]))
//表单校验
export const ApplicationRecordDetailRules = reactive({
lineNumber: [
{ required: true, message: '请输入行号', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
stdPackQty: [
{ required: true, message: '请输入标包数量', trigger: 'blur' }
],
stdPackUnit: [
{ required: true, message: '请选择标包单位', trigger: 'change' }
],
convertRate: [
{ required: true, message: '请输入转换率', trigger: 'blur' }
],
taxRate: [
{ required: true, message: '请输入税率', trigger: 'blur' }
],
shippedQty: [
{ required: true, message: '请输入已发货数量', trigger: 'blur' }
],
receivedQty: [
{ required: true, message: '请输入已收货数量', trigger: 'blur' }
],
returnedQty: [
{ required: true, message: '请输入已退货数量', trigger: 'blur' }
],
putawayQty: [
{ required: true, message: '请输入已上架数量', trigger: 'blur' }
],
overReceivingPercent: [
{ required: true, message: '请输入超收百分比', trigger: 'blur' }
],
orderQty: [
{ required: true, message: '请输入订单数量', trigger: 'blur' }
],
uom: [
{ required: true, message: '请选择计量单位', trigger: 'change' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
nuumber: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物品代码', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})

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

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

242
src/views/eam/countRecord/countRecord.data.ts

@ -0,0 +1,242 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator'
const { t } = useI18n() // 国际化
/**
* @returns {Array}
*/
export const CountRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '任务编号',
field: 'number',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '工单编号',
field: 'jobNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '计划编号',
field: 'requestNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',
field: 'name',
sort: 'custom',
isForm: false,
isSearch: false,
},
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.ADJUST_STATUS,
dictClass: 'string',
isTable: true,
isForm: true,
tableForm: {
type: 'Select'
}
},
{
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,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))
//表单校验
export const CountRecordMainRules = reactive({
name: [
{ required: true, message: '请填写描述', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
})
/**
* @returns {Array}
*/
export const CountRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '任务编号',
field: 'number',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
},
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
},
{
label: '库区编号',
field: 'areaNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
},
{
label: '库存数量',
field: 'qty',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '盘点数量',
field: 'countQty',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '差异数量',
field: 'differenceQty',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
}
]))
//表单校验
export const CountRecordDetailRules = reactive({
lineNumber: [
{ required: true, message: '请输入行号', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
stdPackQty: [
{ required: true, message: '请输入标包数量', trigger: 'blur' }
],
})

339
src/views/eam/countRecord/index.vue

@ -0,0 +1,339 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CountRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="CountRecordMain.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="CountRecordMainRules" :formAllSchemas="CountRecordMain.allSchemas"
:tableAllSchemas="CountRecordDetail.allSchemas" :tableFormRules="CountRecordDetailRules" :tableData="tableData"
:apiUpdate="CountRecordMainApi.updateCountRecordMain" :apiCreate="CountRecordMainApi.createCountRecordMain"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="CountRecordMain.allSchemas"
:detailAllSchemas="CountRecordDetail.allSchemas" :detailAllSchemasRules="CountRecordDetailRules"
:apiCreate="CountRecordDetailApi.createCountRecordDetail" :apiUpdate="CountRecordDetailApi.updateCountRecordDetail"
:apiPage="CountRecordDetailApi.getCountRecordDetailPage" :apiDelete="CountRecordDetailApi.deleteCountRecordDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"/>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/countRecordDetail/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CountRecordMain, CountRecordMainRules, CountRecordDetail, CountRecordDetailRules } from './countRecord.data'
import * as CountRecordMainApi from '@/api/eam/countRecordMain'
import * as CountRecordDetailApi from '@/api/eam/countRecordDetail'
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: 'CountRecord' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CountRecordMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number']
row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const 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: CountRecordMainApi.getCountRecordMainPage //
})
//
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.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainAdjust({ hide: isShowMainButton(row, ['CANGENERATE']),hasPermi:'item:countRecord:adjust' }),//
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
}
else if (val == 'mainAdjust') { //
handleMainAdjust(row.number)
}
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, 'basicCountRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await CountRecordMainApi.deleteCountRecordMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 盘点调整按钮操作 */
const handleMainAdjust = async (id : number) => {
try {
//
await message.confirm('是否确认盘点调整?')
//
await CountRecordMainApi.adjustCountRecordMain(id)
message.success(t('盘点调整成功!'))
//
await getList()
} catch { }
}
/** 列表导出按钮操作 */
const exportLoading = ref(false) //
const handleMainExport = async (id : number) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CountRecordMainApi.handleMainExport(id)
download.excel(data, '盘点工单.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 关闭按钮操作 */
const handleClose = async (id : number) => {
try {
//
await message.confirm('是否关闭所选中数据?')
//
await CountRecordMainApi.closeCountRecordMain(id)
message.success(t('关闭成功!'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CountRecordMainApi.exportCountRecordMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
CountRecordDetail.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 CountRecordMainApi.createCountRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await CountRecordMainApi.updateCountRecordMain(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 CountRecordMainApi.importTemplate()
})
</script>

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

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

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

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CountadjustPlan.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CountadjustPlan.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="CountadjustPlanRules"
:formAllSchemas="CountadjustPlan.allSchemas"
:apiUpdate="CountadjustPlanApi.updateCountadjustPlan"
:apiCreate="CountadjustPlanApi.createCountadjustPlan"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="CountadjustPlan.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/plan/countadjust-plan/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CountadjustPlan,CountadjustPlanRules } from './countadjustPlan.data'
import * as CountadjustPlanApi from '@/api/eam/countadjustPlan'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'CountadjustPlan' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CountadjustPlan.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: CountadjustPlanApi.getCountadjustPlanPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'item:countadjustPlan:create'}), //
// 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 butttondata = [
// defaultButtons.mainListEditBtn({hasPermi:'eam:countadjustPlan:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:countadjustPlan:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =CountadjustPlan.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 CountadjustPlanApi.createCountadjustPlan(data)
message.success(t('common.createSuccess'))
} else {
await CountadjustPlanApi.updateCountadjustPlan(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, 'basicCountadjustPlan')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await CountadjustPlanApi.deleteCountadjustPlan(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 CountadjustPlanApi.exportCountadjustPlan(tableObject.params)
download.excel(data, '备件盘点计划.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件盘点计划导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await CountadjustPlanApi.importTemplate()
})
</script>

156
src/views/eam/countadjustWork/countadjustWork.data.ts

@ -0,0 +1,156 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator'
const { t } = useI18n() // 国际化
/**
* @returns {Array}
*/
export const CountJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '计划编号',
field: 'number',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '工单编号',
field: 'jobNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
},
{
label: '名称',
field: 'name',
sort: 'custom',
isForm: false,
isSearch: false,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))
//表单校验
export const CountJobMainRules = reactive({
name: [
{ required: true, message: '请填写描述', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
})
/**
* @returns {Array}
*/
export const CountJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '工单编号',
field: 'number',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
},
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
},
{
label: '库区编号',
field: 'areaNumber',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
},
{
label: '库存数量',
field: 'qty',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 180,
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 2
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 2
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
}
]))
//表单校验
export const CountJobDetailRules = reactive({
lineNumber: [
{ required: true, message: '请输入行号', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
stdPackQty: [
{ required: true, message: '请输入标包数量', trigger: 'blur' }
],
})

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

@ -0,0 +1,306 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CountJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick" :allSchemas="CountJobMain.allSchemas" />
<!-- 列表 -->
<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="CountJobMainRules" :formAllSchemas="CountJobMain.allSchemas"
:tableAllSchemas="CountJobDetail.allSchemas" :tableFormRules="CountJobDetailRules" :tableData="tableData"
:apiUpdate="CountJobMainApi.updateCountJobMain" :apiCreate="CountJobMainApi.createCountJobMain" :isBusiness="true"
@handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="CountJobMain.allSchemas"
:detailAllSchemas="CountJobDetail.allSchemas" :detailAllSchemasRules="CountJobDetailRules"
:apiCreate="CountJobDetailApi.createCountJobDetail" :apiUpdate="CountJobDetailApi.updateCountJobDetail"
:apiPage="CountJobDetailApi.getCountJobDetailPage" :apiDelete="CountJobDetailApi.deleteCountJobDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/countJobDetail/import" :importTemplateData="importTemplateData"
@success="importSuccess" :isShow="false"/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CountJobMain, CountJobMainRules, CountJobDetail, CountJobDetailRules } from './countadjustWork.data'
import * as CountJobMainApi from '@/api/eam/countJobMain'
import * as CountJobDetailApi from '@/api/eam/countJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
//
defineOptions({ name: 'CountadjustWork' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CountJobMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number']
row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const 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: CountJobMainApi.getCountJobMainPage //
})
//
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.mainExport({hasPermi:'item:countadjustWork:export'}),//
defaultButtons.mainAdjustImport({hasPermi:'item:countadjustWork:import'}),//
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
}
else if (val == 'mainExport') { //
handleMainExport(row.id)
}
else if (val == 'mainAdjustImport') { //
handleImport()
}
else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = async (type : string, row ?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row : any, titleName : any, titleValue : any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicCountJobMain')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await CountJobMainApi.deleteCountJobMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 列表导出按钮操作 */
const exportLoading = ref(false) //
const handleMainExport = async (id : number) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CountJobMainApi.handleMainExport(id)
download.excel(data, '盘点工单.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await CountJobMainApi.exportCountJobMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
CountJobDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await CountJobMainApi.createCountJobMain(data)
message.success(t('common.createSuccess'))
} else {
await CountJobMainApi.updateCountJobMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const 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 CountJobMainApi.importTemplate()
})
</script>

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

@ -9,10 +9,19 @@ import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier'
import { EquipmentManufacturer } from '@/views/eam/equipmentManufacturer/equipmentManufacturer.data' import { EquipmentManufacturer } from '@/views/eam/equipmentManufacturer/equipmentManufacturer.data'
import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer' import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer'
import * as ConfigApi from '@/api/infra/config' import * as ConfigApi from '@/api/infra/config'
import * as ProductionlineApi from '@/api/wms/productionline'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as ProcessApi from '@/api/wms/process'
import { Process } from '@/views/wms/basicDataManage/factoryModeling/process/process.data'
import * as WorkStationApi from '@/api/wms/workstation'
import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data'
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({}) const workshopNoPage = await WorkshopApi.getWorkshopNoPage({})
const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({}) const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({})
const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({}) const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({})
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({});
const autoCodeSwitch = await ConfigApi.getConfigKey('deviceCodeAutoSwitch') const autoCodeSwitch = await ConfigApi.getConfigKey('deviceCodeAutoSwitch')
// ProductionlineApi.getProductionlinePage
const autoSwitch = ref(false) const autoSwitch = ref(false)
if (autoCodeSwitch == 'TRUE') { if (autoCodeSwitch == 'TRUE') {
autoSwitch.value = true autoSwitch.value = true
@ -29,6 +38,7 @@ export const EquipmentAccountsRules = reactive({
power: [ power: [
{ validator:validateNum, message: '输入功率格式不正确', trigger: 'blur'} { validator:validateNum, message: '输入功率格式不正确', trigger: 'blur'}
], ],
workshopName: [required]
}) })
export const EquipmentAccounts = useCrudSchemas(reactive<CrudSchema[]>([ export const EquipmentAccounts = useCrudSchemas(reactive<CrudSchema[]>([
@ -164,7 +174,7 @@ export const EquipmentAccounts = useCrudSchemas(reactive<CrudSchema[]>([
filterable: true, filterable: true,
} }
}, },
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: string) => {
return equipmentSupplierNoPage.find((item) => item.number == cellValue)?.name return equipmentSupplierNoPage.find((item) => item.number == cellValue)?.name
}, },
}, },
@ -173,6 +183,7 @@ export const EquipmentAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'supplierName', field: 'supplierName',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: false,
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
@ -265,7 +276,7 @@ export const EquipmentAccounts = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: string) => {
return equipmentManufacturerNoPage.find((item) => item.number == cellValue)?.name return equipmentManufacturerNoPage.find((item) => item.number == cellValue)?.name
}, },
}, },
@ -274,6 +285,7 @@ export const EquipmentAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'manufactureName', field: 'manufactureName',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isTable: false,
form: { form: {
componentProps: { componentProps: {
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
@ -371,17 +383,243 @@ export const EquipmentAccounts = useCrudSchemas(reactive<CrudSchema[]>([
}, },
}, },
{ {
label: '工段编号', label: '产线编号',
field: 'workshopSectionCode', field: 'lineCode',
sort: 'custom', sort: 'custom',
isSearch: false isSearch: true,
isDetail: false,
isForm: false,
isTable: true,
isTableForm: false,
search: {
component: 'Select',
componentProps: {
options: productionlineNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'code'
},
filterable: true,
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: string) => {
return productionlineNoPage.find((item) => item.code == cellValue)?.name
},
},
{
label: '产线编号',
field: 'lineName',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
multiple:true,
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition: [{
key:'workshopCode',
value:'workshopCode',
message: '请填写车间代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}, },
// {
// label: '工序编号',
// field: 'processCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择工序代码',
// searchField: 'code',
// searchTitle: '工序信息',
// searchAllSchemas: Process.allSchemas,
// searchPage: ProcessApi.getProcessPage,
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// },
// },
// {
// label: '工位编号',
// field: 'workstationCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择工位', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '工位信息', // 查询弹窗标题
// searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
// searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key:'available',
// value:'TRUE',
// isMainValue: false
// }]
// }
// },
// },
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true
}, },
{
label: '平均故障间隔时间',
field: 'purchaseInterval',
sort: 'custom',
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: false,
},
{
label: '总运行时长',
field: 'totalRunningTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: 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: 'maintenanceRunningTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: 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: 'usageTimes',
sort: 'custom',
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: false,
},
{
label: '上一次检验日期',
field: 'lastInspectionDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: 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: 'outageRate',
sort: 'custom',
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: false,
},
{
label: '平均故障恢复时间',
field: 'breakdownRecover',
sort: 'custom',
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: false,
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',

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

@ -62,14 +62,15 @@
:apiPage="apiPage" :apiPage="apiPage"
:dialogApiPage="dialogApiPage" :dialogApiPage="dialogApiPage"
:dialogAllSchemas="dialogAllSchemas" :dialogAllSchemas="dialogAllSchemas"
funcCode="device_mould_picture" :dynamicInfoFields="dynamicInfoFields"
funcCode="device_mould_file"
/> />
<!-- 主要部件 --> <!-- 主要部件 -->
<SearchTable ref="searchTableRef" @searchTableSuccess="submitEquipmentMainPartRelation" /> <SearchTable ref="searchTableRef" @searchTableSuccess="submitEquipmentMainPartRelation" />
<!-- 备件 --> <!-- 备件 -->
<SearchTable ref="searchSparePartTableRef" @searchTableSuccess="submitSparePartRelation" /> <SearchTable ref="searchSparePartTableRef" @searchTableSuccess="submitSparePartRelation" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/eam/device/equipment-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -106,6 +107,10 @@ import { EquipmentMaintenanceRecordMain,EquipmentMaintenanceRecordMainRules } fr
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain' import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain'
import { EquipmentMaintenanceRecordDetail,EquipmentMaintenanceRecordDetailRules } from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data' import { EquipmentMaintenanceRecordDetail,EquipmentMaintenanceRecordDetailRules } from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data'
import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail' import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail'
import * as WorkshopApi from '@/api/wms/workshop'
import * as ProductionlineApi from '@/api/wms/productionline'
import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier'
import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer'
defineOptions({ name: 'EquipmentAccounts' }) defineOptions({ name: 'EquipmentAccounts' })
@ -129,6 +134,19 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if(formField == 'workshopName'){
setV['workshopCode'] = val[0]['code']
setV['workshopName'] = val[0]['name']
}else if(formField == 'lineName'){
setV['lineCode'] = val[0]['code']
setV['lineName'] = val[0]['name']
}else if(formField == 'manufactureName'){
setV['manufactureCode'] = val[0]['number']
setV['manufactureName'] = val[0]['name']
}else if(formField == 'supplierName'){
setV['supplierCode'] = val[0]['number']
setV['supplierName'] = val[0]['name']
}
formRef.setValues(setV) formRef.setValues(setV)
}) })
} }
@ -142,6 +160,17 @@ const operationRecordList = ref([
]) ])
const dynamicInfoFields = ref([
"totalRunningTime",
"maintenanceRunningTime",
"usageTimes",
"lastInspectionDate",
"outageRate",
"breakdownRecover",
"purchaseInterval"
]);
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -211,7 +240,17 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = async (type: string, row?: any) => {
if(type == 'update'){
const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({})
const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({})
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({})
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({});
row.workshopName = workshopNoPage?.find(item=>item.code == row.workshopCode)?.name
row.lineName = productionlineNoPage?.find(item=>item.code == row.lineCode)?.name
row.manufactureName = equipmentManufacturerNoPage?.find(item=>item.number == row.manufactureCode)?.name
row.supplierName = equipmentSupplierNoPage?.find(item=>item.number == row.supplierCode)?.name
}
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
@ -242,7 +281,6 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = async (row: any, titleName: any, titleValue: any) => { const openDetail = async (row: any, titleName: any, titleValue: any) => {
// subTabList.value = await
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentAccounts') detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentAccounts')
} }
@ -306,8 +344,8 @@ const searchTableSelections = ref([])
const searchTableSparePartSelections = ref([]) const searchTableSparePartSelections = ref([])
const syncData = async (row) => { const syncData = async (row) => {
searchTableSparePartSelections.value = [] searchTableSparePartSelections.value = []
await RelationMainPartApi.getRelationMainPartNoPage({ equipmentCode: row.code }).then(async (res) => { await RelationMainPartApi.getRelationMainPartNoPage({ equipmentCode: row.code,type: 'DEVICE' }).then(async (res) => {
await EquipmentMainPartApi.getEquipmentMainPartNoPage({}).then(response => { await EquipmentMainPartApi.getEquipmentMainPartNoPage({type: 'DEVICE' }).then(response => {
searchTableSelections.value = response.filter(element => { searchTableSelections.value = response.filter(element => {
let flag = false; let flag = false;
res.forEach(item => { res.forEach(item => {
@ -322,7 +360,7 @@ const syncData = async (row) => {
}; };
const syncSparePartData = async (row) => { const syncSparePartData = async (row) => {
searchTableSparePartSelections.value = [] searchTableSparePartSelections.value = []
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ equipmentToolCode: row.code }).then(async (res) => { await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ equipmentToolCode: row.code}).then(async (res) => {
await SparePartApi.getSparePartNoPage({}).then(response => { await SparePartApi.getSparePartNoPage({}).then(response => {
searchTableSparePartSelections.value = response.filter(element => { searchTableSparePartSelections.value = response.filter(element => {
let flag = false; let flag = false;
@ -348,7 +386,7 @@ const openComponent = async (row : any) => {
true, true,
null,//type null,//type
row, row,
null, {type: 'DEVICE'},
null, null,
null, null,
null, null,

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

@ -169,8 +169,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */ /** 提交表单 */
const submitForm = async (val) => { const submitForm = async (val) => {
//success
emit('success',formData.value.id)
// //
if (!basicFormRef) return if (!basicFormRef) return
const valid = await basicFormRef.value.validate() const valid = await basicFormRef.value.validate()
@ -178,6 +177,8 @@ const submitForm = async (val) => {
// //
await EquipmentMaintenanceMainApi.updateEquipmentMaintenanceMain(formData.value) await EquipmentMaintenanceMainApi.updateEquipmentMaintenanceMain(formData.value)
//success
emit('success',formData.value.id)
dialogVisible.value = false dialogVisible.value = false
} }

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

@ -363,14 +363,16 @@ const handleValidate = async (row) => {
// //
// //
finishForm1Ref.value.open('update', row); finishForm1Ref.value.open('update', row);
}).catch (async () => { }).catch (async (action: Action) => {
const params = ref({id: '', status:''}) if(action === 'cancel'){
params.value.id = row.id const params = ref({id: '', status:''})
params.value.status = '5' params.value.id = row.id
await EquipmentMaintenanceMainApi.backMaintenanceOrder(params.value) params.value.status = '5'
message.success(t('工单已打回')) await EquipmentMaintenanceMainApi.backMaintenanceOrder(params.value)
// message.success(t('工单已打回'))
await getList() //
await getList()
}
}) })
} }

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

@ -166,20 +166,54 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
}, },
{ {
label: '验证人', label: '维修验证人',
field: 'verifyer', field: 'verifyerRepair',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
}, },
{ {
label: '验证内容', label: '维修验证内容',
field: 'verifyContent', field: 'verifyContentRepair',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
}, },
{ {
label: '验证时间', label: '维修验证时间',
field: 'verifyTime', field: 'verifyTimeRepair',
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: 'verifyerReport',
sort: 'custom',
isSearch: false,
},
{
label: '报修验证内容',
field: 'verifyContentReport',
sort: 'custom',
isSearch: false,
},
{
label: '报修验证时间',
field: 'verifyTimeReport',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, isSearch: false,

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

@ -0,0 +1,211 @@
<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="verifyerRepair">
<el-input v-model="formData.verifyerRepair" placeholder="请输入维修验证人" :disabled="isDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维修验证内容" prop="verifyContentRepair">
<el-input v-model="formData.verifyContentRepair" placeholder="请输入维修验证内容" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="维修验证时间" prop="verifyTimeRepair">
<el-date-picker
v-model="formData.verifyTimeRepair"
type="datetime"
value-format="x"
placeholder="选择维修验证时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')"> </el-button>
<el-button @click="handleClose('close')"> </el-button>
</template>
</Dialog>
<!--添加巡检项弹窗-->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</template>
<script lang="ts" setup>
import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import * as EquipmentRepairJobMainApi from "@/api/eam/equipmentRepairJobMain";
import {updateEquipmentRepairJobMain} from "@/api/eam/equipmentRepairJobMain";
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:'',
verifyerRepair: '',
verifyContentRepair: '',
verifyTimeRepair: '',
})
const formRules = reactive({
verifyerRepair: [
{ required: true, message: '验证人不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyContentRepair: [
{ required: true, message: '验证内容不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyTimeRepair: [
{ required: true, message: '验证时间不能为空', trigger: 'blur' },
],
})
const basicFormRef = ref() // Ref
// /** */
// const searchTableRef = ref();
// const _searchTableTitle = ref();
// const _searchTableAllSchemas = ref();
// const _searchTablePage = ref();
// const _formField = ref();
// const _searchField = ref();
// const _multiple = ref();
// const _type = ref();
// const _row = ref();
// const _searchCondition = ref({})
//
//
// const addItem = () =>{
// addItemCommon(true,'xunJianItem')
// }
//
// /** */
// const addItemCommon = (multiple,field) => {
// _searchCondition.value = {}
// const filters: any[] = []
// filters.push({
// action: "==",
// column: 'available',
// value: 'TRUE'
// })
// //
// _searchCondition.value.isSearch = true
// _searchCondition.value.filters = filters
// _searchTableTitle.value = ''
// _multiple.value = multiple
// _formField.value = field
// _searchField.value = field
// _searchTablePage.value = inspectionItemApi.getInspectionItemPage
// _searchTableAllSchemas.value = InspectionItem.allSchemas
// openCommon()
// }
//
// /** */
// const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
// nextTick?.(() => {
// if (formField === 'xunJianItem') {
// val.forEach(item => {
// const isExist = tags.value.some(tag => tag.content === item.content);
// if (!isExist){
// const newItem = {};
// newItem['content'] = item.content;
// newItem['id'] = item.id;
// tags.value.push(newItem);
// }
// });
// }
// })
// }
// /**/
// const openCommon = () => {
// searchTableRef.value.open(
// _searchTableTitle.value,
// _searchTableAllSchemas.value,
// _searchTablePage.value,
// _formField.value,
// _searchField.value,
// _multiple.value,
// _type.value,
// _row.value,
// _searchCondition.value
// )
// }
/** 初始化弹窗 */
const open = async (type: string, row?: object) => {
dialogVisible.value = true
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 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>

209
src/views/eam/equipmentRepairJobMain/finishForm3.vue

@ -0,0 +1,209 @@
<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="verifyerReport">
<el-input v-model="formData.verifyerReport" placeholder="请输入报修验证人" :disabled="isDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报修验证内容" prop="verifyContentReport">
<el-input v-model="formData.verifyContentReport" placeholder="请输入报修验证内容" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="报修验证时间" prop="verifyTimeReport">
<el-date-picker
v-model="formData.verifyTimeReport"
type="datetime"
value-format="x"
placeholder="选择报修验证时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')"> </el-button>
<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 * as EquipmentRepairJobMainApi from "@/api/eam/equipmentRepairJobMain";
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:'',
verifyerReport: '',
verifyContentReport: '',
verifyTimeReport: '',
})
const formRules = reactive({
verifyerReport: [
{ required: true, message: '验证人不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyContentReport: [
{ required: true, message: '验证内容不能为空', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
verifyTimeReport: [
{ required: true, message: '验证时间不能为空', trigger: 'blur' },
],
})
const basicFormRef = ref() // Ref
// /** */
// const searchTableRef = ref();
// const _searchTableTitle = ref();
// const _searchTableAllSchemas = ref();
// const _searchTablePage = ref();
// const _formField = ref();
// const _searchField = ref();
// const _multiple = ref();
// const _type = ref();
// const _row = ref();
// const _searchCondition = ref({})
//
//
// const addItem = () =>{
// addItemCommon(true,'xunJianItem')
// }
//
// /** */
// const addItemCommon = (multiple,field) => {
// _searchCondition.value = {}
// const filters: any[] = []
// filters.push({
// action: "==",
// column: 'available',
// value: 'TRUE'
// })
// //
// _searchCondition.value.isSearch = true
// _searchCondition.value.filters = filters
// _searchTableTitle.value = ''
// _multiple.value = multiple
// _formField.value = field
// _searchField.value = field
// _searchTablePage.value = inspectionItemApi.getInspectionItemPage
// _searchTableAllSchemas.value = InspectionItem.allSchemas
// openCommon()
// }
//
// /** */
// const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
// nextTick?.(() => {
// if (formField === 'xunJianItem') {
// val.forEach(item => {
// const isExist = tags.value.some(tag => tag.content === item.content);
// if (!isExist){
// const newItem = {};
// newItem['content'] = item.content;
// newItem['id'] = item.id;
// tags.value.push(newItem);
// }
// });
// }
// })
// }
// /**/
// const openCommon = () => {
// searchTableRef.value.open(
// _searchTableTitle.value,
// _searchTableAllSchemas.value,
// _searchTablePage.value,
// _formField.value,
// _searchField.value,
// _multiple.value,
// _type.value,
// _row.value,
// _searchCondition.value
// )
// }
/** 初始化弹窗 */
const open = async (type: string, row?: object) => {
dialogVisible.value = true
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 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>

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

@ -50,7 +50,9 @@
:isBusiness="false" :isBusiness="false"
/> />
<FinishForm1 ref="finishForm1Ref" @success="getData1" @close="getClosed1"/>
<FinishForm2 ref="finishForm2Ref" @success="getData2" @close="getClosed2"/> <FinishForm2 ref="finishForm2Ref" @success="getData2" @close="getClosed2"/>
<FinishForm3 ref="finishForm3Ref" @success="getData3" @close="getClosed3"/>
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" <Detail ref="detailRef"
@ -83,7 +85,10 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail.vue' import Detail from '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail.vue'
import FinishForm1 from '@/views/eam/equipmentRepairJobMain/finishForm1.vue'
import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue' import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue'
import FinishForm3 from '@/views/eam/equipmentRepairJobMain/finishForm3.vue'
import {createEquipmentRepairNewOrder} from "@/api/eam/equipmentRepairJobMain";
defineOptions({ name: 'EquipmentRepairJobMain' }) defineOptions({ name: 'EquipmentRepairJobMain' })
@ -167,6 +172,8 @@ const butttondata = (row) => {
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),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.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), //
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),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'}), //
] ]
} }
@ -182,6 +189,10 @@ const buttonTableClick = async (val, row) => {
handleExecute(row.id) handleExecute(row.id)
} else if (val == 'finish') { // } else if (val == 'finish') { //
handleFinish(row) handleFinish(row)
} else if (val == 'validate_repair') { //
handleValidateRepair(row)
} else if (val == 'validate_report') { //
handleValidateReport(row)
} }
@ -251,6 +262,58 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
}) })
} }
/** 报修验证按钮操作 */
const finishForm3Ref = ref()
const handleValidateReport = async (row) => {
await message.delConfirm('是否验证所选中工单?');
message.confirmPassword(t('')).then(async () => {
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: '', number:''})
params.value.id = row.id
params.value.number = row.number
//
await EquipmentRepairJobMainApi.createEquipmentRepairNewOrder(params.value)
message.success(t('工单已结束'))
//
await getList()
}
})
}
/** 维修验证按钮操作 */
const finishForm1Ref = ref()
const handleValidateRepair = async (row) => {
await message.delConfirm('是否验证所选中工单?');
message.confirmPassword(t('')).then(async () => {
//
//
finishForm1Ref.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 EquipmentRepairJobMainApi.backEquipmentRepairOrder(params.value)
message.success(t('工单已打回'))
//
await getList()
}
})
}
/** 完成按钮操作 */ /** 完成按钮操作 */
const finishForm2Ref = ref() const finishForm2Ref = ref()
const handleFinish = async (row) => { const handleFinish = async (row) => {
@ -313,6 +376,36 @@ const handleDelete = async (id: number) => {
} }
//finishForm1
const getClosed1=(val)=> {
nextTick?.(() => {
console.log(val)
getList()
})
}
//finishForm1
const getData1=(val)=> {
nextTick?.(async () => {
console.log(val)
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '7'
await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value)
message.success(t('工单已流转'))
//
await getList()
} catch {}
}
)
}
//finishForm2 //finishForm2
const getClosed2=(val)=> { const getClosed2=(val)=> {
@ -338,6 +431,37 @@ const getData2=(val)=> {
}) })
} }
//finishForm3
const getClosed3=(val)=> {
nextTick?.(() => {
console.log(val)
getList()
})
}
//finishForm3
const getData3=(val)=> {
nextTick?.(async () => {
console.log(val)
try {
const params = ref({
id: '',
status:'',
})
params.value.id = val
params.value.status = '7'
await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value)
message.success(t('工单已流转'))
//
await getList()
} catch {}
}
)
}
/** 导出按钮操作 */ /** 导出按钮操作 */
const exportLoading = ref(false) // const exportLoading = ref(false) //
const handleExport = async () => { const handleExport = async () => {

173
src/views/eam/equipmentShutdown/equipmentShutdown.data.ts

@ -1,6 +1,24 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as UserApi from '@/api/system/user'
import { EquipmentAccounts,EquipmentAccountsRules } from '../equipmentAccounts/equipmentAccounts.data'
import * as EquipmentAccountsApi from '@/api/eam/equipmentAccounts'
import * as ProductionlineApi from '@/api/wms/productionline'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as ProcessApi from '@/api/wms/process'
import { Process } from '@/views/wms/basicDataManage/factoryModeling/process/process.data'
import * as WorkStationApi from '@/api/wms/workstation'
import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data'
export interface User {
id: number,
nickname: string
}
const userList = ref<User[]>([])
userList.value = await UserApi.getSimpleUserList()
// 表单校验 // 表单校验
export const EquipmentShutdownRules = reactive({ export const EquipmentShutdownRules = reactive({
equipmentCode: [required], equipmentCode: [required],
@ -13,7 +31,23 @@ export const EquipmentShutdown = useCrudSchemas(reactive<CrudSchema[]>([
label: '设备编码', label: '设备编码',
field: 'equipmentCode', field: 'equipmentCode',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择设备', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '设备信息', // 查询弹窗标题
searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类
searchPage: EquipmentAccountsApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
}, },
{ {
label: '操作日期', label: '操作日期',
@ -41,7 +75,21 @@ export const EquipmentShutdown = useCrudSchemas(reactive<CrudSchema[]>([
label: '操作人', label: '操作人',
field: 'operationer', field: 'operationer',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
form: {
component: 'Select',
componentProps: { // 假设deptList是部门数据列表
options: userList.value,
optionsAlias: {
valueField: 'id',
labelField: 'nickname'
},
disabled: false,
placeholder: "请选择操作人",
filterable: true,
multiple: false,
}
}
}, },
// { // {
// label: '所属厂区编号', // label: '所属厂区编号',
@ -53,20 +101,120 @@ export const EquipmentShutdown = useCrudSchemas(reactive<CrudSchema[]>([
label: '车间编号', label: '车间编号',
field: 'workshopCode', field: 'workshopCode',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
}, },
{ {
label: '工段编号', label: '产线编号',
field: 'workshopSectionCode', field: 'lineCode',
sort: 'custom', sort: 'custom',
isSearch: false isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
multiple:true,
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition: [{
key:'workshopCode',
value:'workshopCode',
message: '请填写车间代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}, },
// {
// label: '工序编号',
// field: 'processCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择工序代码',
// searchField: 'code',
// searchTitle: '工序信息',
// searchAllSchemas: Process.allSchemas,
// searchPage: ProcessApi.getProcessPage,
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// },
// },
// {
// label: '工位编号',
// field: 'workstationCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择工位', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '工位信息', // 查询弹窗标题
// searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
// searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key:'available',
// value:'TRUE',
// isMainValue: false
// }]
// }
// },
// },
{ {
label: '是否停机', label: '是否停机',
field: 'status', field: 'status',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false, isSearch: false,
form: { form: {
component: 'Radio' component: 'Radio'
@ -76,7 +224,14 @@ export const EquipmentShutdown = useCrudSchemas(reactive<CrudSchema[]>([
label: '设备停机原因', label: '设备停机原因',
field: 'shutdownCause', field: 'shutdownCause',
sort: 'custom', sort: 'custom',
isSearch: false isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea'
}
}
}, },
{ {
label: '备注', label: '备注',

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

@ -1,21 +1,28 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import { handleTreeToComponentOptions } from '@/utils/tree' import { handleTreeToComponentOptions } from '@/utils/tree'
import * as DeptApi from '@/api/system/dept' import * as DeptApi from '@/api/system/dept'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { EquipmentAccounts,EquipmentAccountsRules } from '../equipmentAccounts/equipmentAccounts.data' import { EquipmentAccounts,EquipmentAccountsRules } from '../equipmentAccounts/equipmentAccounts.data'
import * as EquipmentAccountsApi from '@/api/eam/equipmentAccounts' import * as EquipmentAccountsApi from '@/api/eam/equipmentAccounts'
import * as ProductionlineApi from '@/api/wms/productionline'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as ProcessApi from '@/api/wms/process'
import { Process } from '@/views/wms/basicDataManage/factoryModeling/process/process.data'
import * as WorkStationApi from '@/api/wms/workstation'
import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data'
export interface User { export interface User {
id: number, id: number,
nickname: string nickname: string
} }
const allDeptList = await DeptApi.getSimpleDeptList()
const deptList = ref<Tree[]>([]) // 树形结构 const deptList = ref<Tree[]>([]) // 树形结构
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({})
const userList = ref<User[]>([]) const userList = ref<User[]>([])
userList.value = await UserApi.getSimpleUserList()
// 加载部门树(默认格式) // 加载部门树(默认格式)
deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList()) deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList())
@ -28,7 +35,8 @@ export const EquipmentSigningRules = reactive({
supplierCode: [required], supplierCode: [required],
status: [required], status: [required],
storageLocation: [required], storageLocation: [required],
concurrencyStamp: [required] concurrencyStamp: [required],
workshopCode: [required]
}) })
export const EquipmentSigning = useCrudSchemas(reactive<CrudSchema[]>([ export const EquipmentSigning = useCrudSchemas(reactive<CrudSchema[]>([
@ -81,10 +89,13 @@ export const EquipmentSigning = useCrudSchemas(reactive<CrudSchema[]>([
field: 'operationDept', field: 'operationDept',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return allDeptList.find((item) => item.id == cellValue)?.name
},
form: { form: {
component: 'TreeSelect', component: 'TreeSelect',
componentProps: { // 假设deptList是部门数据列表 componentProps: { // 假设deptList是部门数据列表
data: deptList, data: deptList.value,
disabled: false, disabled: false,
placeholder: "请选择部门", placeholder: "请选择部门",
filterable: true, filterable: true,
@ -97,10 +108,13 @@ export const EquipmentSigning = useCrudSchemas(reactive<CrudSchema[]>([
field: 'operationer', field: 'operationer',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userList.value.find((item) => item.id == cellValue)?.nickname
},
form: { form: {
component: 'Select', component: 'Select',
componentProps: { // 假设deptList是部门数据列表 componentProps: { // 假设deptList是部门数据列表
options: [], options: userList.value,
optionsAlias: { optionsAlias: {
valueField: 'id', valueField: 'id',
labelField: 'nickname' labelField: 'nickname'
@ -288,27 +302,90 @@ export const EquipmentSigning = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: { form: {
component: 'Select' // labelMessage: '信息提示说明!!!',
} componentProps: {
}, isSearchList: true, // 开启查询弹窗
{ searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
label: '工序编号', multiple:true,
field: 'processCode', searchField: 'code', // 查询弹窗赋值字段
sort: 'custom', searchTitle: '生产线信息', // 查询弹窗标题
isSearch: true, searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
form: { searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
component: 'Select' searchCondition: [{
} key:'workshopCode',
}, value:'workshopCode',
{ message: '请填写车间代码!',
label: '工位编号', isMainValue: true
field: 'workstationCode', },{
sort: 'custom', key: 'available',
isSearch: true, value: 'TRUE',
form: { isMainValue: false
component: 'Select' }]
}
} }
}, },
// {
// label: '工序编号',
// field: 'processCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择工序代码',
// searchField: 'code',
// searchTitle: '工序信息',
// searchAllSchemas: Process.allSchemas,
// searchPage: ProcessApi.getProcessPage,
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// },
// },
// {
// label: '工位编号',
// field: 'workstationCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择工位', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '工位信息', // 查询弹窗标题
// searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
// searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key:'available',
// value:'TRUE',
// isMainValue: false
// }]
// }
// },
// },
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',

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

@ -0,0 +1,270 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="EquipmentSigning.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="EquipmentSigning.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="EquipmentSigningRules"
:formAllSchemas="EquipmentSigning.allSchemas"
:apiUpdate="EquipmentSigningApi.updateEquipmentSigning"
:apiCreate="EquipmentSigningApi.createEquipmentSigning"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentSigning.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/equipment-signing/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { EquipmentSigning,EquipmentSigningRules } from './equipmentSigning.data'
import * as EquipmentSigningApi from '@/api/eam/equipmentSigning'
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 UserApi from '@/api/system/user'
defineOptions({ name: 'EquipmentSigning' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
export interface User {
id: number,
nickname: string
}
const userList = ref<User[]>([])
routeName.value = route.name
const tableColumns = ref(EquipmentSigning.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: EquipmentSigningApi.getEquipmentSigningPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:equipment-signing:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'eam:equipment-signing:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'eam:equipment-signing:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:equipment-signing:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:equipment-signing:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = async (type: string, row?: any) => {
userList.value = await UserApi.getSimpleUserList()
EquipmentSigning.allSchemas.formSchema.find(item => item.field == 'operationer').componentProps.options = userList.value
if(type == 'update'){
row.operationDept = Number(row.operationDept)
row.operationer = Number(row.operationer)
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =EquipmentSigning.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 EquipmentSigningApi.createEquipmentSigning(data)
message.success(t('common.createSuccess'))
} else {
await EquipmentSigningApi.updateEquipmentSigning(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, 'basicEquipmentSigning')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EquipmentSigningApi.deleteEquipmentSigning(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 EquipmentSigningApi.exportEquipmentSigning(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() //
}
const onChange = async (field, cur, formRef) => {
if(field == 'operationDept'){
userList.value = await UserApi.getUserListByDeptIds([cur])
EquipmentSigning.allSchemas.formSchema.find(item => item.field == 'operationer').componentProps.options = userList.value
let setV = {}
setV['operationer'] = ''
formRef.value.setValues(setV)
}
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await EquipmentSigningApi.importTemplate()
})
</script>

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

@ -1,6 +1,24 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as UserApi from '@/api/system/user'
import { EquipmentAccounts,EquipmentAccountsRules } from '../equipmentAccounts/equipmentAccounts.data'
import * as EquipmentAccountsApi from '@/api/eam/equipmentAccounts'
import * as ProductionlineApi from '@/api/wms/productionline'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as ProcessApi from '@/api/wms/process'
import { Process } from '@/views/wms/basicDataManage/factoryModeling/process/process.data'
import * as WorkStationApi from '@/api/wms/workstation'
import { Workstation } from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data'
export interface User {
id: number,
nickname: string
}
const userList = ref<User[]>([])
userList.value = await UserApi.getSimpleUserList()
// 表单校验 // 表单校验
export const EquipmentTransferRecordRules = reactive({ export const EquipmentTransferRecordRules = reactive({
equipmentCode: [required], equipmentCode: [required],
@ -12,48 +30,51 @@ export const EquipmentTransferRecord = useCrudSchemas(reactive<CrudSchema[]>([
label: '设备编码', label: '设备编码',
field: 'equipmentCode', field: 'equipmentCode',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
},
{
label: '设备类型枚举',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
form: { form: {
component: 'Select' colProps: {
} span: 24
}, },
{ // labelMessage: '信息提示说明!!!',
label: '操作日期',
field: 'operationDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: { componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss', isSearchList: true, // 开启查询弹窗
type: 'daterange', searchListPlaceholder: '请选择设备', // 输入框占位文本
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] searchField: 'code', // 查询弹窗赋值字段
searchTitle: '设备信息', // 查询弹窗标题
searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类
searchPage: EquipmentAccountsApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
} }
}, },
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '操作人',
field: 'operationer',
sort: 'custom',
isSearch: false
}, },
// { // {
// label: '操作人',
// field: 'operationer',
// sort: 'custom',
// isSearch: true,
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return userList.value.find((item) => item.id == cellValue)?.nickname
// },
// form: {
// component: 'Select',
// componentProps: { // 假设deptList是部门数据列表
// options: userList.value,
// optionsAlias: {
// valueField: 'id',
// labelField: 'nickname'
// },
// disabled: false,
// placeholder: "请选择操作人",
// filterable: true,
// multiple: false,
// }
// }
// },
// {
// label: '原所属厂区编号', // label: '原所属厂区编号',
// field: 'beforeFactoryAreaCode', // field: 'beforeFactoryAreaCode',
// sort: 'custom', // sort: 'custom',
@ -66,42 +87,260 @@ export const EquipmentTransferRecord = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true isSearch: true
}, },
{ {
label: '原车间编号', label: '新地点',
field: 'beforeWorkshopCode', field: 'nowLocation',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true
}, },
{ {
label: '原工段编号', label: '原车间编号',
field: 'beforeWorkshopSectionCode', field: 'beforeWorkshopCode',
sort: 'custom', sort: 'custom',
isSearch: false isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
}, },
{ {
label: '现地点', label: '新车间编号',
field: 'nowLocation', field: 'workshopCode',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: 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: 'factoryAreaCode',
// sort: 'custom',
// isSearch: true
// },
{ {
label: '车间编号', label: '原产线编号',
field: 'workshopCode', field: 'beforeLineCode',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
multiple:true,
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition: [{
key:'workshopCode',
value:'beforeWorkshopCode',
message: '请填写车间代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}, },
{ {
label: '工段编号', label: '新产线编号',
field: 'workshopSectionCode', field: 'lineCode',
sort: 'custom', sort: 'custom',
isSearch: false isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
multiple:true,
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition: [{
key:'workshopCode',
value:'workshopCode',
message: '请填写车间代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}, },
// { // {
// label: '操作日期',
// field: 'operationDate',
// 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: 'beforeProcessCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择工序代码',
// searchField: 'code',
// searchTitle: '工序信息',
// searchAllSchemas: Process.allSchemas,
// searchPage: ProcessApi.getProcessPage,
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// },
// },
// {
// label: '新工序编号',
// field: 'processCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择工序代码',
// searchField: 'code',
// searchTitle: '工序信息',
// searchAllSchemas: Process.allSchemas,
// searchPage: ProcessApi.getProcessPage,
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// },
// },
// {
// label: '原工位编号',
// field: 'beforeWorkstationCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择工位', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '工位信息', // 查询弹窗标题
// searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
// searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key:'available',
// value:'TRUE',
// isMainValue: false
// }]
// }
// },
// },
// {
// label: '新工位编号',
// field: 'workstationCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择工位', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '工位信息', // 查询弹窗标题
// searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
// searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key:'available',
// value:'TRUE',
// isMainValue: false
// }]
// }
// },
// },
// {
// label: '是否可用', // label: '是否可用',
// field: 'available', // field: 'available',
// sort: 'custom', // sort: 'custom',

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

@ -48,6 +48,7 @@
:apiCreate="EquipmentTransferRecordApi.createEquipmentTransferRecord" :apiCreate="EquipmentTransferRecordApi.createEquipmentTransferRecord"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
@onEnter="onEnter"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -59,19 +60,25 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { EquipmentSigning,EquipmentSigningRules } from '../equipmentSigning/equipmentSigning.data'
import { EquipmentTransferRecord,EquipmentTransferRecordRules } from './equipmentTransferRecord.data' import { EquipmentTransferRecord,EquipmentTransferRecordRules } from './equipmentTransferRecord.data'
import * as EquipmentTransferRecordApi from '@/api/eam/equipmentTransferRecord' import * as EquipmentTransferRecordApi from '@/api/eam/equipmentTransferRecord'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import * as UserApi from '@/api/system/user'
defineOptions({ name: 'EquipmentTransferRecord' }) defineOptions({ name: 'EquipmentTransferRecord' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
export interface User {
id: number,
nickname: string
}
const userList = ref<User[]>([])
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(EquipmentTransferRecord.allSchemas.tableColumns) const tableColumns = ref(EquipmentTransferRecord.allSchemas.tableColumns)
@ -81,6 +88,14 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if(formField == 'equipmentCode'){
debugger
setV['beforeStorageLocation'] = val[0]['storageLocation']
setV['beforeWorkshopCode'] = val[0]['workshopCode']
setV['beforeLineCode'] = val[0]['lineCode']
setV['beforeProcessCode'] = val[0]['processCode']
setV['beforeWorkstationCode'] = val[0]['workstationCode']
}
formRef.setValues(setV) formRef.setValues(setV)
}) })
} }
@ -100,8 +115,8 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:equipment-transfer-record:create'}), // defaultButtons.defaultAddBtn({hasPermi:'eam:equipment-transfer-record:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:equipment-transfer-record:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'eam:equipment-transfer-record:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:equipment-transfer-record:export'}), // // defaultButtons.defaultExportBtn({hasPermi:'eam:equipment-transfer-record:export'}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -148,7 +163,12 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = async (type: string, row?: any) => {
userList.value = await UserApi.getSimpleUserList()
EquipmentSigning.allSchemas.formSchema.find(item => item.field == 'operationer').componentProps.options = userList.value
if(type == 'update'){
row.operationer = Number(row.operationer)
}
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
@ -235,6 +255,10 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
const onEnter = (a,b,c,d) =>{
debugger
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

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

@ -0,0 +1,399 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="ItemAccounts.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ItemAccounts.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>
<!-- <template #upload="{ row }">
<ButtonBase
v-if="row.filePathList != null && row.filePathList.length != 0"
:Butttondata="butttondataView(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> -->
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ItemAccountsRules"
:formAllSchemas="ItemAccounts.allSchemas"
:apiUpdate="ItemAccountsApi.updateItemAccounts"
:apiCreate="ItemAccountsApi.createItemAccounts"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<SearchTable ref="searchTableRef" @searchTableSuccess="submitItem" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemAccounts.allSchemas" />
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/item-accounts/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
<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>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemAccounts, ItemAccountsRules } from './itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/itemAccounts'
import { SparePart } from '@/views/eam/sparePart/sparePart.data'
import * as ItemApi from '@/api/eam/sparePart'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ItemAccounts' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
const locationNumber = ref()
const wantId1 = ref()
routeName.value = route.name
const tableColumns = ref(ItemAccounts.allSchemas.tableColumns)
const showView = ref(false)
const viewTitle = ref('图片预览')
const urls = ref([])
const viewKey = ref(0)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if (formField == 'locationNumber') {
setV['locationNumber'] = val[0].code
setV['areaNumber'] = val[0].areaCode
}
if (formField == 'itemNumber') {
setV['itemNumber'] = val[0].code
setV['name'] = val[0].name
setV['brand'] = val[0].brand
setV['specifications'] = val[0].specifications
setV['isOverall'] = val[0].isOverall
setV['subject'] = val[0].subject
setV['subjectCode'] = val[0].subjectCode
setV['type'] = val[0].type
setV['region'] = val[0].region
setV['classification'] = val[0].classification
setV['uom'] = val[0].uom
setV['manufacturer'] = val[0].manufacturer
setV['minInventory'] = val[0].minInventory
setV['maxInventory'] = val[0].maxInventory
setV['replacementCycle'] = val[0].replacementCycle
setV['storageLocation'] = val[0].storageLocation
setV['remark'] = val[0].remark
setV['available'] = val[0].available
}
formRef.setValues(setV)
})
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: ItemAccountsApi.getItemAccountsPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'item:itemAccounts:create' }), //
defaultButtons.defaultImportBtn({ hasPermi: 'item:itemAccounts:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'item:itemAccounts:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
// -
// const butttondata = [
// defaultButtons.mainListEditBtn({ hasPermi: 'item:itemAccounts:update' }), //
// defaultButtons.replaceLocation({ hasPermi: 'item:itemAccounts:replaceLocation' }), //
// defaultButtons.mainListDeleteBtn({ hasPermi: 'item:itemAccounts:delete' }) //
// ]
// -
const butttondata = (row) => {
return [
defaultButtons.mainListEditBtn({ hasPermi: 'item:itemAccounts:update' }), //
// defaultButtons.replaceLocation({ hasPermi: 'item:itemAccounts:replaceLocation' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'item:itemAccounts:delete' }) //
// defaultButtons.viewBtn({ hide: !(row.filePathList != null && row.filePathList.length != 0) })
//defaultButtons.backoutBtn({hasPermi:'eam:device-repair-request:cancel', hide: !(row.result == 'PENDING' && row.declarer == userStore.getUser.id )}), //
]
}
// -
const butttondataView = (row) => {
return [defaultButtons.viewBtn(null)]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') {
//
handleDelete(row.id)
} else if (val == 'replaceLocation') {
openItem(row.locationNumber, row.id)
} else if (val == 'view') {
//
openForm('view', row)
}
}
const searchTableRef = ref()
/** 绑定备件操作 */
const openItem = async (number: String, wantId: number) => {
locationNumber.value = number
wantId1.value = wantId
searchTableRef.value.open(
'选择备件',
Item.allSchemas,
ItemApi.getItemPage,
null,
Item.allSchemas.searchSchema,
true,
null,
null,
null,
null
)
}
const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => {
const deviceItemRelList = selections.map((element) => ({
id: wantId1.value,
locationNumber: locationNumber.value,
itemNumber: element.number
}))
ItemAccountsApi.replaceLocation(deviceItemRelList).then((res) => {
message.success(t('更换成功'))
//
getList()
})
}
const getItemWithOutBind = async () => {
try {
const res = await ItemApi.getItemPage({
...Item.allSchemas.searchSchema,
available: 'TRUE'
})
if (res.list?.length > 0) {
// const response = await getDeviceItemPage(DeviceAccounts.allSchemas.searchSchema);
// const filteredList = res.list.filter(item => {
// return !response.list?.some(element => {
// return item.number === element.itemNumber
// });
// });
// console.log('filteredList',filteredList);
const filteredList = res.list
return filteredList //
}
return [] //
} catch (error) {
console.error(error)
throw error //
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
if (type == 'view') {
showView.value = true
urls.value = row.filePathList
viewKey.value += 1
} else {
basicFormRef.value.open(type, row)
}
}
// form
const formsSuccess = async (formType, data) => {
var isHave = ItemAccounts.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 ItemAccountsApi.createItemAccounts(data)
message.success(t('common.createSuccess'))
} else {
await ItemAccountsApi.updateItemAccounts(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, 'basicItemAccounts')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ItemAccountsApi.deleteItemAccounts(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 ItemAccountsApi.exportItemAccounts(tableObject.params)
download.excel(data, '备件台账.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件台账导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemAccountsApi.importTemplate()
})
</script>

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

@ -0,0 +1,349 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as SparePartApi from '@/api/eam/sparePart'
import { SparePart } from '@/views/eam/sparePart/sparePart.data'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ItemAccountsRules = reactive({
itemNumber: [required],
singlePrice: [required],
locationNumber: [required],
qty: [required]
})
export const ItemAccounts = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '编号信息', // 查询弹窗标题
searchAllSchemas: SparePart.allSchemas, // 查询弹窗所需类
searchPage: SparePartApi.getSparePartPage, // 查询弹窗所需分页方法
searchCondition: [
// {
// key: 'warehouseCode',
// value: 'warehouseCode',
// message: '请填写仓库代码!',
// isMainValue: true
// },
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
}
},
{
label: '备件名称',
field: 'name',
sort: 'custom',
isSearch: true,
isForm: true,
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '单价',
field: 'singlePrice',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '库存数量',
field: 'qty',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom',
table: {
width: 150
},
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位编号', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [
// {
// key: 'warehouseCode',
// value: 'warehouseCode',
// message: '请填写仓库代码!',
// isMainValue: true
// },
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
}
},
{
label: '库区编号',
field: 'areaNumber',
sort: 'custom',
isSearch: true,
table: {
width: 180
},
form: {
componentProps: {
disabled: true
}
}
},
{
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',
sort: 'custom',
dictType: DICT_TYPE.PART_CLASS,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
form: {
component: 'Select',
componentProps: {
disabled: true
}
}
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '生产厂家',
field: 'manufacturer',
sort: 'custom',
isSearch: false,
form: {
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',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
])
)

224
src/views/eam/itemInLocation/index.vue

@ -0,0 +1,224 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ItemInLocation.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="ItemInLocation.allSchemas" />
<!-- 列表 -->
<ContentWrap>
<Table :columns="tableColumns" :data="tableObject.tableList" :loading="tableObject.loading" :pagination="{
total: tableObject.total
}" v-model:pageSize="tableObject.pageSize" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort">
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="ItemInLocationRules"
:formAllSchemas="ItemInLocation.allSchemas" :apiUpdate="ItemInLocationApi.updateItemInLocation"
:apiCreate="ItemInLocationApi.createItemInLocation" @searchTableSuccess="searchTableSuccess" :isBusiness="false" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemInLocation.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/record/item-in-location/import" :importTemplateData="importTemplateData"
@success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemInLocation, ItemInLocationRules } from './itemInLocation.data'
import * as ItemInLocationApi from '@/api/eam/itemInLocation'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ItemInLocation' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ItemInLocation.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: ItemInLocationApi.getItemInLocationPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({ hasPermi: 'item:itemInLocation:create' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'item:itemInLocation:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({ hasPermi: 'item:itemInLocation:update' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'item:itemInLocation:delete' }), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type : string, row ?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType, data) => {
var isHave = ItemInLocation.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 ItemInLocationApi.createItemInLocation(data)
message.success(t('common.createSuccess'))
} else {
await ItemInLocationApi.updateItemInLocation(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, 'basicItemInLocation')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await ItemInLocationApi.deleteItemInLocation(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 ItemInLocationApi.exportItemInLocation(tableObject.params)
download.excel(data, '备件入库记录.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件入库记录导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemInLocationApi.importTemplate()
})
</script>

53
src/views/eam/itemInLocation/itemInLocation.data.ts

@ -0,0 +1,53 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
// 表单校验
export const ItemInLocationRules = reactive({
number: [required],
itemNumber: [required],
locationNumber: [required],
})
export const ItemInLocation = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '入库编号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
},
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom',
isSearch: true,
},
{
label: '入库类型',
field: 'type',
sort: 'custom',
isSearch: false,
form: {
component: 'Select'
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

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

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ItemLocationReplace.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ItemLocationReplace.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ItemLocationReplaceRules"
:formAllSchemas="ItemLocationReplace.allSchemas"
:apiUpdate="ItemLocationReplaceApi.updateItemLocationReplace"
:apiCreate="ItemLocationReplaceApi.createItemLocationReplace"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemLocationReplace.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/record/item-location-replace/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemLocationReplace,ItemLocationReplaceRules } from './itemLocationReplace.data'
import * as ItemLocationReplaceApi from '@/api/eam/itemLocationReplace'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ItemLocationReplace' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ItemLocationReplace.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: ItemLocationReplaceApi.getItemLocationReplacePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'item:itemLocationReplace:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'item:itemLocationReplace:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'item:itemLocationReplace:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'item:itemLocationReplace:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'item:itemLocationReplace:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ItemLocationReplace.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 ItemLocationReplaceApi.createItemLocationReplace(data)
message.success(t('common.createSuccess'))
} else {
await ItemLocationReplaceApi.updateItemLocationReplace(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, 'basicItemLocationReplace')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ItemLocationReplaceApi.deleteItemLocationReplace(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 ItemLocationReplaceApi.exportItemLocationReplace(tableObject.params)
download.excel(data, '备件库位变更记录.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件库位变更记录导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemLocationReplaceApi.importTemplate()
})
</script>

55
src/views/eam/itemLocationReplace/itemLocationReplace.data.ts

@ -0,0 +1,55 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ItemLocationReplaceRules = reactive({
locationNumber: [required],
oldItemNumber: [required],
itemNumber: [required],
})
export const ItemLocationReplace = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom',
isSearch: true,
},
{
label: '变更前备件编号',
field: 'oldItemNumber',
sort: 'custom',
isSearch: true,
},
{
label: '变更后备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
},
{
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,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
fixed: 'right'
}
}
]))

243
src/views/eam/itemMaintenance/index.vue

@ -0,0 +1,243 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ItemMaintenance.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ItemMaintenance.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ItemMaintenanceRules"
:formAllSchemas="ItemMaintenance.allSchemas"
:apiUpdate="ItemMaintenanceApi.updateItemMaintenance"
:apiCreate="ItemMaintenanceApi.createItemMaintenance"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemMaintenance.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/item-maintenance/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemMaintenance,ItemMaintenanceRules } from './itemMaintenance.data'
import * as ItemMaintenanceApi from '@/api/eam/itemMaintenance'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ItemMaintenance' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ItemMaintenance.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: ItemMaintenanceApi.getItemMaintenancePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'item:itemMaintenance:create'}), //
defaultButtons.defaultExportBtn({hasPermi:'item:itemMaintenance:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'item:itemMaintenance:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'item:itemMaintenance:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ItemMaintenance.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 ItemMaintenanceApi.createItemMaintenance(data)
message.success(t('common.createSuccess'))
} else {
await ItemMaintenanceApi.updateItemMaintenance(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, 'basicItemMaintenance')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ItemMaintenanceApi.deleteItemMaintenance(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 ItemMaintenanceApi.exportItemMaintenance(tableObject.params)
download.excel(data, '备件维修记录.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件维修记录导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemMaintenanceApi.importTemplate()
})
</script>

110
src/views/eam/itemMaintenance/itemMaintenance.data.ts

@ -0,0 +1,110 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ItemMaintenanceRules = reactive({
number: [required],
itemNumber: [required],
qty: [required],
concurrencyStamp: [required],
})
export const ItemMaintenance = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修工单编号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
},
{
label: '事务类型',
field: 'result',
dictType: DICT_TYPE.RESULT,
dictClass: 'string',
isSearch: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
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,
},
{
label: '维修原因',
field: 'reasons',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

304
src/views/eam/itemOrderMain/index.vue

@ -0,0 +1,304 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ItemOrderMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" :routeName="routeName"
@updataTableColumns="updataTableColumns" @searchFormClick="searchFormClick"
:allSchemas="ItemOrderMain.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="ItemOrderMainRules" :formAllSchemas="ItemOrderMain.allSchemas"
:tableAllSchemas="ItemOrderDetail.allSchemas" :tableFormRules="ItemOrderDetailRules" :tableData="tableData"
:apiUpdate="ItemOrderMainApi.updateItemOrderMain" :apiCreate="ItemOrderMainApi.createItemOrderMain"
:isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @submitForm="submitForm" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="false" :allSchemas="ItemOrderMain.allSchemas"
:detailAllSchemas="ItemOrderDetail.allSchemas" :detailAllSchemasRules="ItemOrderDetailRules"
:apiCreate="ItemOrderDetailApi.createItemOrderDetail" :apiUpdate="ItemOrderDetailApi.updateItemOrderDetail"
:apiPage="ItemOrderDetailApi.getItemOrderDetailPage" :apiDelete="ItemOrderDetailApi.deleteItemOrderDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchase-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :isShowOut="true" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemOrderMain, ItemOrderMainRules, ItemOrderDetail, ItemOrderDetailRules } from './itemOrderMain.data'
import * as ItemOrderMainApi from '@/api/eam/itemOrderMain'
import * as ItemOrderDetailApi from '@/api/eam/itemOrderDetail'
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: 'ItemOrderMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ItemOrderMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number']
row['itemName'] = val[0]['name']
row['uom'] = val[0]['uom']
row['isRadeIn'] = val[0]['isRadeIn']
row['available'] = val[0]['available']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const 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: ItemOrderMainApi.getItemOrderMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'item:itemOrderMain:create'}), //
// 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.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row) => {
return [
defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']),hasPermi:'item:itemOrderMain:create' }), //
// defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
}
else if (val == 'mainOrderCOMPLETE') { //
handleCOMPLETE(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, 'basicItemOrderMain')
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await ItemOrderMainApi.deleteItemOrderMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 完成按钮操作 */
const handleCOMPLETE = async (id : number) => {
try {
//
await message.confirm('是否完成所选中数据?')
//
await ItemOrderMainApi.closeItemOrderMain(id)
message.success(t('完成成功!'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ItemOrderMainApi.exportItemOrderMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
ItemOrderDetail.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 ItemOrderMainApi.createItemOrderMain(data)
message.success(t('common.createSuccess'))
} else {
await ItemOrderMainApi.updateItemOrderMain(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 ItemOrderMainApi.importTemplate()
})
</script>

310
src/views/eam/itemOrderMain/itemOrderMain.data.ts

@ -0,0 +1,310 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter2 } from '@/utils/formatTime'
import { SparePart } from '@/views/eam/sparePart/sparePart.data'
import * as ItemApi from '@/api/eam/sparePart'
import { validateHanset, validateEmail } from '@/utils/validator'
const { t } = useI18n() // 国际化
/**
* @returns {Array}
*/
export const ItemOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '采购订单编号',
field: 'number',
sort: 'custom',
isForm: false,
isSearch: true,
table: {
width: 150,
fixed: 'left'
},
},
{
label: '电话',
field: 'phone',
sort: 'custom',
},
{
label: '传真',
field: 'fax',
sort: 'custom',
},
{
label: '采购员',
field: 'purchaser',
sort: 'custom',
},
{
label: '供应商编号',
field: 'supplierNumber',
sort: 'custom',
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
},
{
label: '供应商地址',
field: 'supplierAddress',
sort: 'custom',
},
{
label: '发货至',
field: 'shipTo',
sort: 'custom',
},
{
label: '开票至',
field: 'invoiceTo',
sort: 'custom',
},
{
label: '联系人',
field: 'contacts',
sort: 'custom',
},
{
label: '联系电话',
field: 'contactsPhone',
sort: 'custom',
},
{
label: '付款方式',
field: 'paymentType',
sort: 'custom',
form: {
component: 'Select'
},
},
{
label: '注册地',
field: 'registLocation',
sort: 'custom',
},
{
label: '开户行',
field: 'bank',
sort: 'custom',
},
{
label: '账号',
field: 'account',
sort: 'custom',
},
{
label: '税号',
field: 'dutyParagraph',
sort: 'custom',
},
// {
// label: '是否关闭',
// field: 'available',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// isSearch: false,
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// type: 'Select',
// inactiveValue: 'FALSE',
// disabled: true
// },
// form: {
// component: 'Switch',
// value: 'FALSE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.IS_COMPLETE,
dictClass: 'string',
isTable: true,
isForm: true,
tableForm: {
type: 'Select'
},
form: {
value: 'INCOMPLETE',
componentProps: {
disabled: true,
}
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))
//表单校验
export const ItemOrderMainRules = reactive({
available: [
{ required: true, message: '请选择是否关闭', trigger: 'change' }
],
})
/**
* @returns {Array}
*/
export const ItemOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择备件编号',
searchField: 'number',
searchTitle: '备件信息',
searchAllSchemas: SparePart.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
},
},
{
label: '备件名称',
field: 'itemName',
sort: 'custom',
isSearch: true,
table: {
width: 110,
},
tableForm: {
disabled: true
}
},
{
label: '单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: false,
isTable: true,
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '单价',
field: 'singlePrice',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '是否以旧换新',
field: 'isRadeIn',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: true
}
},
{
label: '库存数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '备注',
field: 'remark',
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
}
]))
//表单校验
export const ItemOrderDetailRules = reactive({
singlePrice: [
{ required: true, message: '请输入备件单价', trigger: 'blur' },
],
})

243
src/views/eam/itemOutLocation/index.vue

@ -0,0 +1,243 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ItemOutLocation.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ItemOutLocation.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ItemOutLocationRules"
:formAllSchemas="ItemOutLocation.allSchemas"
:apiUpdate="ItemOutLocationApi.updateItemOutLocation"
:apiCreate="ItemOutLocationApi.createItemOutLocation"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ItemOutLocation.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/record/item-out-location/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ItemOutLocation,ItemOutLocationRules } from './itemOutLocation.data'
import * as ItemOutLocationApi from '@/api/eam/itemOutLocation'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'ItemOutLocation' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ItemOutLocation.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: ItemOutLocationApi.getItemOutLocationPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'item:itemOutLocation:create'}), //
defaultButtons.defaultExportBtn({hasPermi:'item:itemOutLocation:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'item:itemOutLocation:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'item:itemOutLocation:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ItemOutLocation.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 ItemOutLocationApi.createItemOutLocation(data)
message.success(t('common.createSuccess'))
} else {
await ItemOutLocationApi.updateItemOutLocation(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, 'basicItemOutLocation')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ItemOutLocationApi.deleteItemOutLocation(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 ItemOutLocationApi.exportItemOutLocation(tableObject.params)
download.excel(data, '备件出库记录.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '备件出库记录导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ItemOutLocationApi.importTemplate()
})
</script>

53
src/views/eam/itemOutLocation/itemOutLocation.data.ts

@ -0,0 +1,53 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
// 表单校验
export const ItemOutLocationRules = reactive({
number: [required],
itemNumber: [required],
locationNumber: [required],
})
export const ItemOutLocation = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '出库编号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
},
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom',
isSearch: true,
},
{
label: '出库类型',
field: 'type',
sort: 'custom',
isSearch: false,
form: {
component: 'Select'
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
isSearch: false,
},
{
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, isSearch: false,
isTable: false, isTable: false,
isForm: false, isForm: false,
isDetail:false, isDetail:false
}, },
{ {
label: '备件编号', label: '备件编号',
@ -197,7 +197,6 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
isForm: false,
}, },
{ {
label: '部门id', label: '部门id',

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

@ -0,0 +1,290 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import * as ItemAccountsApi from '@/api/eam/itemAccounts'
import { ItemAccounts } from '@/views/eam/itemAccounts/itemAccounts.data'
import { EquipmentAccounts } from '@/views/eam/equipmentAccounts/equipmentAccounts.data'
import * as EquipmentItemApi from '@/api/eam/equipmentAccounts'
import { dateFormatter } from '@/utils/formatTime'
export const SparePartsApplyMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '申请编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false
},
{
label: '描述',
field: 'description',
sort: 'custom',
isSearch: true
},
{
label: '申领备件总价',
field: 'sumVal',
sort: 'custom',
isSearch: false,
isForm: false
},
{
label: '流程状态',
field: 'status',
sort: 'custom',
isSearch: false,
isForm: false,
form: {
component: 'Radio'
}
},
{
label: '申请人',
field: 'applyer',
sort: 'custom',
isSearch: false,
isForm: false
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: false,
isForm: false,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: true,
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'
}
}
},
{
label: '自动审核',
field: 'autoExamine',
sort: 'custom',
isSearch: false,
isForm: false
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isSearch: false,
isForm: false
},
{
label: '直接生成记录',
field: 'directCreateRecord',
sort: 'custom',
isSearch: false,
isForm: false
},
{
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
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
])
)
//表单校验
export const SparePartsApplyMainRules = reactive({
description: [{ required: true, message: '描述不能为空', trigger: 'change' }]
})
/**
* @returns {Array}
*/
export const SparePartsApplyDetail = 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 SparePartsApplyDetailRules = reactive({
applyQty: [{ required: true, message: '请输入标包数量', trigger: 'blur' }]
})

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

@ -0,0 +1,372 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="SparePartsApplyMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SparePartsApplyMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="SparePartsApplyMainRules"
:formAllSchemas="SparePartsApplyMain.allSchemas"
:tableAllSchemas="SparePartsApplyDetail.allSchemas"
:tableFormRules="SparePartsApplyDetailRules"
:tableData="tableData"
:apiUpdate="SparePartsApplyMainApi.updateSparePartsApplyMain"
:apiCreate="SparePartsApplyMainApi.createSparePartsApplyMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SparePartsApplyMain.allSchemas"
:detailAllSchemas="SparePartsApplyDetail.allSchemas"
:detailAllSchemasRules="SparePartsApplyDetailRules"
:apiCreate="SparePartsApplyDetailApi.createSparePartsApplyDetail"
:apiUpdate="SparePartsApplyDetailApi.updateSparePartsApplyDetail"
:apiPage="SparePartsApplyDetailApi.getSparePartsApplyDetailPage"
:apiDelete="SparePartsApplyDetailApi.deleteSparePartsApplyDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="false"
:detailButtonIsShow="true"
/>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/sparePartsApplyDetail/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
SparePartsApplyMain,
SparePartsApplyMainRules,
SparePartsApplyDetail,
SparePartsApplyDetailRules
} from './SparePartsApply.data'
import * as SparePartsApplyMainApi from '@/api/eam/sparePartsApplyMain'
import * as SparePartsApplyDetailApi from '@/api/eam/sparePartsApplyDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
//
defineOptions({ name: 'SparePartsApply' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(SparePartsApplyMain.allSchemas.tableColumns)
//
const 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: SparePartsApplyMainApi.getSparePartsApplyMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn(null), //
// defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
const 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, 'basicSparePartsApplyMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await SparePartsApplyMainApi.deleteSparePartsApplyMain(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 列表导出按钮操作 */
const exportLoading = ref(false) //
const handleMainExport = async (id: number) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SparePartsApplyMainApi.exportSparePartsApplyMain(id)
download.excel(data, '盘点工单.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 关闭按钮操作 */
// const handleClose = async (id: number) => {
// try {
// //
// await message.confirm('')
// //
// await SparePartsApplyMainApi.closeSparePartsApplyMain(id)
// message.success(t('!'))
// //
// await getList()
// } catch {}
// }
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SparePartsApplyMainApi.exportSparePartsApplyMain(tableObject.params)
download.excel(data, '备件申领记录主.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/**
* tableForm方法
*/
const tableFormKeys = {}
SparePartsApplyDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await SparePartsApplyMainApi.createSparePartsApplyMain(data)
message.success(t('common.createSuccess'))
} else {
await SparePartsApplyMainApi.updateSparePartsApplyMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购订单主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SparePartsApplyMainApi.importTemplate()
})
</script>

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

@ -0,0 +1,379 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search
:schema="SparePartsInLocationMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="SparePartsInLocationMain.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="SparePartsInLocationMainRules"
:formAllSchemas="SparePartsInLocationMain.allSchemas"
:tableAllSchemas="SparePartsInLocationDetail.allSchemas"
:tableFormRules="SparePartsInLocationDetailRules"
:tableData="tableData"
:apiUpdate="SparePartsInLocationMainApi.updateSparePartsApplyMain"
:apiCreate="SparePartsInLocationMainApi.createSparePartsApplyMain"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="SparePartsInLocationMain.allSchemas"
:detailAllSchemas="SparePartsInLocationDetail.allSchemas"
:detailAllSchemasRules="SparePartsInLocationDetailRules"
:apiCreate="SparePartsInLocationDetailApi.createSparePartsInLocationDetail"
:apiUpdate="SparePartsInLocationDetailApi.updateSparePartsInLocationDetail"
:apiPage="SparePartsInLocationDetailApi.getSparePartsInLocationDetailPage"
:apiDelete="SparePartsInLocationDetailApi.deleteSparePartsInLocationDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
:isShowAddBtn="true"
:detailButtonIsShowAdd="true"
:detailButtonIsShowAddStatusArray="['0']"
/>
<!-- 导入 -->
<ImportForm
ref="importFormRef"
url="/eam/sparePartsApplyDetail/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {
SparePartsInLocationMain,
SparePartsInLocationMainRules,
SparePartsInLocationDetail,
SparePartsInLocationDetailRules
} 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'
//
defineOptions({ name: 'SparePartsApply' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const formRef = ref()
const tableColumns = ref(SparePartsInLocationMain.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 (type == 'tableForm') {
if (formField == 'sparePartsCode') {
row['sparePartsCode'] = val[0].itemNumber
row['currentQty'] = val[0].qty
}
} else {
if (formField == 'locationCode') {
setV['locationCode'] = val[0].code
setV['areaCode'] = val[0].areaCode
}
}
formRef.setValues(setV)
})
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
if (formField == 'sparePartsCode') {
setV['sparePartsCode'] = val[0].itemNumber
setV['currentQty'] = val[0].qty
}
formRef.setValues(setV)
})
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: SparePartsInLocationMainApi.getSparePartsInLocationMainPage //
})
//
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.mainListEditBtn({ hasPermi: 'wms:sparePartsInLocationMain:update' }) //
// defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:sparePartsInLocationMain:delete' }) //
]
}
// -
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 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 handleMainExport = async (id: number) => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await SparePartsInLocationMainApi.exportSparePartsInLocationMain(id)
download.excel(data, '盘点工单.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 关闭按钮操作 */
// const handleClose = async (id: number) => {
// try {
// //
// await message.confirm('')
// //
// await SparePartsApplyMainApi.closeSparePartsApplyMain(id)
// message.success(t('!'))
// //
// await getList()
// } catch {}
// }
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await 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() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await SparePartsInLocationMainApi.importTemplate()
})
</script>

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

@ -0,0 +1,327 @@
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],
// status: [required],
// areaCode: [required],
// locationCode: [required],
concurrencyStamp: [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: false,
isForm: false,
},
{
label: '入库主题',
field: 'theme',
sort: 'custom',
isSearch: false,
},
{
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,
},
{
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'
}
},
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: '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
}
]
}
},
},
{
label: '库区编号',
field: 'areaCode',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
{
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: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isDetail:false
}
]))
// 备件入库子表
export const SparePartsInLocationDetailRules = reactive({
number: [required],
masterId: [required],
sparePartsCode: [required],
applyQty: [required],
concurrencyStamp: [required],
})
export const SparePartsInLocationDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
isTableForm:false
},
{
label: '单号',
field: 'number',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isTableForm:false
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
isSearch: false,
isTable: false,
isForm: false,
isTableForm:false
},
{
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: '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
}
]))

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

@ -51,10 +51,27 @@
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ToolAccounts.allSchemas" /> <DetailLedger
ref="detailRef"
:isBasic="true"
:allSchemas="ToolAccounts.allSchemas"
:subTabs="subTabList"
:operationRecordList="operationRecordList"
@handleOperationTabsChange="handleOperationTabsChange"
:detailAllSchemas="detailAllSchemas"
:apiPage="apiPage"
:dialogApiPage="dialogApiPage"
:dialogAllSchemas="dialogAllSchemas"
:dynamicInfoFields="dynamicInfoFields"
funcCode="tool_mould_file"
/>
<!-- 主要部件 -->
<SearchTable ref="searchTableRef" @searchTableSuccess="submitEquipmentMainPartRelation" />
<!-- 备件 -->
<SearchTable ref="searchSparePartTableRef" @searchTableSuccess="submitSparePartRelation" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/tool-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/eam/tool/tool-accounts/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -65,6 +82,34 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import * as RelationMainPartApi from '@/api/eam/relationMainPart'
import { EquipmentMainPart,EquipmentMainPartRules } from '../equipmentMainPart/equipmentMainPart.data'
import * as EquipmentMainPartApi from '@/api/eam/equipmentMainPart'
import { SparePart,SparePartRules } from '../sparePart/sparePart.data'
import * as SparePartApi from '@/api/eam/sparePart'
import * as EquipmentToolSparePartApi from '@/api/eam/equipmentToolSparePart'
import { EquipmentReportRepairRequest,EquipmentReportRepairRequestRules } from '../equipmentReportRepairRequest/equipmentReportRepairRequest.data'
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest'
import { EquipmentSpotCheckRecordMain,EquipmentSpotCheckRecordMainRules } from '../equipmentSpotCheckRecordMain/equipmentSpotCheckRecordMain.data'
import * as EquipmentSpotCheckRecordMainApi from '@/api/eam/equipmentSpotCheckRecordMain'
import { EquipmentSpotCheckRecordDetail,EquipmentSpotCheckRecordDetailRules } from '../equipmentSpotCheckRecordDetail/equipmentSpotCheckRecordDetail.data'
import * as EquipmentSpotCheckRecordDetailApi from '@/api/eam/equipmentSpotCheckRecordDetail'
import { EquipmentInspectionRecordMain,EquipmentInspectionRecordMainRules } from '../equipmentInspectionRecordMain/equipmentInspectionRecordMain.data'
import * as EquipmentInspectionRecordMainApi from '@/api/eam/equipmentInspectionRecordMain'
import { EquipmentInspectionRecordDetail,EquipmentInspectionRecordDetailRules } from '../equipmentInspectionRecordDetail/equipmentInspectionRecordDetail.data'
import * as EquipmentInspectionRecordDetailApi from '@/api/eam/equipmentInspectionRecordDetail'
import { EquipmentRepairRecordMain,EquipmentRepairRecordMainRules } from '../equipmentRepairRecordMain/equipmentRepairRecordMain.data'
import * as EquipmentRepairRecordMainApi from '@/api/eam/equipmentRepairRecordMain'
import { EquipmentRepairRecordDetail,EquipmentRepairRecordDetailRules } from '../equipmentRepairRecordDetail/equipmentRepairRecordDetail.data'
import * as EquipmentRepairRecordDetailApi from '@/api/eam/equipmentRepairRecordDetail'
import { EquipmentMaintenanceRecordMain,EquipmentMaintenanceRecordMainRules } from '../equipmentMaintenanceRecordMain/equipmentMaintenanceRecordMain.data'
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain'
import { EquipmentMaintenanceRecordDetail,EquipmentMaintenanceRecordDetailRules } from '../equipmentMaintenanceRecordDetail/equipmentMaintenanceRecordDetail.data'
import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail'
import * as WorkshopApi from '@/api/wms/workshop'
import * as ProductionlineApi from '@/api/wms/productionline'
import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier'
import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer'
defineOptions({ name: 'ToolAccounts' }) defineOptions({ name: 'ToolAccounts' })
@ -75,12 +120,38 @@ const route = useRoute() // 路由信息
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(ToolAccounts.allSchemas.tableColumns) const tableColumns = ref(ToolAccounts.allSchemas.tableColumns)
const tabs = ref<{ label: string; prop: string; }[]>([])
const subTabList = ref([]);
const detailAllSchemas = ref()
const apiPage = ref()
const dialogApiPage = ref()
const dialogAllSchemas = ref()
const operationRecordList = ref([
{label:'报修记录',value:'report'},
{label:'维修记录',value:'repair'},
{label:'保养记录',value:'maintenance'},
{label:'巡检记录',value:'inspection'},
{label:'点检记录',value:'spot_check'},
])
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if(formField == 'workshopName'){
setV['workshopCode'] = val[0]['code']
setV['workshopName'] = val[0]['name']
}else if(formField == 'lineName'){
setV['lineCode'] = val[0]['code']
setV['lineName'] = val[0]['name']
}else if(formField == 'manufactureName'){
setV['manufactureCode'] = val[0]['number']
setV['manufactureName'] = val[0]['name']
}else if(formField == 'supplierName'){
setV['supplierCode'] = val[0]['number']
setV['supplierName'] = val[0]['name']
}
formRef.setValues(setV) formRef.setValues(setV)
}) })
} }
@ -134,7 +205,9 @@ const buttonBaseClick = (val, item) => {
// - // -
const butttondata = [ const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:tool-accounts:update'}), // defaultButtons.mainListEditBtn({hasPermi:'eam:tool-accounts:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'eam:tool-accounts:delete'}), // defaultButtons.componentBtn({hasPermi:'eam:tool-accounts:component'}), //
defaultButtons.sparePartBtn({hasPermi:'eam:tool-accounts:item'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:tool-accounts:delete'}), //
] ]
// - // -
@ -143,12 +216,26 @@ const buttonTableClick = async (val, row) => {
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} else if (val == 'component') { //
openComponent(row)
} else if (val == 'sparePart') { //
openSparePart(row)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
const basicFormRef = ref() const basicFormRef = ref()
const openForm = (type: string, row?: any) => { const openForm = async (type: string, row?: any) => {
if(type == 'update'){
const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({})
const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({})
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({})
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({});
row.workshopName = workshopNoPage?.find(item=>item.code == row.workshopCode)?.name
row.lineName = productionlineNoPage?.find(item=>item.code == row.lineCode)?.name
row.manufactureName = equipmentManufacturerNoPage?.find(item=>item.number == row.manufactureCode)?.name
row.supplierName = equipmentSupplierNoPage?.find(item=>item.number == row.supplierCode)?.name
}
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
@ -178,6 +265,16 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const dynamicInfoFields = ref([
"totalRunningTime",
"maintenanceRunningTime",
"usageTimes",
"lastInspectionDate",
"outageRate",
"breakdownRecover",
"purchaseInterval"
]);
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicToolAccounts') detailRef.value.openDetail(row, titleName, titleValue, 'basicToolAccounts')
} }
@ -235,6 +332,132 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
const handleOperationTabsChange = (val) => {
if(val == 'report'){
apiPage.value = EquipmentReportRepairRequestApi.getEquipmentReportRepairRequestPage
detailAllSchemas.value = EquipmentReportRepairRequest.allSchemas
}else if(val == 'repair'){
apiPage.value = EquipmentRepairRecordMainApi.getEquipmentRepairRecordMainPage
detailAllSchemas.value = EquipmentRepairRecordMain.allSchemas
dialogApiPage.value = EquipmentRepairRecordDetailApi.getEquipmentRepairRecordDetailPage
dialogAllSchemas.value = EquipmentRepairRecordDetail.allSchemas
}else if(val == 'maintenance'){
apiPage.value = EquipmentMaintenanceRecordMainApi.getEquipmentMaintenanceRecordMainPage
detailAllSchemas.value = EquipmentMaintenanceRecordMain.allSchemas
dialogApiPage.value = EquipmentMaintenanceRecordDetailApi.getEquipmentMaintenanceRecordDetailPage
dialogAllSchemas.value = EquipmentMaintenanceRecordDetail.allSchemas
}else if(val == 'inspection'){
apiPage.value = EquipmentInspectionRecordMainApi.getEquipmentInspectionRecordMainPage
detailAllSchemas.value = EquipmentInspectionRecordMain.allSchemas
dialogApiPage.value = EquipmentInspectionRecordDetailApi.getEquipmentInspectionRecordDetailPage
dialogAllSchemas.value = EquipmentInspectionRecordDetail.allSchemas
}else if(val == 'spot_check'){
apiPage.value = EquipmentSpotCheckRecordMainApi.getEquipmentSpotCheckRecordMainPage
detailAllSchemas.value = EquipmentSpotCheckRecordMain.allSchemas
dialogApiPage.value = EquipmentSpotCheckRecordDetailApi.getEquipmentSpotCheckRecordDetailPage
dialogAllSchemas.value = EquipmentSpotCheckRecordDetail.allSchemas
}
}
const searchTableRef = ref()
const searchSparePartTableRef = ref()
const searchTableSelections = ref([])
const searchTableSparePartSelections = ref([])
const syncData = async (row) => {
searchTableSparePartSelections.value = []
await RelationMainPartApi.getRelationMainPartNoPage({ equipmentCode: row.code,type: 'EQUIPMENT' }).then(async (res) => {
await EquipmentMainPartApi.getEquipmentMainPartNoPage({type: 'EQUIPMENT'}).then(response => {
searchTableSelections.value = response.filter(element => {
let flag = false;
res.forEach(item => {
if (element.code == item.mainPartCode) {
flag = true;
}
});
return flag;
});
});
});
};
const syncSparePartData = async (row) => {
searchTableSparePartSelections.value = []
await EquipmentToolSparePartApi.getEquipmentToolSparePartNoPage({ equipmentToolCode: row.code}).then(async (res) => {
await SparePartApi.getSparePartNoPage({}).then(response => {
searchTableSparePartSelections.value = response.filter(element => {
let flag = false;
res.forEach(item => {
if (element.code == item.sparePartCode) {
flag = true;
}
});
return flag;
});
});
});
};
/** 绑定备件操作 */
const openComponent = async (row : any) => {
await syncData(row)
searchTableRef.value.open(
'选择部件',
EquipmentMainPart.allSchemas,
EquipmentMainPartApi.getEquipmentMainPartPage,
'equipmentMainPart',
EquipmentMainPart.allSchemas.searchSchema,
true,
null,//type
row,
{type: 'EQUIPMENT'},
null,
null,
null,
searchTableSelections.value
)
}
const openSparePart = async (row : any) => {
await syncSparePartData(row)
searchSparePartTableRef.value.open(
'选择备件',
SparePart.allSchemas,
SparePartApi.getSparePartPage,
'sparePartPart',
SparePart.allSchemas.searchSchema,
true,
null,//type
row,
null,
null,
null,
null,
searchTableSparePartSelections.value
)
}
const submitEquipmentMainPartRelation = (formField, searchField, val, formRef, rowRef) => {
const deviceMainPartRelList = val.map((element) => ({
mainPartCode: element.code,
equipmentCode: rowRef.code,
type: 'EQUIPMENT'
}))
RelationMainPartApi.createRelationMainPartBatch(deviceMainPartRelList).then(res => {
message.success(t('common.createSuccess'))
getList()
})
}
const submitSparePartRelation = (formField, searchField, val, formRef, rowRef) => {
const equipmentToolSparePartRelList = val.map((element) => ({
sparePartCode: element.code,
equipmentToolCode: rowRef.code,
type: 'EQUIPMENT'
}))
EquipmentToolSparePartApi.createEquipmentToolSparePartBatch(equipmentToolSparePartRelList).then(res => {
message.success(t('common.createSuccess'))
getList()
})
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

405
src/views/eam/toolAccounts/toolAccounts.data.ts

@ -1,6 +1,27 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as ConfigApi from '@/api/infra/config'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier'
import { EquipmentSupplier } from '@/views/eam/equipmentSupplier/equipmentSupplier.data'
import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer'
import { EquipmentManufacturer } from '@/views/eam/equipmentManufacturer/equipmentManufacturer.data'
import * as ProductionlineApi from '@/api/wms/productionline'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({})
const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({})
const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({})
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({});
const autoCodeSwitch = await ConfigApi.getConfigKey('deviceCodeAutoSwitch')
// ProductionlineApi.getProductionlinePage
const autoSwitch = ref(false)
if (autoCodeSwitch == 'TRUE') {
autoSwitch.value = true
}
// 表单校验 // 表单校验
export const ToolAccountsRules = reactive({ export const ToolAccountsRules = reactive({
code: [required], code: [required],
@ -14,7 +35,8 @@ export const ToolAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'code', field: 'code',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false, isForm: !autoSwitch.value,
fixed: 'left'
}, },
{ {
label: '名称', label: '名称',
@ -33,6 +55,8 @@ export const ToolAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'type', field: 'type',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
dictType: DICT_TYPE.TOOL_CLASS,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: { form: {
component: 'Select' component: 'Select'
} }
@ -54,12 +78,14 @@ export const ToolAccounts = useCrudSchemas(reactive<CrudSchema[]>([
field: 'isCustomerAptitude', field: 'isCustomerAptitude',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: { form: {
component: 'Switch' component: 'Radio'
} }
}, },
{ {
label: '客户id', label: '客户',
field: 'customerId', field: 'customerId',
sort: 'custom', sort: 'custom',
isSearch: false isSearch: false
@ -94,7 +120,7 @@ export const ToolAccounts = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
form: { form: {
component: 'Switch' component: 'Select'
} }
}, },
{ {
@ -120,10 +146,51 @@ export const ToolAccounts = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '供应商编号', label: '供应商',
field: 'supplierCode', field: 'supplierCode',
sort: 'custom', sort: 'custom',
isSearch: false isSearch: true,
isDetail: false,
isForm: false,
isTable: true,
isTableForm: false,
search: {
component: 'Select',
componentProps: {
options: equipmentSupplierNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
filterable: true,
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: string) => {
return equipmentSupplierNoPage.find((item) => item.number == cellValue)?.name
},
},
{
label: '供应商',
field: 'supplierName',
sort: 'custom',
isSearch: false,
isTable: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: EquipmentSupplier.allSchemas, // 查询弹窗所需类
searchPage: EquipmentSupplierApi.getEquipmentSupplierPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
}, },
{ {
label: '采购时间', label: '采购时间',
@ -182,10 +249,49 @@ export const ToolAccounts = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '生产厂商编码', label: '生产厂商',
field: 'manufactureCode', field: 'manufactureCode',
sort: 'custom', sort: 'custom',
isSearch: false isSearch: true,
isDetail: false,
isForm: false,
isTable: true,
isTableForm: false,
search: {
component: 'Select',
componentProps: {
options: equipmentManufacturerNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'number'
}
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: string) => {
return equipmentManufacturerNoPage.find((item) => item.number == cellValue)?.name
},
},
{
label: '生产厂商',
field: 'manufactureName',
sort: 'custom',
isSearch: false,
isTable: false,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择厂商', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '生产厂商', // 查询弹窗标题
searchAllSchemas: EquipmentManufacturer.allSchemas, // 查询弹窗所需类
searchPage: EquipmentManufacturerApi.getEquipmentManufacturerPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
}, },
{ {
label: '设备使用寿命', label: '设备使用寿命',
@ -221,24 +327,173 @@ export const ToolAccounts = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: false isSearch: false
}, },
// {
// label: '所属厂区编号',
// field: 'factoryAreaCode',
// sort: 'custom',
// isSearch: true
// },
{ {
label: '所属厂区编号', label: '车间编号',
field: 'factoryAreaCode', field: 'workshopCode',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
isDetail: false,
isForm: false,
isTable: true,
isTableForm: false,
search: {
component: 'Select',
componentProps: {
options: workshopNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'code'
},
filterable: true,
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: string) => {
return workshopNoPage.find((item) => item.code == cellValue)?.name
},
}, },
{ {
label: '车间编号', label: '车间编号',
field: 'workshopCode', field: 'workshopName',
sort: 'custom', sort: 'custom',
isSearch: true isTable: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
disable:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
}, },
{ {
label: '工段编号', label: '产线编号',
field: 'workshopSectionCode', field: 'lineCode',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
isDetail: false,
isForm: false,
isTable: true,
isTableForm: false,
search: {
component: 'Select',
componentProps: {
options: productionlineNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'code'
},
filterable: true,
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: string) => {
return productionlineNoPage.find((item) => item.code == cellValue)?.name
},
},
{
label: '产线编号',
field: 'lineName',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
multiple:true,
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition: [{
key:'workshopCode',
value:'workshopCode',
message: '请填写车间代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}, },
// {
// label: '工序编号',
// field: 'processCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择工序代码',
// searchField: 'code',
// searchTitle: '工序信息',
// searchAllSchemas: Process.allSchemas,
// searchPage: ProcessApi.getProcessPage,
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// },
// },
// {
// label: '工位编号',
// field: 'workstationCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择工位', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '工位信息', // 查询弹窗标题
// searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
// searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key:'available',
// value:'TRUE',
// isMainValue: false
// }]
// }
// },
// },
{ {
label: '部门', label: '部门',
field: 'departmentCode', field: 'departmentCode',
@ -267,6 +522,124 @@ export const ToolAccounts = useCrudSchemas(reactive<CrudSchema[]>([
// } // }
// } // }
// }, // },
{
label: '平均故障间隔时间',
field: 'purchaseInterval',
sort: 'custom',
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: false,
},
{
label: '总运行时长',
field: 'totalRunningTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: 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: 'maintenanceRunningTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: 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: 'usageTimes',
sort: 'custom',
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: false,
},
{
label: '上一次检验日期',
field: 'lastInspectionDate',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: 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: 'outageRate',
sort: 'custom',
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: false,
},
{
label: '平均故障恢复时间',
field: 'breakdownRecover',
sort: 'custom',
isSearch: false,
isDetail: false,
isTable: true,
isForm: false,
isTableForm: false,
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',

290
src/views/eam/toolEquipmentIn/index.vue

@ -0,0 +1,290 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ToolEquipmentIn.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ToolEquipmentIn.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ToolEquipmentInRules"
:formAllSchemas="ToolEquipmentIn.allSchemas"
:apiUpdate="ToolEquipmentInApi.updateToolEquipmentIn"
:apiCreate="ToolEquipmentInApi.createToolEquipmentIn"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ToolEquipmentIn.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/tool/tool-equipment-in/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ToolEquipmentIn,ToolEquipmentInRules } from './toolEquipmentIn.data'
import * as ToolEquipmentInApi from '@/api/eam/toolEquipmentIn'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import * as RelationMainPartApi from '@/api/eam/relationMainPart'
import * as EquipmentMainPartApi from '@/api/eam/equipmentMainPart'
import * as SparePartApi from '@/api/eam/sparePart'
import * as EquipmentToolSparePartApi from '@/api/eam/equipmentToolSparePart'
import * as EquipmentReportRepairRequestApi from '@/api/eam/equipmentReportRepairRequest'
import * as EquipmentSpotCheckRecordMainApi from '@/api/eam/equipmentSpotCheckRecordMain'
import * as EquipmentSpotCheckRecordDetailApi from '@/api/eam/equipmentSpotCheckRecordDetail'
import * as EquipmentInspectionRecordMainApi from '@/api/eam/equipmentInspectionRecordMain'
import * as EquipmentInspectionRecordDetailApi from '@/api/eam/equipmentInspectionRecordDetail'
import * as EquipmentRepairRecordMainApi from '@/api/eam/equipmentRepairRecordMain'
import * as EquipmentRepairRecordDetailApi from '@/api/eam/equipmentRepairRecordDetail'
import * as EquipmentMaintenanceRecordMainApi from '@/api/eam/equipmentMaintenanceRecordMain'
import * as EquipmentMaintenanceRecordDetailApi from '@/api/eam/equipmentMaintenanceRecordDetail'
import * as WorkshopApi from '@/api/wms/workshop'
import * as ProductionlineApi from '@/api/wms/productionline'
import * as EquipmentSupplierApi from '@/api/eam/equipmentSupplier'
import * as EquipmentManufacturerApi from '@/api/eam/equipmentManufacturer'
import * as ToolAccountsApi from '@/api/eam/toolAccounts'
defineOptions({ name: 'ToolEquipmentIn' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ToolEquipmentIn.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if(formField == 'workshopName'){
setV['workshopCode'] = val[0]['code']
setV['workshopName'] = val[0]['name']
}else if(formField == 'lineName'){
setV['lineCode'] = val[0]['code']
setV['lineName'] = val[0]['name']
}else if(formField == 'manufactureName'){
setV['manufactureCode'] = val[0]['number']
setV['manufactureName'] = val[0]['name']
}else if(formField == 'supplierName'){
setV['supplierCode'] = val[0]['number']
setV['supplierName'] = val[0]['name']
}else if(formField == 'toolName'){
setV['toolCode'] = val[0]['code']
setV['toolName'] = val[0]['name']
}
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: ToolEquipmentInApi.getToolEquipmentInPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:tool-equipment-in:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:tool-equipment-in:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:tool-equipment-in:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:tool-equipment-in:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:tool-equipment-in:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = async (type: string, row?: any) => {
if(type == 'update'){
const equipmentManufacturerNoPage = await EquipmentManufacturerApi.getEquipmentManufacturerNoPage({})
const equipmentSupplierNoPage = await EquipmentSupplierApi.getEquipmentSupplierNoPage({})
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({})
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({});
const toolAccountsListNoPage = await ToolAccountsApi.getToolAccountsNoPage({});
row.toolName = toolAccountsListNoPage?.find(item=>item.code == row.workshopCode)?.name
row.workshopName = workshopNoPage?.find(item=>item.code == row.workshopCode)?.name
row.lineName = productionlineNoPage?.find(item=>item.code == row.lineCode)?.name
row.manufactureName = equipmentManufacturerNoPage?.find(item=>item.number == row.manufactureCode)?.name
row.supplierName = equipmentSupplierNoPage?.find(item=>item.number == row.supplierCode)?.name
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ToolEquipmentIn.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 ToolEquipmentInApi.createToolEquipmentIn(data)
message.success(t('common.createSuccess'))
} else {
await ToolEquipmentInApi.updateToolEquipmentIn(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, 'basicToolEquipmentIn')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ToolEquipmentInApi.deleteToolEquipmentIn(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 ToolEquipmentInApi.exportToolEquipmentIn(tableObject.params)
download.excel(data, '工装入库记录.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '工装入库记录导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ToolEquipmentInApi.importTemplate()
})
</script>

350
src/views/eam/toolEquipmentIn/toolEquipmentIn.data.ts

@ -0,0 +1,350 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import * as ProductionlineApi from '@/api/wms/productionline'
import { Productionline } from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
import { ToolAccounts} from '../toolAccounts/toolAccounts.data'
import * as ToolAccountsApi from '@/api/eam/toolAccounts'
const workshopNoPage = await WorkshopApi.getWorkshopNoPage({})
const productionlineNoPage = await ProductionlineApi.getProductionlineNoPage({});
const toolAccountsListNoPage = await ToolAccountsApi.getToolAccountsNoPage({});
// 表单校验
export const ToolEquipmentInRules = reactive({
toolCode: [required],
status: [required]
})
export const ToolEquipmentIn = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '工装',
field: 'toolCode',
sort: 'custom',
isSearch: true,
isDetail: false,
isForm: false,
isTable: true,
isTableForm: false,
search: {
component: 'Select',
componentProps: {
options: toolAccountsListNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'code'
},
filterable: true,
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: string) => {
return toolAccountsListNoPage.find((item) => item.code == cellValue)?.name
},
},
{
label: '工装',
field: 'toolName',
sort: 'custom',
isSearch: false,
isDetail: false,
isForm: true,
isTable: false,
isTableForm: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择工装', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '工装信息', // 查询弹窗标题
searchAllSchemas: ToolAccounts.allSchemas, // 查询弹窗所需类
searchPage: ToolAccountsApi.getToolAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '入库信息描述',
field: 'describing',
sort: 'custom',
isSearch: true,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
}
},
{
label: '入库审核状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.JOB_STATUS,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Select'
}
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
}
},
{
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: 'factoryAreaCode',
// sort: 'custom',
// isSearch: true
// },
{
label: '车间编号',
field: 'workshopCode',
sort: 'custom',
isSearch: true,
isDetail: false,
isForm: false,
isTable: true,
isTableForm: false,
search: {
component: 'Select',
componentProps: {
options: workshopNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'code'
},
filterable: true,
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: string) => {
return workshopNoPage.find((item) => item.code == cellValue)?.name
},
},
{
label: '车间编号',
field: 'workshopName',
sort: 'custom',
isSearch: false,
isDetail: false,
isForm: true,
isTable: false,
isTableForm: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
disable:true,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '产线编号',
field: 'lineCode',
sort: 'custom',
isSearch: true,
isDetail: false,
isForm: false,
isTable: true,
isTableForm: false,
search: {
component: 'Select',
componentProps: {
options: productionlineNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'code'
},
filterable: true,
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: string) => {
return productionlineNoPage.find((item) => item.code == cellValue)?.name
},
},
{
label: '产线编号',
field: 'lineName',
sort: 'custom',
isSearch: false,
isDetail: false,
isForm: true,
isTable: false,
isTableForm: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线代码', // 输入框占位文本
multiple:true,
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
searchCondition: [{
key:'workshopCode',
value:'workshopCode',
message: '请填写车间代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
},
// {
// label: '工序编号',
// field: 'processCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择工序代码',
// searchField: 'code',
// searchTitle: '工序信息',
// searchAllSchemas: Process.allSchemas,
// searchPage: ProcessApi.getProcessPage,
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// },
// },
// {
// label: '工位编号',
// field: 'workstationCode',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择工位', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '工位信息', // 查询弹窗标题
// searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
// searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key:'productionLineCode',
// value:'lineCode',
// message: '请填写生产线代码!',
// isMainValue: true
// },{
// key:'workshopCode',
// value:'workshopCode',
// message: '请填写车间代码!',
// isMainValue: true
// },{
// key:'available',
// value:'TRUE',
// isMainValue: false
// }]
// }
// },
// },
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
}
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: false,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

253
src/views/eam/toolEquipmentOut/index.vue

@ -0,0 +1,253 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ToolEquipmentOut.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ToolEquipmentOut.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="ToolEquipmentOutRules"
:formAllSchemas="ToolEquipmentOut.allSchemas"
:apiUpdate="ToolEquipmentOutApi.updateToolEquipmentOut"
:apiCreate="ToolEquipmentOutApi.createToolEquipmentOut"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="ToolEquipmentOut.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/eam/tool/tool-equipment-out/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ToolEquipmentOut,ToolEquipmentOutRules } from './toolEquipmentOut.data'
import * as ToolEquipmentOutApi from '@/api/eam/toolEquipmentOut'
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 ToolAccountsApi from '@/api/eam/toolAccounts'
defineOptions({ name: 'ToolEquipmentOut' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ToolEquipmentOut.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
if(formField == 'toolName'){
setV['toolCode'] = val[0]['code']
setV['toolName'] = val[0]['name']
}
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: ToolEquipmentOutApi.getToolEquipmentOutPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'eam:tool-equipment-out:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'eam:tool-equipment-out:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'eam:tool-equipment-out:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'eam:tool-equipment-out:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'eam:tool-equipment-out:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = async (type: string, row?: any) => {
if(type == 'update'){
const toolAccountsListNoPage = await ToolAccountsApi.getToolAccountsNoPage({});
row.toolName = toolAccountsListNoPage?.find(item=>item.code == row.toolCode)?.name
}
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =ToolEquipmentOut.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 ToolEquipmentOutApi.createToolEquipmentOut(data)
message.success(t('common.createSuccess'))
} else {
await ToolEquipmentOutApi.updateToolEquipmentOut(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, 'basicToolEquipmentOut')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ToolEquipmentOutApi.deleteToolEquipmentOut(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 ToolEquipmentOutApi.exportToolEquipmentOut(tableObject.params)
download.excel(data, '工装出库记录.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '工装出库记录导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ToolEquipmentOutApi.importTemplate()
})
</script>

230
src/views/eam/toolEquipmentOut/toolEquipmentOut.data.ts

@ -0,0 +1,230 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { ToolAccounts} from '../toolAccounts/toolAccounts.data'
import * as ToolAccountsApi from '@/api/eam/toolAccounts'
import * as UserApi from '@/api/system/user'
const toolAccountsListNoPage = await ToolAccountsApi.getToolAccountsNoPage({});
const userListNoPage = await UserApi.getSimpleUserList();
// 表单校验
export const ToolEquipmentOutRules = reactive({
theme: [required],
toolCode: [required],
type: [required],
qty: [required],
status: [required],
applyer: [required],
concurrencyStamp: [required]
})
export const ToolEquipmentOut = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '工装',
field: 'toolCode',
sort: 'custom',
isSearch: true,
isDetail: false,
isForm: false,
isTable: true,
isTableForm: false,
search: {
component: 'Select',
componentProps: {
options: toolAccountsListNoPage,
optionsAlias: {
labelField: 'name',
valueField: 'code'
},
filterable: true,
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: string) => {
return toolAccountsListNoPage.find((item) => item.code == cellValue)?.name
},
},
{
label: '工装',
field: 'toolName',
sort: 'custom',
isSearch: false,
isDetail: false,
isForm: true,
isTable: false,
isTableForm: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择工装', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '工装信息', // 查询弹窗标题
searchAllSchemas: ToolAccounts.allSchemas, // 查询弹窗所需类
searchPage: ToolAccountsApi.getToolAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '出库主题',
field: 'theme',
sort: 'custom',
isSearch: true
},
{
label: '出库类型',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.TOOL_OUT_TYPE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Select'
}
},
{
label: '数量',
field: 'qty',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '流程状态',
field: 'status',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.JOB_STATUS,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select',
}
},
{
label: '出库申请人',
field: 'applyer',
sort: 'custom',
isSearch: true,
form: {
component: 'Select',
componentProps: {
options: userListNoPage,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
}
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListNoPage.find((item) => item.id == cellValue)?.nickname
},
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: true,
form: {
component: 'Select',
componentProps: {
options: userListNoPage,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
}
}
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListNoPage.find((item) => item.id == cellValue)?.nickname
},
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
}
},
{
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',
isForm: false,
},
{
label: '自动通过',
field: 'autoAgree',
sort: 'custom',
isForm: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
}
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: false,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

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

@ -0,0 +1,241 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Transaction.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Transaction.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="Rules"
:formAllSchemas="Transaction.allSchemas"
:apiUpdate="TransactionApi.updateTransaction"
:apiCreate="TransactionApi.createTransaction"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="Transaction.allSchemas" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Transaction,Rules } from './transaction.data'
import * as TransactionApi from '@/api/eam/transaction'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'Transaction' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Transaction.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: TransactionApi.getTransactionPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'item:transaction:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'item:transaction:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'item:transaction:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'item:transaction:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'item:transaction:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =Transaction.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await TransactionApi.createTransaction(data)
message.success(t('common.createSuccess'))
} else {
await TransactionApi.updateTransaction(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, 'basic')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await TransactionApi.deleteTransaction(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 TransactionApi.exportTransaction(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>

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

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

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

@ -142,7 +142,7 @@ export const Customerdock = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
// // labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
disabled:true // disabled:true
// isSearchList: true, // 开启查询弹窗 // isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择库位代码', // 输入框占位文本 // searchListPlaceholder: '请选择库位代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段 // searchField: 'code', // 查询弹窗赋值字段
@ -285,9 +285,9 @@ export const CustomerdockRules = reactive({
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }, { max: 50, message: '不得超过50个字符', trigger: 'blur' },
{ validator:validateYS, message: '请输入正确的代码', trigger: 'blur'} { validator:validateYS, message: '请输入正确的代码', trigger: 'blur'}
], ],
defaultLocationCode:[ // defaultLocationCode:[
{ required: true, message: '请选择库位代码', trigger: 'blur' }, // { required: true, message: '请选择库位代码', trigger: 'blur' },
], // ],
name: [ name: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }
], ],

13
src/views/wms/basicDataManage/itemManage/itempackage/itempackage.data.ts

@ -82,6 +82,19 @@ export const Itempackaging = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '包装名称',
field: 'packName',
sort: 'custom',
isSearch: true,
table: {
width: 120
},
isTable:true,
isTableForm:false,
isForm:false,
isDetail:false
},
{ {
label: '包装数量', label: '包装数量',
field: 'packQty', field: 'packQty',

16
src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/index.vue

@ -175,24 +175,40 @@ RelegateRequestDetail.allSchemas.tableFormColumns.map(item => {
key: 'businessType', key: 'businessType',
value: businessType, value: businessType,
isMainValue: false isMainValue: false
},{
key: 'isIn',
value: true,
isMainValue: false
}] }]
item.form.componentProps.searchCondition = [ item.form.componentProps.searchCondition = [
{ {
key: 'businessType', key: 'businessType',
value: businessType, value: businessType,
isMainValue: false isMainValue: false
},{
key: 'isIn',
value: true,
isMainValue: false
}] }]
item.tableForm.searchCondition = [ item.tableForm.searchCondition = [
{ {
key: 'businessType', key: 'businessType',
value: businessType, value: businessType,
isMainValue: false isMainValue: false
},{
key: 'isIn',
value: true,
isMainValue: false
}] }]
item.form.componentProps.searchCondition = [ item.form.componentProps.searchCondition = [
{ {
key: 'businessType', key: 'businessType',
value: businessType, value: businessType,
isMainValue: false isMainValue: false
},{
key: 'isIn',
value: true,
isMainValue: false
}] }]
} }
}) })

289
src/views/wms/countManage/count/countPlanMain/index.vue

@ -374,27 +374,27 @@ const openForm = async (type: string, row?: number) => {
] // ] //
formRef.value.open(type, row) formRef.value.open(type, row)
Promise.all([getOwnerAllList(), // Promise.all([getOwnerAllList(),
getSupplierAllList(), // getSupplierAllList(),
getCustomerAllList(), // getCustomerAllList(),
getItembasicAllList(), // getItembasicAllList(),
getWarehouseAllList(), // getWarehouseAllList(),
getAreaAllList(), // getAreaAllList(),
getLocationgroupAllList(), // getLocationgroupAllList(),
getLocationAllList()]) // getLocationAllList()])
} }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
getOwnerAllList() // getOwnerAllList()
getSupplierAllList() // getSupplierAllList()
getCustomerAllList() // getCustomerAllList()
getItembasicAllList() // getItembasicAllList()
getWarehouseAllList() // getWarehouseAllList()
getAreaAllList() // getAreaAllList()
getLocationgroupAllList() // getLocationgroupAllList()
getLocationAllList() // getLocationAllList()
detailRef.value.openDetail(row, titleName, titleValue) detailRef.value.openDetail(row, titleName, titleValue)
} }
// //
@ -417,13 +417,13 @@ const detailOpenForm = (type, row) => {
formTypeDetail.value = 'Select' formTypeDetail.value = 'Select'
switch (row.type) { switch (row.type) {
case 'OWNER': case 'OWNER':
countPlanAllList.value = allList.value.ownerAllList getOwnerAllList(null,true)
break break
case 'SUPPLIER': case 'SUPPLIER':
countPlanAllList.value = allList.value.supplierAllList getSupplierAllList(null,true)
break break
case 'CUSTOMER': case 'CUSTOMER':
countPlanAllList.value = allList.value.customerAllList getCustomerAllList(null,true)
break break
case 'ABC': case 'ABC':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -435,19 +435,19 @@ const detailOpenForm = (type, row) => {
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break break
case 'ITEMS_CODE': case 'ITEMS_CODE':
countPlanAllList.value = allList.value.itembasicAllList getItembasicAllList(null,true)
break break
case 'WAREHOUSE_CODE': case 'WAREHOUSE_CODE':
countPlanAllList.value = allList.value.warehouseAllList getWarehouseAllList(null,true)
break break
case 'AREABASIC_CODE': case 'AREABASIC_CODE':
countPlanAllList.value = allList.value.areaAllList getAreaAllList(null,true)
break break
case 'LOCATIONGROUP_CODE': case 'LOCATIONGROUP_CODE':
countPlanAllList.value = allList.value.locationgroupAllList getLocationgroupAllList(null,true)
break break
case 'LOCATION_CODE': case 'LOCATION_CODE':
countPlanAllList.value = allList.value.locationAllList getLocationAllList(null,true)
break break
} }
} else if (val == 'PROJECT') { } else if (val == 'PROJECT') {
@ -606,13 +606,13 @@ const selectChangeDetail = (field, val) => {
formTypeDetail.value = 'Select' formTypeDetail.value = 'Select'
switch (val) { switch (val) {
case 'OWNER': case 'OWNER':
countPlanAllList.value = allList.value.ownerAllList getOwnerAllList(null,true)
break break
case 'SUPPLIER': case 'SUPPLIER':
countPlanAllList.value = allList.value.supplierAllList getSupplierAllList(null,true)
break break
case 'CUSTOMER': case 'CUSTOMER':
countPlanAllList.value = allList.value.customerAllList getCustomerAllList(null,true)
break break
case 'ABC': case 'ABC':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -624,19 +624,19 @@ const selectChangeDetail = (field, val) => {
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break break
case 'ITEMS_CODE': case 'ITEMS_CODE':
countPlanAllList.value = allList.value.itembasicAllList getItembasicAllList(null,true)
break break
case 'WAREHOUSE_CODE': case 'WAREHOUSE_CODE':
countPlanAllList.value = allList.value.warehouseAllList getWarehouseAllList(null,true)
break break
case 'AREABASIC_CODE': case 'AREABASIC_CODE':
countPlanAllList.value = allList.value.areaAllList getAreaAllList(null,true)
break break
case 'LOCATIONGROUP_CODE': case 'LOCATIONGROUP_CODE':
countPlanAllList.value = allList.value.locationgroupAllList getLocationgroupAllList(null,true)
break break
case 'LOCATION_CODE': case 'LOCATION_CODE':
countPlanAllList.value = allList.value.locationAllList getLocationAllList(null,true)
break break
} }
} else if (val == 'PROJECT') { } else if (val == 'PROJECT') {
@ -664,13 +664,13 @@ const tableFormChange = async (field, val, row) => {
row.formType = 'Select' row.formType = 'Select'
switch (row.type) { switch (row.type) {
case 'OWNER': case 'OWNER':
row.initOptions = allList.value.ownerAllList getOwnerAllList(row)
break break
case 'SUPPLIER': case 'SUPPLIER':
row.initOptions = allList.value.supplierAllList getSupplierAllList(row)
break break
case 'CUSTOMER': case 'CUSTOMER':
row.initOptions = allList.value.customerAllList getCustomerAllList(row)
break break
case 'ABC': case 'ABC':
row.initOptions = getStrDictOptions(DICT_TYPE.ABC_CLASS) row.initOptions = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -682,19 +682,19 @@ const tableFormChange = async (field, val, row) => {
row.initOptions = getStrDictOptions(DICT_TYPE.ITEM_GROUP) row.initOptions = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break break
case 'ITEMS_CODE': case 'ITEMS_CODE':
row.initOptions = allList.value.itembasicAllList getItembasicAllList(row)
break break
case 'WAREHOUSE_CODE': case 'WAREHOUSE_CODE':
row.initOptions = allList.value.warehouseAllList getWarehouseAllList(row)
break break
case 'AREABASIC_CODE': case 'AREABASIC_CODE':
row.initOptions = allList.value.areaAllList getAreaAllList(row)
break break
case 'LOCATIONGROUP_CODE': case 'LOCATIONGROUP_CODE':
row.initOptions = allList.value.locationgroupAllList getLocationgroupAllList(row)
break break
case 'LOCATION_CODE': case 'LOCATION_CODE':
row.initOptions = allList.value.locationAllList getLocationAllList(row)
break break
} }
} else if (row.type == 'PROJECT') { } else if (row.type == 'PROJECT') {
@ -717,91 +717,254 @@ const allList = ref({
itemGroupList: getStrDictOptions(DICT_TYPE.ITEM_GROUP) itemGroupList: getStrDictOptions(DICT_TYPE.ITEM_GROUP)
}) })
// //
const getOwnerAllList = async () => { const getOwnerAllList = async (row,update_countPlanAllList=false) => {
OwnerApi.getOwnerList().then((res) => {
let getLoading = null
let res = null
if(!allList.value.ownerAllList||allList.value.ownerAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await OwnerApi.getOwnerList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.ownerAllList = res.map((element) => { allList.value.ownerAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.ownerAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.ownerAllList
}
} }
// //
const getSupplierAllList = async () => { const getSupplierAllList = async (row,update_countPlanAllList=false) => {
SupplierApi.getSupplierList().then((res) => { let getLoading = null
let res = null
if(!allList.value.supplierAllList||allList.value.supplierAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await SupplierApi.getSupplierList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.supplierAllList = res.map((element) => { allList.value.supplierAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.supplierAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.supplierAllList
}
} }
// //
const getCustomerAllList = async () => { const getCustomerAllList = async (row,update_countPlanAllList=false) => {
CustomerApi.getCustomerList().then((res) => { let getLoading = null
let res = null
if(!allList.value.customerAllList||allList.value.customerAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await CustomerApi.getCustomerList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.customerAllList = res.map((element) => { allList.value.customerAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.customerAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.customerAllList
}
} }
// //
const getItembasicAllList = async () => { const getItembasicAllList = async (row,update_countPlanAllList=false) => {
ItembasicApi.getItembasicList().then((res) => { let getLoading = null
let res = null
if(!allList.value.itembasicAllList||allList.value.itembasicAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await ItembasicApi.getItembasicList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.itembasicAllList = res.map((element) => { allList.value.itembasicAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name + '-'+ element.code label: element.name + '-'+ element.code
} }
}) })
}) }
if(row){
row.initOptions = allList.value.itembasicAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.itembasicAllList
}
} }
// //
const getWarehouseAllList = async () => { const getWarehouseAllList = async (row,update_countPlanAllList=false) => {
WarehouseApi.getWarehouseList({ available: 'TRUE' }).then((res) => { let getLoading = null
let res = null
if(!allList.value.warehouseAllList||allList.value.warehouseAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await WarehouseApi.getWarehouseList({ available: 'TRUE' })
} finally {
getLoading?.close()
}
}
if(res){
allList.value.warehouseAllList = res.map((element) => { allList.value.warehouseAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.warehouseAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.warehouseAllList
}
} }
// //
const getAreaAllList = async () => { const getAreaAllList = async (row,update_countPlanAllList=false) => {
AreaApi.getAreaList({ available: 'TRUE' }).then((res) => { let getLoading = null
let res = null
if(!allList.value.areaAllList||allList.value.areaAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await AreaApi.getAreaList({ available: 'TRUE' })
} finally {
getLoading?.close()
}
}
if(res){
allList.value.areaAllList = res.map((element) => { allList.value.areaAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name + '-'+ element.code label: element.name + '-'+ element.code
} }
}) })
}) }
if(row){
row.initOptions = allList.value.areaAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.areaAllList
}
} }
// //
const getLocationgroupAllList = async () => { const getLocationgroupAllList = async (row,update_countPlanAllList=false) => {
LocationgroupApi.getLocationgroupList({ available: 'TRUE' }).then((res) => { let getLoading = null
let res = null
if(!allList.value.locationgroupAllList||allList.value.locationgroupAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await LocationgroupApi.getLocationgroupList({ available: 'TRUE' })
} finally {
getLoading?.close()
}
}
if(res){
allList.value.locationgroupAllList = res.map((element) => { allList.value.locationgroupAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.locationgroupAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.locationgroupAllList
}
} }
// //
const getLocationAllList = async () => { const getLocationAllList = async (row,update_countPlanAllList=false) => {
LocationpApi.getLocationList({ available: 'TRUE' }).then((res) => { let getLoading = null
let res = null
if(!allList.value.locationAllList||allList.value.locationAllList.length==0){
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await LocationpApi.getLocationList({ available: 'TRUE' })
console.log('res',res)
}
if(res){
allList.value.locationAllList = res.map((element) => { allList.value.locationAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name + '-'+ element.code label: element.name + '-'+ element.code
} }
}) })
}
if(row){
row.initOptions = allList.value.locationAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.locationAllList
}
nextTick(()=>{
getLoading?.close()
}) })
} }
/** 初始化 **/ /** 初始化 **/

9
src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts

@ -928,6 +928,11 @@ export const CustomerreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
key: 'businessType', key: 'businessType',
value: 'CustomerReject', value: 'CustomerReject',
isMainValue: false isMainValue: false
},
{
key: 'isIn',
value: 'in',
isMainValue: false
}] }]
}, },
}, },
@ -1097,7 +1102,9 @@ export const CustomerreturnRequestDetailRules = reactive({
remark: [ remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }
], ],
packQty: [
{ required: true, message: '请选择包装数量', trigger: 'blur' }
],
}) })
export const CustomerReturnRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([ export const CustomerReturnRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([

101
src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue

@ -188,6 +188,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
row['fromLocationCode'] = val[0]['locationCode'] row['fromLocationCode'] = val[0]['locationCode']
row['itemCode'] = val[0]['itemCode'] row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom'] row['uom'] = val[0]['uom']
}else if(formField == 'packQty'){
row['packUnit'] = val[0]['packUnit']
row['packQty'] = val[0]['packQty']
}else if(formField == 'toLocationCode') { }else if(formField == 'toLocationCode') {
// //
row['toLocationCode'] = val[0]['code'] row['toLocationCode'] = val[0]['code']
@ -422,7 +425,7 @@ const buttonTableClick = async (val, row) => {
formLabelRef.value.open('create', row, null,'createLabel')// createLabel formLabelRef.value.open('create', row, null,'createLabel')// createLabel
} else if (val == 'point') { } else if (val == 'point') {
// //
labelPrint(row) handlePoint(row)
} }
} }
// //
@ -452,29 +455,78 @@ const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const labelType = ref('') // const labelType = ref('') //
// //
const showLabelRef = ref() const showLabelRef = ref()
const labelPrint = async (row) => { const handlePoint = async (row) => {
console.log(row.packingNumber,445555555555555); //
PackageApi.getBalanceToPackage(row.packingNumber).then(res => { await PackageApi.getPackagePage({
console.log(777,res); requestNumber: row.number
if (res.productionLineCode != null) { }).then((res) => {
if(res.list.length > 0) {
isCreateLabel.value = true
if (res.list[0].productionLineCode != null) {
labelType.value = 'zz' labelType.value = 'zz'
} else { } else {
labelType.value = 'cg' labelType.value = 'cg'
} }
PackageApi.batchPrintingLable((res.number)).then((resLable) =>{ } else {
console.log(159,resLable ) isCreateLabel.value = false
// }
if (labelType.value == 'cg') { }).catch(err => {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) isCreateLabel.value = false
console.log(159,resLable ) console.log(err)
window.open(src.value+'&asn_number='+resLable) })
//
if (isCreateLabel.value) {
labelPrint(row)
} else { } else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) message.warning('请先创建标签')
window.open(src.value+'&asn_number='+resLable)
} }
}) }
//
const labelPrint = async (row) => {
tableObject.loading = true
const defaultParams = {'moduleName':'customerreturn_request','recordNumber':row.number}
const {tableObject:tableObjectPrint ,tableMethods} = useTable({
defaultParams,
getListApi: PackageApi.getLabelDetailPage //
})
//
const { getList:getListPrint } = tableMethods
getListPrint()
tableObject.loading = false
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
showLabelRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true)
}
// ---退
const showLabelSuccess = async (formField, searchField, val, formRef, type, row) => {
console.log('批量打印',val)
// let rows:any = []
// val.forEach(item=>{
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)]
// })
if(val.length == 0){
message.warning("请先选择要打印的数据!")
return
}
// window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(','))
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => {
console.log(res)
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
} else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
}
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
message.error('创建标签失败')
}) })
} }
@ -705,23 +757,6 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
// ---
const showLabelSuccess = async (formField, searchField, val, formRef, type, row) => {
console.log('批量打印',val)
if(val.length == 0){
message.warning("请先选择要打印的数据!")
return
}
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => {
console.log(res)
window.open(src.value + '&asn_number=' + res)
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

2
src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/index.vue

@ -414,7 +414,7 @@ const handleExport = async () => {
const data = await DeliverPlanMainApi.exportDeliverPlanMain(tableObject.params) const data = await DeliverPlanMainApi.exportDeliverPlanMain(tableObject.params)
download.excel(data, '发货计划主.xlsx') download.excel(data, '发货计划主.xlsx')
}else{ }else{
const data = await DeliverRequestMainApi.exportZZBJDeliverPlanMain(tableObject.params) const data = await DeliverPlanMainApi.exportZZBJDeliverPlanMain(tableObject.params)
download.excel(data, '自制备件发货计划主.xlsx') download.excel(data, '自制备件发货计划主.xlsx')
} }
} catch { } catch {

19
src/views/wms/deliversettlementManage/stockup/stockupMainJob/stockupMainJob.data.ts

@ -437,8 +437,7 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '单据号', label: '单据号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, table: {
table: {
width: 150 width: 150
}, },
hiddenInMain:true hiddenInMain:true
@ -447,7 +446,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '包装号', label: '包装号',
field: 'packingNumber', field: 'packingNumber',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 150 width: 150
}, },
@ -457,7 +455,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '批次', label: '批次',
field: 'batch', field: 'batch',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 150 width: 150
}, },
@ -467,7 +464,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '库存状态', label: '库存状态',
field: 'inventoryStatus', field: 'inventoryStatus',
sort: 'custom', sort: 'custom',
isSearch: true,
form: { form: {
component: 'Radio' component: 'Radio'
}, },
@ -480,7 +476,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '货主代码', label: '货主代码',
field: 'ownerCode', field: 'ownerCode',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 120 width: 120
}, },
@ -490,7 +485,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '器具号', label: '器具号',
field: 'containerNumber', field: 'containerNumber',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 120 width: 120
}, },
@ -501,7 +495,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '物料代码', label: '物料代码',
field: 'itemCode', field: 'itemCode',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 150 width: 150
}, },
@ -510,7 +503,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '物品名称', label: '物品名称',
field: 'itemName', field: 'itemName',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 150 width: 150
}, },
@ -519,7 +511,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '物品描述1', label: '物品描述1',
field: 'itemDesc1', field: 'itemDesc1',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 120 width: 120
}, },
@ -529,7 +520,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '物品描述2', label: '物品描述2',
field: 'itemDesc2', field: 'itemDesc2',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 120 width: 120
}, },
@ -539,7 +529,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '项目代码', label: '项目代码',
field: 'projectCode', field: 'projectCode',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 120 width: 120
}, },
@ -549,7 +538,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '数量', label: '数量',
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
isSearch: true,
}, },
{ {
label: '计量单位', label: '计量单位',
@ -575,7 +563,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '从库位', label: '从库位',
field: 'fromLocationCode', field: 'fromLocationCode',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 120 width: 120
}, },
@ -584,7 +571,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '到库位', label: '到库位',
field: 'toLocationCode', field: 'toLocationCode',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 120 width: 120
}, },
@ -593,7 +579,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
isSearch: true,
hiddenInMain:true, hiddenInMain:true,
}, },
{ {
@ -601,7 +586,6 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime', field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true,
hiddenInMain:true, hiddenInMain:true,
search: { search: {
component: 'DatePicker', component: 'DatePicker',
@ -620,6 +604,7 @@ export const StockupDetailJob = useCrudSchemas(reactive<CrudSchema[]>([
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
hiddenInMain: true,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'

5
src/views/wms/deliversettlementManage/stockup/stockupMainRecord/stockupMainRecord.data.ts

@ -323,7 +323,6 @@ export const StockupDetailRecord = useCrudSchemas(reactive<CrudSchema[]>([
label: '包装号', label: '包装号',
field: 'packingNumber', field: 'packingNumber',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 150 width: 150
}, },
@ -333,7 +332,6 @@ export const StockupDetailRecord = useCrudSchemas(reactive<CrudSchema[]>([
label: '批次', label: '批次',
field: 'batch', field: 'batch',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 150 width: 150
}, },
@ -353,7 +351,6 @@ export const StockupDetailRecord = useCrudSchemas(reactive<CrudSchema[]>([
label: '物料代码', label: '物料代码',
field: 'itemCode', field: 'itemCode',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 150 width: 150
}, },
@ -362,7 +359,6 @@ export const StockupDetailRecord = useCrudSchemas(reactive<CrudSchema[]>([
label: '物品名称', label: '物品名称',
field: 'itemName', field: 'itemName',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 150 width: 150
}, },
@ -556,7 +552,6 @@ export const StockupDetailRecord = useCrudSchemas(reactive<CrudSchema[]>([
field: 'available', field: 'available',
dictType: DICT_TYPE.TRUE_FALSE, dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', dictClass: 'string',
isSearch: true,
isTable: true, isTable: true,
hiddenInMain: true, hiddenInMain: true,
sort: 'custom', sort: 'custom',

13
src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts

@ -280,6 +280,7 @@ export const StockupMainRequest = useCrudSchemas(reactive<CrudSchema[]>([
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name return userDeptArray.find((account) => account.id == cellValue)?.name
}, },
isForm:false,
form: { form: {
value: userDept.id, value: userDept.id,
component: 'Select', component: 'Select',
@ -495,7 +496,6 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '单据号', label: '单据号',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true,
isForm: false, isForm: false,
isTableForm: false, isTableForm: false,
table: { table: {
@ -593,7 +593,6 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '物料代码', label: '物料代码',
field: 'itemCode', field: 'itemCode',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 150 width: 150
}, },
@ -630,7 +629,6 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '物品名称', label: '物品名称',
field: 'itemName', field: 'itemName',
sort: 'custom', sort: 'custom',
isSearch: true,
isTableForm: false, isTableForm: false,
table: { table: {
width: 150 width: 150
@ -640,7 +638,6 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '物品描述1', label: '物品描述1',
field: 'itemDesc1', field: 'itemDesc1',
sort: 'custom', sort: 'custom',
isSearch: true,
isTableForm: false, isTableForm: false,
table: { table: {
width: 120 width: 120
@ -651,7 +648,6 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '物品描述2', label: '物品描述2',
field: 'itemDesc2', field: 'itemDesc2',
sort: 'custom', sort: 'custom',
isSearch: true,
isTableForm: false, isTableForm: false,
table: { table: {
width: 120 width: 120
@ -662,7 +658,6 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '项目代码', label: '项目代码',
field: 'projectCode', field: 'projectCode',
sort: 'custom', sort: 'custom',
isSearch: true,
isTableForm: false, isTableForm: false,
table: { table: {
width: 120 width: 120
@ -673,10 +668,9 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '数量', label: '数量',
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
isSearch: true,
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
min: 1, min: 0,
precision: 6 precision: 6
}, },
}, },
@ -712,7 +706,6 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '到库位', label: '到库位',
field: 'toLocationCode', field: 'toLocationCode',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: 120 width: 120
}, },
@ -759,7 +752,6 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注', label: '备注',
field: 'remark', field: 'remark',
sort: 'custom', sort: 'custom',
isSearch: true,
hiddenInMain: true hiddenInMain: true
}, },
{ {
@ -767,7 +759,6 @@ export const StockupDetailRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime', field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isSearch: true,
table: { table: {
width: 120 width: 120
}, },

2
src/views/wms/inventoryjobManage/inventoryinitial/inventoryinitRecordMain/index.vue

@ -222,7 +222,7 @@ const handleSelectionPoint = async ()=>{
window.open(src.value+'&asn_number='+res.cgLabel) window.open(src.value+'&asn_number='+res.cgLabel)
} }
if(!res.cgLabel&&!res.zzLabel){ if(!res.cgLabel&&!res.zzLabel){
message.error('包装不存在,无法打印') message.warning('包装不存在,无法打印或者是线边物料数据不生成包装!')
} }
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)

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

Loading…
Cancel
Save