121 changed files with 11734 additions and 632 deletions
@ -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 }) |
|||
} |
@ -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 }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -0,0 +1,59 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface EquipmentRepairJobDetailVO { |
|||
id: number |
|||
number: string |
|||
masterId: number |
|||
describing: string |
|||
faultCause: string |
|||
workOut: string |
|||
maintenances: string |
|||
departmentCode: string |
|||
remark: string |
|||
siteId: string |
|||
available: string |
|||
deletionTime: Date |
|||
deleterId: byte[] |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询维修工单子列表
|
|||
export const getEquipmentRepairJobDetailPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/eam/equipment-repair-job-detail/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/eam/equipment-repair-job-detail/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询维修工单子详情
|
|||
export const getEquipmentRepairJobDetail = async (id: number) => { |
|||
return await request.get({ url: `/eam/equipment-repair-job-detail/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增维修工单子
|
|||
export const createEquipmentRepairJobDetail = async (data: EquipmentRepairJobDetailVO) => { |
|||
return await request.post({ url: `/eam/equipment-repair-job-detail/create`, data }) |
|||
} |
|||
|
|||
// 修改维修工单子
|
|||
export const updateEquipmentRepairJobDetail = async (data: EquipmentRepairJobDetailVO) => { |
|||
return await request.put({ url: `/eam/equipment-repair-job-detail/update`, data }) |
|||
} |
|||
|
|||
// 删除维修工单子
|
|||
export const deleteEquipmentRepairJobDetail = async (id: number) => { |
|||
return await request.delete({ url: `/eam/equipment-repair-job-detail/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出维修工单子 Excel
|
|||
export const exportEquipmentRepairJobDetail = async (params) => { |
|||
return await request.download({ url: `/eam/equipment-repair-job-detail/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/eam/equipment-repair-job-detail/get-import-template' }) |
|||
} |
@ -0,0 +1,102 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface EquipmentRepairJobMainVO { |
|||
id: number |
|||
number: string |
|||
type: string |
|||
repairNumber: string |
|||
sources: string |
|||
maintenanceDesc: string |
|||
urgency: string |
|||
level: string |
|||
equipmentCode: string |
|||
shutDown: boolean |
|||
startTime: Date |
|||
endTime: Date |
|||
totalMinutes: number |
|||
verifyer: number |
|||
verifyContent: string |
|||
verifyTime: Date |
|||
maintenancer: number |
|||
maintenancePhone: string |
|||
completeResult: string |
|||
completionTime: Date |
|||
maintenanceTime: Date |
|||
repairTime: Date |
|||
repairer: number |
|||
faultType: string |
|||
status: string |
|||
autoOrder: string |
|||
autoPerform: string |
|||
autoVerify: string |
|||
directCreateRecord: string |
|||
classType: string |
|||
factoryAreaCode: string |
|||
workshopCode: string |
|||
lineCode: string |
|||
processCode: string |
|||
workstationCode: string |
|||
departmentCode: string |
|||
remark: string |
|||
siteId: string |
|||
available: string |
|||
deletionTime: Date |
|||
deleterId: byte[] |
|||
concurrencyStamp: number |
|||
} |
|||
|
|||
// 查询维修工单主列表
|
|||
export const getEquipmentRepairJobMainPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/eam/equipment-repair-job-main/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/eam/equipment-repair-job-main/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询维修工单主详情
|
|||
export const getEquipmentRepairJobMain = async (id: number) => { |
|||
return await request.get({ url: `/eam/equipment-repair-job-main/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增维修工单主
|
|||
export const createEquipmentRepairJobMain = async (data: EquipmentRepairJobMainVO) => { |
|||
return await request.post({ url: `/eam/equipment-repair-job-main/create`, data }) |
|||
} |
|||
|
|||
// 修改维修工单主
|
|||
export const updateEquipmentRepairJobMain = async (data: EquipmentRepairJobMainVO) => { |
|||
return await request.put({ url: `/eam/equipment-repair-job-main/update`, data }) |
|||
} |
|||
|
|||
// 修改维修工单主
|
|||
export const updateEquipmentRepairMain = async (data: EquipmentRepairJobMainVO) => { |
|||
return await request.post({ url: `/eam/equipment-repair-job-main/updateRepair`, data }) |
|||
} |
|||
|
|||
// 完成维修工单主
|
|||
export const executeEquipmentRepairJobMain = async (data: EquipmentRepairJobMainVO) => { |
|||
return await request.post({ url: `/eam/equipment-repair-job-main/execute`, data }) |
|||
} |
|||
|
|||
// 删除维修工单主
|
|||
export const deleteEquipmentRepairJobMain = async (id: number) => { |
|||
return await request.delete({ url: `/eam/equipment-repair-job-main/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出维修工单主 Excel
|
|||
export const exportEquipmentRepairJobMain = async (params) => { |
|||
return await request.download({ url: `/eam/equipment-repair-job-main/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载用户导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/eam/equipment-repair-job-main/get-import-template' }) |
|||
} |
|||
|
|||
// 修改维修工单状态
|
|||
export const updateEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => { |
|||
return await request.post({ url: `/eam/equipment-repair-job-main/updateOrder`, data }) |
|||
} |
@ -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 }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' }) |
|||
} |
@ -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' } |
|||
], |
|||
}) |
@ -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> |
@ -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' } |
|||
], |
|||
}) |
@ -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> |
@ -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' } |
|||
], |
|||
}) |
@ -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> |
@ -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' |
|||
} |
|||
} |
|||
])) |
@ -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> |
@ -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' } |
|||
], |
|||
}) |
@ -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> |
@ -0,0 +1,145 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const EquipmentRepairJobDetailRules = reactive({ |
|||
number: [required], |
|||
masterId: [required], |
|||
concurrencyStamp: [required], |
|||
}) |
|||
|
|||
export const EquipmentRepairJobDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '维修工单号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '主表id', |
|||
field: 'masterId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '故障描述', |
|||
field: 'describing', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '故障原因关联基础数据', |
|||
field: 'faultCause', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '解决措施', |
|||
field: 'workOut', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '维修人员字符串多个', |
|||
field: 'maintenances', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '部门id', |
|||
field: 'departmentCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '地点ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '是否可用默认TRUE', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '删除时间', |
|||
field: 'deletionTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除人id', |
|||
field: 'deleterId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,244 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="EquipmentRepairJobDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="EquipmentRepairJobDetail.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="EquipmentRepairJobDetailRules" |
|||
:formAllSchemas="EquipmentRepairJobDetail.allSchemas" |
|||
:apiUpdate="EquipmentRepairJobDetailApi.updateEquipmentRepairJobDetail" |
|||
:apiCreate="EquipmentRepairJobDetailApi.createEquipmentRepairJobDetail" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" :isBasic="true" :allSchemas="EquipmentRepairJobDetail.allSchemas" /> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/eam/equipment-repair-job-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { EquipmentRepairJobDetail,EquipmentRepairJobDetailRules } from './equipmentRepairJobDetail.data' |
|||
import * as EquipmentRepairJobDetailApi from '@/api/eam/equipmentRepairJobDetail' |
|||
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: 'EquipmentRepairJobDetail' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(EquipmentRepairJobDetail.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: EquipmentRepairJobDetailApi.getEquipmentRepairJobDetailPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'wms:equipmentRepairJobDetail:create'}), // 新增 |
|||
defaultButtons.defaultImportBtn({hasPermi:'wms:equipmentRepairJobDetail:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'wms:equipmentRepairJobDetail:export'}), // 导出 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultFilterBtn(null), // 筛选 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn({hasPermi:'wms:equipmentRepairJobDetail:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'wms:equipmentRepairJobDetail: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 =EquipmentRepairJobDetail.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 EquipmentRepairJobDetailApi.createEquipmentRepairJobDetail(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await EquipmentRepairJobDetailApi.updateEquipmentRepairJobDetail(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, 'basicEquipmentRepairJobDetail') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await EquipmentRepairJobDetailApi.deleteEquipmentRepairJobDetail(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 EquipmentRepairJobDetailApi.exportEquipmentRepairJobDetail(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 EquipmentRepairJobDetailApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
File diff suppressed because it is too large
@ -0,0 +1,677 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data"; |
|||
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts"; |
|||
import {BasicFaultCause} from "@/views/eam/basicFaultCause/basicFaultCause.data"; |
|||
import * as ItemApi from "@/api/eam/basicFaultCause"; |
|||
import {getBasicFaultCausePage} from "@/api/eam/basicFaultCause"; |
|||
|
|||
// 表单校验
|
|||
export const EquipmentRepairJobMainRules = reactive({ |
|||
number: [required], |
|||
type: [required], |
|||
sources: [required], |
|||
urgency: [required], |
|||
level: [required], |
|||
equipmentCode: [required], |
|||
totalMinutes: [required], |
|||
faultType: [required], |
|||
status: [required], |
|||
}) |
|||
|
|||
export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '维修工单号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '设备类别', |
|||
field: 'type', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.DEVICE_TYPE, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '报修工单号', |
|||
field: 'repairNumber', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '来源字典', |
|||
field: 'sources', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.EAM_MAINTENANCE_SOURCES, |
|||
dictClass: 'string', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '维修描述', |
|||
field: 'maintenanceDesc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '紧急程度', |
|||
field: 'urgency', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.EAM_MAINTENANCE_URGENCY, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '维修级别', |
|||
field: 'level', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.EAM_MAINTENANCE_LEVEL, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '设备编号', |
|||
field: 'equipmentCode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
isForm: true, |
|||
form: { |
|||
componentProps: { |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchTitle: '设备信息', // 查询弹窗标题
|
|||
searchListPlaceholder: '请选择 设备编号', // 输入框占位文本
|
|||
searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类
|
|||
searchField: 'code', // 查询弹窗赋值字段
|
|||
searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法
|
|||
multiple:true, |
|||
searchCondition: [{ |
|||
key: 'status', |
|||
value: 'NORMAL', |
|||
action: '==', |
|||
isSearch: true, |
|||
isMainValue: false |
|||
}] |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否停机', |
|||
field: 'shutDown', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
form: { |
|||
component: 'Radio' |
|||
} |
|||
}, |
|||
{ |
|||
label: '维修开始时间', |
|||
field: 'startTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '维修结束时间', |
|||
field: 'endTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '维修时长', |
|||
field: 'totalMinutes', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '验证人', |
|||
field: 'verifyer', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '验证内容', |
|||
field: 'verifyContent', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '验证时间', |
|||
field: 'verifyTime', |
|||
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: 'maintenancer', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '维修人联系电话', |
|||
field: 'maintenancePhone', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '结果', |
|||
field: 'completeResult', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '完成时间', |
|||
field: 'completionTime', |
|||
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: 'maintenanceTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '报修时间', |
|||
field: 'repairTime', |
|||
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: 'repairer', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '故障类型', |
|||
field: 'faultType', |
|||
dictType: DICT_TYPE.FAILURE_REASON, |
|||
dictClass: 'string', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '流程状态', |
|||
field: 'status', |
|||
sort: 'custom', |
|||
dictType: DICT_TYPE.EAM_REPAIR_STATUS, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
}, |
|||
// {
|
|||
// label: '自动接单',
|
|||
// field: 'autoOrder',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
// {
|
|||
// label: '自动执行',
|
|||
// field: 'autoPerform',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
// {
|
|||
// label: '自动验证',
|
|||
// field: 'autoVerify',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
{ |
|||
label: '直接生成记录', |
|||
field: 'directCreateRecord', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '班组类型', |
|||
field: 'classType', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
// {
|
|||
// label: '所属厂区编号',
|
|||
// field: 'factoryAreaCode',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
{ |
|||
label: '车间编号', |
|||
field: 'workshopCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
// {
|
|||
// label: '产线编号',
|
|||
// field: 'lineCode',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
// {
|
|||
// label: '工序编号',
|
|||
// field: 'processCode',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
// {
|
|||
// label: '工位编号',
|
|||
// field: 'workstationCode',
|
|||
// sort: 'custom',
|
|||
// isSearch: true,
|
|||
// },
|
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
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')] |
|||
} |
|||
}, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '部门id', |
|||
field: 'departmentCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '地点ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '是否可用默认TRUE', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '删除时间', |
|||
field: 'deletionTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除人id', |
|||
field: 'deleterId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
|||
|
|||
// 表单校验
|
|||
export const EquipmentRepairJobDetailRules = reactive({ |
|||
number: [required], |
|||
masterId: [required], |
|||
describing:[required], |
|||
faultCause:[required], |
|||
workOut:[required], |
|||
maintenances:[required], |
|||
}) |
|||
|
|||
export const EquipmentRepairJobDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: 'id', |
|||
field: 'id', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '维修工单号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form:{ |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '主表id', |
|||
field: 'masterId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form:{ |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '故障描述', |
|||
field: 'describing', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '故障原因', |
|||
field: 'faultCause', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
form: { |
|||
componentProps: { |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择 故障原因', |
|||
searchTitle: '故障原因', // 查询弹窗标题
|
|||
searchAllSchemas: BasicFaultCause.allSchemas, // 查询弹窗所需类
|
|||
searchField: 'code', // 查询弹窗赋值字段
|
|||
searchPage: ItemApi.getBasicFaultCausePage, // 查询弹窗所需分页方法
|
|||
searchCondition: [{ |
|||
key: 'available', |
|||
value: 'TRUE', |
|||
action: '==', |
|||
isSearch: true, |
|||
isMainValue: false |
|||
}] |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '解决措施', |
|||
field: 'workOut', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '维修人员', |
|||
field: 'maintenances', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '部门id', |
|||
field: 'departmentCode', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '备注', |
|||
field: 'remark', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '地点ID', |
|||
field: 'siteId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '是否可用默认TRUE', |
|||
field: 'available', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '删除时间', |
|||
field: 'deletionTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '删除人id', |
|||
field: 'deleterId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
}, |
|||
{ |
|||
label: '并发乐观锁', |
|||
field: 'concurrencyStamp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
isTable: false, |
|||
isForm: false, |
|||
isDetail:false, |
|||
form: { |
|||
component: 'InputNumber', |
|||
value: 0 |
|||
}, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,262 @@ |
|||
<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="maintenanceDesc"> |
|||
<el-input v-model="formData.maintenanceDesc" placeholder="请输入维修描述" :disabled="isDisabled"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="维修级别" prop="level"> |
|||
<el-select v-model="formData.level" placeholder="请选择维修级别" style="width: 150px"> |
|||
<el-option label="大修" value="0"></el-option> |
|||
<el-option label="中修" value="1"></el-option> |
|||
<el-option label="小修" value="2"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="维修开始时间" prop="startTime"> |
|||
<el-date-picker |
|||
v-model="formData.startTime" |
|||
type="datetime" |
|||
value-format="x" |
|||
placeholder="选择维修开始时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="维修结束时间" prop="endTime"> |
|||
<el-date-picker |
|||
v-model="formData.endTime" |
|||
type="datetime" |
|||
value-format="x" |
|||
placeholder="选择维修结束时间"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="执行人" prop="maintenancer"> |
|||
<el-input v-model="formData.maintenancer" placeholder="请输入执行人"/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item label="维修人电话" prop="maintenancePhone"> |
|||
<el-input v-model="formData.maintenancePhone" placeholder="请输入维修人电话" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item label="结果" prop="completeResult"> |
|||
<el-select v-model="formData.completeResult" placeholder="请选择结果" style="width: 150px"> |
|||
<el-option label="完成" value="0"></el-option> |
|||
<el-option label="临时措施" value="1"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<template #footer> |
|||
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')">确 定</el-button> |
|||
<el-button @click="handleClose('close')">取 消</el-button> |
|||
</template> |
|||
</Dialog> |
|||
|
|||
<!--添加巡检项弹窗--> |
|||
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> |
|||
|
|||
</template> |
|||
<script lang="ts" setup> |
|||
import * as EquipmentRepairJobMainApi from '@/api/eam/equipmentRepairJobMain' |
|||
import { SearchTable } from '@/components/SearchTable' |
|||
import {ElInput} from "element-plus"; |
|||
import {updateEquipmentRepairMain} from "@/api/eam/equipmentRepairJobMain"; |
|||
|
|||
defineOptions({ name: 'TeamForm' }) |
|||
|
|||
const { t } = useI18n() // 国际化 |
|||
const message = useMessage() // 消息弹窗 |
|||
|
|||
const dialogVisible = ref(false) // 弹窗的是否展示 |
|||
const dialogTitle = ref('') // 弹窗的标题 |
|||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|||
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:'', |
|||
maintenanceDesc: '', |
|||
level: '', |
|||
startTime:'', |
|||
endTime:'', |
|||
maintenancer:'', |
|||
maintenancePhone:'', |
|||
completeResult:'', |
|||
}) |
|||
const formRules = reactive({ |
|||
maintenanceDesc: [ |
|||
{ required: true, message: '维修描述不能为空', trigger: 'blur' }, |
|||
], |
|||
level: [ |
|||
{ required: true, message: '维修等级不能为空', trigger: 'blur' }, |
|||
], |
|||
startTime: [ |
|||
{ required: true, message: '开始时间不能为空', trigger: 'blur' }, |
|||
], |
|||
endTime: [ |
|||
{ required: true, message: '结束时间不能为空', trigger: 'blur' }, |
|||
], |
|||
maintenancer: [ |
|||
{ required: true, message: '维修人ID不能为空', trigger: 'blur' }, |
|||
], |
|||
maintenancePhone: [ |
|||
{ required: true, message: '维修人电话不能为空', trigger: 'blur' }, |
|||
], |
|||
completeResult: [ |
|||
{ 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.updateEquipmentRepairMain(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> |
@ -0,0 +1,387 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="EquipmentRepairJobMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="EquipmentRepairJobMain.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #number="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.number)"> |
|||
<span>{{ row.number }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="formsSuccess" |
|||
:rules="EquipmentRepairJobMainRules" |
|||
:formAllSchemas="EquipmentRepairJobMain.allSchemas" |
|||
:apiUpdate="EquipmentRepairJobMainApi.updateEquipmentRepairJobMain" |
|||
:apiCreate="EquipmentRepairJobMainApi.createEquipmentRepairJobMain" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<FinishForm2 ref="finishForm2Ref" @success="getData2" @close="getClosed2"/> |
|||
|
|||
<!-- 详情 --> |
|||
<Detail ref="detailRef" |
|||
:isBasic="false" |
|||
:allSchemas="EquipmentRepairJobMain.allSchemas" |
|||
:detailAllSchemas="EquipmentRepairJobDetail.allSchemas" |
|||
:detailAllSchemasRules="EquipmentRepairJobDetailRules" |
|||
:apiPage="EquipmentRepairJobDetailApi.getEquipmentRepairJobDetailPage" |
|||
:apiCreate="EquipmentRepairJobDetailApi.createEquipmentRepairJobDetail" |
|||
:apiUpdate="EquipmentRepairJobDetailApi.updateEquipmentRepairJobDetail" |
|||
:apiDelete="EquipmentRepairJobDetailApi.deleteEquipmentRepairJobDetail" |
|||
:detailButtonIsShowAdd=statusBtn |
|||
:detailButtonIsShowEdit=statusBtn |
|||
:detailButtonIsShowDelete=statusBtn |
|||
@handleMainFefresh="handleMainFefresh" |
|||
@searchTableSuccessDetail="searchTableSuccessDetail" |
|||
:key="count" |
|||
/> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportForm ref="importFormRef" url="/eam/equipment-repair-job-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { EquipmentRepairJobMain,EquipmentRepairJobMainRules,EquipmentRepairJobDetail,EquipmentRepairJobDetailRules } from './equipmentRepairJobMain.data' |
|||
import * as EquipmentRepairJobMainApi from '@/api/eam/equipmentRepairJobMain' |
|||
import * as EquipmentRepairJobDetailApi from '@/api/eam/equipmentRepairJobDetail' |
|||
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 '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail.vue' |
|||
import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue' |
|||
|
|||
defineOptions({ name: 'EquipmentRepairJobMain' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(EquipmentRepairJobMain.allSchemas.tableColumns) |
|||
const statusBtn = ref(false); |
|||
|
|||
// 查询页面返回 |
|||
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: EquipmentRepairJobMainApi.getEquipmentRepairJobMainPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({hasPermi:'eam:equipmentRepairJobMain:create'}), // 新增 |
|||
//defaultButtons.defaultImportBtn({hasPermi:'eam:equipmentRepairJobMain:import'}), // 导入 |
|||
defaultButtons.defaultExportBtn({hasPermi:'eam:equipmentRepairJobMain: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 isShowStatusButton = (row,val) => { |
|||
if (val.indexOf(row.status) > -1) { |
|||
return false |
|||
} else { |
|||
return true |
|||
} |
|||
} |
|||
|
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = (row) => { |
|||
return[ |
|||
defaultButtons.mainListEditBtn({hasPermi:'eam:equipmentRepairJobMain:update'}), // 编辑 |
|||
defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 接单 |
|||
defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 执行 |
|||
defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentRepairJobMain:update'}), //完成 |
|||
] |
|||
} |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} else if (val == 'receive') { // 接单 |
|||
handleReceive(row.id) |
|||
} else if (val == 'execute') { // 执行 |
|||
handleExecute(row.id) |
|||
} else if (val == 'finish') { // 完成 |
|||
handleFinish(row) |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// form表单提交 |
|||
const formsSuccess = async (formType,data) => { |
|||
var isHave =EquipmentRepairJobMain.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 EquipmentRepairJobMainApi.createEquipmentRepairJobMain(data) |
|||
message.success(t('common.createSuccess')) |
|||
} else { |
|||
await EquipmentRepairJobMainApi.updateEquipmentRepairJobMain(data) |
|||
message.success(t('common.updateSuccess')) |
|||
} |
|||
basicFormRef.value.dialogVisible = false |
|||
getList() |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
if('5' === row.status){ |
|||
statusBtn.value=true |
|||
}else { |
|||
statusBtn.value=false |
|||
} |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentRepairJobMain') |
|||
} |
|||
|
|||
/** 页面操作 */ |
|||
let count = ref(0) |
|||
const handleMainFefresh = async()=>{ |
|||
count.value++ |
|||
getList() |
|||
} |
|||
|
|||
// 子页面查询字典页面返回 |
|||
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
let result = ''; |
|||
for (var i = 0; i < val.length; i++) { |
|||
result += val[i].code + ','; |
|||
} |
|||
if(result.endsWith(',')){ |
|||
result = result.substring(0,result.length -1) |
|||
} |
|||
setV[formField] = result; |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 完成按钮操作 */ |
|||
const finishForm2Ref = ref() |
|||
const handleFinish = async (row) => { |
|||
// 二次确认 |
|||
await message.delConfirm('是否完成所选中工单?'); |
|||
|
|||
//打开提交表单 |
|||
finishForm2Ref.value.open('update', row); |
|||
} |
|||
|
|||
/** 接单按钮操作 */ |
|||
const handleReceive = async (id: number) => { |
|||
try { |
|||
// 中止的二次确认 |
|||
await message.delConfirm('是否接单?'); |
|||
const params = ref({ |
|||
id: '', |
|||
status:'', |
|||
}) |
|||
params.value.id = id |
|||
params.value.status = '4' |
|||
// 发起删除 |
|||
await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value) |
|||
message.success(t('接单成功')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 执行按钮操作 */ |
|||
const handleExecute = async (id: number) => { |
|||
try { |
|||
// 二次确认 |
|||
await message.delConfirm('是否执行所选中任务?'); |
|||
const params = ref({ |
|||
id: '', |
|||
status:'', |
|||
}) |
|||
params.value.id = id |
|||
params.value.status = '5' |
|||
// 发起 |
|||
await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value) |
|||
message.success(t('执行成功')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await EquipmentRepairJobMainApi.deleteEquipmentRepairJobMain(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
|
|||
|
|||
//finishForm2 关闭按钮回传 |
|||
const getClosed2=(val)=> { |
|||
nextTick?.(() => { |
|||
getList() |
|||
}) |
|||
} |
|||
|
|||
//finishForm2 提交按钮回传 |
|||
const getData2=(val)=> { |
|||
nextTick?.(async () => { |
|||
const params = ref({ |
|||
id: '', |
|||
status: '', |
|||
}) |
|||
params.value.id = val |
|||
params.value.status = '5' |
|||
// 发起 |
|||
await EquipmentRepairJobMainApi.executeEquipmentRepairJobMain(params.value) |
|||
message.success(t('工单已完成')) |
|||
// 刷新列表 |
|||
await getList() |
|||
}) |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await EquipmentRepairJobMainApi.exportEquipmentRepairJobMain(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 EquipmentRepairJobMainApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -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> |
@ -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' |
|||
} |
|||
} |
|||
]) |
|||
) |
@ -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> |
@ -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' |
|||
} |
|||
} |
|||
])) |
@ -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> |
@ -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' |
|||
} |
|||
} |
|||
])) |
@ -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> |
@ -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' |
|||
} |
|||
} |
|||
])) |
@ -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> |
@ -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' }, |
|||
], |
|||
}) |
@ -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> |
@ -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' |
|||
} |
|||
} |
|||
])) |
@ -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' }] |
|||
}) |
@ -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> |
@ -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> |
@ -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' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,510 @@ |
|||
<!-- 供应商首页 --> |
|||
<template> |
|||
<div class="one-row"> |
|||
<div class="data"> |
|||
<div class="data-item"> |
|||
<div class="small-title">{{ t('home.number_orders') }}</div> |
|||
<div class="small-data"> |
|||
<div class="small-data-item small-data-item1"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.openPurchaseCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{ t('home.number_open') }}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon1.png" alt="" class="img" /> |
|||
</div> |
|||
<div class="small-data-item small-data-item2 ml-14px"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.allPurchaseCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{ t('home.number_total_order') }}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon5.png" alt="" class="img" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="data-item ml-14px"> |
|||
<div class="small-title">{{t('home.number_planned_shipments')}}</div> |
|||
<div class="small-data"> |
|||
<div class="small-data-item small-data-item3"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.openPurchasePlanCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{t('home.number_open_plans')}}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon6.png" alt="" class="img" /> |
|||
</div> |
|||
<div class="small-data-item small-data-item4 ml-14px"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.allPurchasePlanCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{t('home.number_all_plans')}}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon3.png" alt="" class="img" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="data-item ml-14px"> |
|||
<div class="small-title">{{t('home.number_invoices')}}</div> |
|||
<div class="small-data"> |
|||
<div class="small-data-item small-data-item5"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.notTakeSupplierdeliverCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{t('home.number_unreceived_orders')}}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon4.png" alt="" class="img" /> |
|||
</div> |
|||
<div class="small-data-item small-data-item6 ml-14px"> |
|||
<div class="small-data-item-txt"> |
|||
<div>{{ supplierData?.takeSupplierdeliverCount || 0 }}<span>{{ t('home.single') }}</span></div> |
|||
<div>{{t('home.number_orders_received')}}</div> |
|||
</div> |
|||
<img src="../../../assets/imgs/icon2.png" alt="" class="img" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="two-row mt-14px"> |
|||
<div class="data1 w-[65%]"> |
|||
<div class="title">{{t('home.invoice_trend_month')}}</div> |
|||
<Echart :options="lineOptions" :height="280" :key="lineIndex" /> |
|||
</div> |
|||
<div class="data1 w-[35%] ml-14px"> |
|||
<div class="title">{{t('home.TOP10_parts_shipped_month')}}</div> |
|||
<Echart :options="pieOptions" :height="280" :key="lineIndex" /> |
|||
</div> |
|||
</div> |
|||
<div class="two-row mt-14px"> |
|||
<div class="data1 w-[47.3%]"> |
|||
<div class="title">{{t('home.latest_news')}}</div> |
|||
<el-table :data="notaicList" style="width: 100%" stripe height="240px"> |
|||
<el-table-column :label="t('home.number')" align="center" prop="id" /> |
|||
<el-table-column :label="t('home.user_type')" align="center" prop="userType"> |
|||
<template #default="scope"> |
|||
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="scope.row.userType" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('home.user_number')" align="center" prop="userId" width="80" /> |
|||
<el-table-column :label="t('home.template_coding')" align="center" prop="templateCode" width="80" /> |
|||
<el-table-column :label="t('home.sender_number')" align="center" prop="templateNickname" width="180" /> |
|||
<el-table-column |
|||
:label="t('home.template_content')" |
|||
align="center" |
|||
prop="templateContent" |
|||
width="200" |
|||
show-overflow-tooltip |
|||
/> |
|||
<el-table-column |
|||
:label="t('home.template_parameters')" |
|||
align="center" |
|||
prop="templateParams" |
|||
width="180" |
|||
show-overflow-tooltip |
|||
> |
|||
<template #default="scope"> {{ scope.row.templateParams }}</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('home.template_type')" align="center" prop="templateType" width="120"> |
|||
<template #default="scope"> |
|||
<dict-tag |
|||
:type="DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE" |
|||
:value="scope.row.templateType" |
|||
/> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column :label="t('home.read')" align="center" prop="readStatus" width="100"> |
|||
<template #default="scope"> |
|||
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.readStatus" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
:label="t('home.read_time')" |
|||
align="center" |
|||
prop="readTime" |
|||
width="180" |
|||
:formatter="dateFormatter" |
|||
/> |
|||
<el-table-column |
|||
:label="t('home.create_time')" |
|||
align="center" |
|||
prop="createTime" |
|||
width="180" |
|||
:formatter="dateFormatter" |
|||
/> |
|||
<!-- <el-table-column label="操作" align="center" fixed="right" width="120"> |
|||
<template #default="scope"> |
|||
<el-button link type="primary" @click="openDetail(scope.row)" v-hasPermi="['system:notify-message:query']"> |
|||
<Icon icon="ep:document-copy" /> |
|||
详情 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> --> |
|||
</el-table> |
|||
</div> |
|||
<div class="data1 w-[47.3%]"> |
|||
<div class="title">{{ t('home.latest_deduction_details')}}</div> |
|||
<el-table :data="tableData" style="width: 100%" stripe height="240px"> |
|||
<el-table-column prop="title" :label="t('home.title')" /> |
|||
<el-table-column prop="name" :label="t('home.publisher')" /> |
|||
<el-table-column prop="date" :label="t('home.publish_date')" /> |
|||
</el-table> |
|||
</div> |
|||
</div> |
|||
<div class="two-row mt-14px"> |
|||
<div class="data1 w-[47.3%]"> |
|||
<!-- 本月退货明细 --> |
|||
<div class="title">{{t('home.month_return_detials')}}</div> |
|||
<el-table |
|||
:data="purchasereturnRecordMonth" |
|||
style="width: 100%" |
|||
stripe |
|||
height="240px" |
|||
> |
|||
<el-table-column prop="number" :label="t('home.document_number')" width="180" /> |
|||
<el-table-column prop="fromPackingNumber" :label="t('home.source_package_number')" width="180" /> |
|||
<el-table-column prop="toPackingNumber" :label="t('home.destination_package_number')" width="180" /> |
|||
<el-table-column prop="fromContainerNumber" :label="t('home.source_appliance_number')" width="120" /> |
|||
<el-table-column prop="toContainerNumber" :label="t('home.destination_appliance_number')" width="120" /> |
|||
<el-table-column prop="fromBatch" :label="t('home.source_batch')" width="120" /> |
|||
<el-table-column prop="toBatch" :label="t('home.destination_batch')" width="120" /> |
|||
<el-table-column prop="altBatch" :label="t('home.replace_batch')" width="120" /> |
|||
<el-table-column prop="fromLocationCode" :label="t('home.source_location_code')" width="120" /> |
|||
<el-table-column prop="toLocationCode" :label="t('home.destination_location_code')" width="120" /> |
|||
<el-table-column prop="fromLocationGroupCode" :label="t('home.source_location_group_code')" width="120" /> |
|||
<el-table-column prop="toLocationGroupCode" :label="t('home.destination_location_group_code')" width="120" /> |
|||
<el-table-column prop="fromAreaCode" :label="t('home.source_location_area_code')" width="120" /> |
|||
<el-table-column prop="toAreaCode" :label="t('home.destination_location_area_code')" width="120" /> |
|||
<el-table-column prop="fromOwnerCode" :label="t('home.source_shipper_code')" width="120" /> |
|||
<el-table-column prop="toOwnerCode" :label="t('home.destination_shipper_code')" width="120" /> |
|||
<el-table-column prop="inventoryStatus" :label="t('home.inventory_state')" width="120"> |
|||
<template #default="scope"> |
|||
{{ formatter(scope.row.inventoryStatus,DICT_TYPE.INVENTORY_STATUS) }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="poNumber" :label="t('home.order_number')" width="120" /> |
|||
<el-table-column prop="poline" :label="t('home.order_line')" width="120" /> |
|||
<el-table-column prop="reason" :label="t('home.cause')" width="120" /> |
|||
<el-table-column prop="singlePrice" :label="t('home.unit_price')" width="120" /> |
|||
<el-table-column prop="amount" :label="t('home.money')" width="120" /> |
|||
<el-table-column prop="itemCode" :label="t('home.material_code')" width="160" /> |
|||
<el-table-column prop="itemName" :label="t('home.material_name')" width="120" /> |
|||
<el-table-column prop="itemDesc1" :label="t('home.material_description1')" width="120" /> |
|||
<el-table-column prop="itemDesc2" :label="t('home.material_description2')" width="120" /> |
|||
<el-table-column prop="qty" :label="t('home.amount')" width="120" /> |
|||
<el-table-column prop="uom" :label="t('home.measuring_unit')" width="120"> |
|||
<template #default="scope"> |
|||
{{ formatter(scope.row.uom,DICT_TYPE.UOM) }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="projectCode" :label="t('home.item_code')" width="120" /> |
|||
<el-table-column prop="remark" :label="t('home.comment')" width="120" /> |
|||
<el-table-column prop="createTime" :label="t('home.create_time')" width="170"> |
|||
<template #default="scope"> |
|||
<span>{{ formatDate(scope.row.createTime) }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="creator" :label="t('home.creater')" width="120" /> |
|||
</el-table> |
|||
<el-pagination style="margin-top:10px" |
|||
v-model:current-page="currentPage_purchasereturn" |
|||
v-model:page-size="pageSize_purchasereturn" |
|||
:page-sizes="[10, 20, 30, 50, 100]" |
|||
:small="true" |
|||
:background="false" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
:total="total_purchasereturn" |
|||
@size-change="getPurchasereturnRecordMonth" |
|||
@current-change="getPurchasereturnRecordMonth" |
|||
/> |
|||
</div> |
|||
<div class="data1 w-[47.3%]"> |
|||
<!-- 本月索赔明细 --> |
|||
<div class="title">{{t('home.claim_details_month')}}</div> |
|||
<el-table |
|||
:data="purchaseclaimRecordMonth" |
|||
style="width: 100%" |
|||
stripe |
|||
height="240px" |
|||
> |
|||
<el-table-column prop="number" :label="t('home.document_number')" width="180" /> |
|||
<el-table-column prop="fromBatch" :label="t('home.batch')" width="120" /> |
|||
<el-table-column prop="poNumber" :label="t('home.order_number')" width="120" /> |
|||
<el-table-column prop="poline" :label="t('home.order_line')" width="120" /> |
|||
<el-table-column prop="reason" :label="t('home.cause')" width="120" /> |
|||
<el-table-column prop="singlePrice" :label="t('home.unit_price')" width="120" /> |
|||
<el-table-column prop="amount" :label="t('home.money')" width="120" /> |
|||
<el-table-column prop="code" label="代码" width="160" /> |
|||
<el-table-column prop="createTime" :label="t('home.create_time')" width="170"> |
|||
<template #default="scope"> |
|||
<span>{{ formatDate(scope.row.createTime) }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="creator" :label="t('home.creater')" width="120" /> |
|||
</el-table> |
|||
<el-pagination style="margin-top:10px" |
|||
v-model:current-page="currentPage_purchaseclaim" |
|||
v-model:page-size="pageSize_purchaseclaim" |
|||
:page-sizes="[10, 20, 30, 50, 100]" |
|||
:small="true" |
|||
:background="false" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
:total="total_purchaseclaim" |
|||
@size-change="getPurchaseclaimRecordMonth" |
|||
@current-change="getPurchaseclaimRecordMonth" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script lang="ts" setup> |
|||
import { set } from 'lodash-es' |
|||
import { EChartsOption } from 'echarts' |
|||
import { lineOptions, pieOptions } from '../echarts-data' |
|||
import { formatDate,dateFormatter } from '@/utils/formatTime' |
|||
|
|||
import * as NotifyMessageApi from '@/api/system/notify/message' |
|||
import * as IndexApi from '@/api/home' |
|||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|||
const { t } = useI18n() |
|||
const tableData = [ |
|||
{ |
|||
date: '2016-05-03', |
|||
name: 'Tom', |
|||
title: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
}, |
|||
{ |
|||
date: '2016-05-02', |
|||
title: 'Tom', |
|||
name: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
}, |
|||
{ |
|||
date: '2016-05-04', |
|||
title: 'Tom', |
|||
name: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
}, |
|||
{ |
|||
date: '2016-05-01', |
|||
title: 'Tom', |
|||
name: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
}, |
|||
{ |
|||
date: '2016-05-01', |
|||
title: 'Tom', |
|||
name: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
}, |
|||
{ |
|||
date: '2016-05-01', |
|||
title: 'Tom', |
|||
name: 'Tom', |
|||
text: 'No. 189, Grove St, Los Angeles' |
|||
} |
|||
] |
|||
const supplierData = ref() |
|||
const lineIndex = ref(0) |
|||
// 本月发货单趋势 |
|||
const lineOptionsData = reactive<EChartsOption>(lineOptions) as EChartsOption |
|||
const getInvoiceCharts = async () => { |
|||
set( |
|||
lineOptionsData, |
|||
'xAxis.data', |
|||
supplierData.value.supplierdeliverMonthCount.map((v) => v.date) |
|||
) |
|||
set(lineOptionsData, 'legend.data', [t('home.invoice_trend_month')]) |
|||
set(lineOptionsData, 'series', [ |
|||
{ |
|||
name: t('home.invoice_trend_month'), |
|||
smooth: true, |
|||
type: 'line', |
|||
itemStyle: {}, |
|||
animationDuration: 2800, |
|||
animationEasing: 'quadraticOut', |
|||
data: supplierData.value.supplierdeliverMonthCount.map((v) => v.count) |
|||
} |
|||
]) |
|||
lineIndex.value++ |
|||
} |
|||
//本月发货零件TOP10 |
|||
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption |
|||
const getPartTOPCharts = async () => { |
|||
const data = [ |
|||
{ value: 335, name: 'analysis.directAccess' }, |
|||
{ value: 310, name: 'analysis.mailMarketing' }, |
|||
{ value: 234, name: 'analysis.allianceAdvertising' }, |
|||
{ value: 135, name: 'analysis.videoAdvertising' }, |
|||
{ value: 1548, name: 'analysis.searchEngines' } |
|||
] |
|||
console.log(supplierData.value.supplierdeliverItemMonthTop) |
|||
set( |
|||
pieOptionsData, |
|||
'legend.data', |
|||
supplierData.value.supplierdeliverItemMonthTop.map((v) => v.itemCode) |
|||
) |
|||
pieOptionsData!.series![0].data = supplierData.value.supplierdeliverItemMonthTop.map((v) => { |
|||
return { |
|||
name: v.itemCode, |
|||
value: v.qty |
|||
} |
|||
}) |
|||
lineIndex.value++ |
|||
} |
|||
// 获取供应商数据 |
|||
const getSupplierData = async () => { |
|||
IndexApi.getSupplierData().then((res) => { |
|||
supplierData.value = res |
|||
getInvoiceCharts() |
|||
getPartTOPCharts() |
|||
}) |
|||
} |
|||
// 最新消息 |
|||
const notaicList = ref([]) // 列表的数据 |
|||
const queryParams = reactive({ |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
userType: undefined, |
|||
userId: undefined, |
|||
templateCode: undefined, |
|||
templateType: undefined, |
|||
createTime: [] |
|||
}) |
|||
/** 查询列表 */ |
|||
const getList = async () => { |
|||
try { |
|||
const data = await NotifyMessageApi.getNotifyMessagePage(queryParams) |
|||
notaicList.value = data.list |
|||
} finally { |
|||
} |
|||
} |
|||
const formatter = (type,dict) => { |
|||
let str = getStrDictOptions(dict).filter((item) => type == item.value)[0]?.label |
|||
return str |
|||
} |
|||
|
|||
// 本月退货明细 |
|||
const currentPage_purchasereturn = ref(1) |
|||
const pageSize_purchasereturn = ref(10) |
|||
const total_purchasereturn= ref(100) |
|||
const purchasereturnRecordMonth = ref([]) |
|||
const getPurchasereturnRecordMonth = ()=>{ |
|||
IndexApi.getPurchasereturnRecordMonth({ |
|||
pageNo: currentPage_purchasereturn.value, |
|||
pageSize: pageSize_purchasereturn.value |
|||
}).then((res) => { |
|||
console.log('getPurchasereturnRecordMonth',res) |
|||
purchasereturnRecordMonth.value = res.list |
|||
total_purchasereturn.value = res.total |
|||
}) |
|||
} |
|||
// 本月索赔明细 |
|||
const currentPage_purchaseclaim = ref(1) |
|||
const pageSize_purchaseclaim = ref(10) |
|||
const total_purchaseclaim= ref(100) |
|||
const purchaseclaimRecordMonth = ref([]) |
|||
const getPurchaseclaimRecordMonth = ()=>{ |
|||
IndexApi.getPurchaseclaimRecordMonth({ |
|||
pageNo: currentPage_purchaseclaim.value, |
|||
pageSize: pageSize_purchaseclaim.value |
|||
}).then((res) => { |
|||
console.log('getPurchaseclaimRecordMonth',res) |
|||
purchaseclaimRecordMonth.value = res.list |
|||
total_purchaseclaim.value = res.total |
|||
}) |
|||
} |
|||
onMounted( () => { |
|||
getSupplierData() |
|||
getList() |
|||
// 本月索赔明细 |
|||
Promise.all([getPurchaseclaimRecordMonth(),getPurchasereturnRecordMonth()]) |
|||
}) |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
.title { |
|||
padding-bottom: 10px; |
|||
border-bottom: 1px solid #dedede; |
|||
position: relative; |
|||
padding-left: 10px; |
|||
&::after { |
|||
content: ''; |
|||
position: absolute; |
|||
width: 4px; |
|||
height: 16px; |
|||
background: #3c7adf; |
|||
left: 0px; |
|||
top: 3px; |
|||
border-radius: 8px; |
|||
} |
|||
} |
|||
.data { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
.data-item { |
|||
width: calc(100% / 3); |
|||
padding: 10px 0px; |
|||
background: white; |
|||
.small-title { |
|||
padding: 0px 14px 10px; |
|||
} |
|||
.small-data { |
|||
display: flex; |
|||
align-content: center; |
|||
justify-content: space-between; |
|||
padding: 0px 14px; |
|||
.small-data-item { |
|||
width: 50%; |
|||
height: 70px; |
|||
display: flex; |
|||
align-items: center; |
|||
border-radius: 6px; |
|||
color: white; |
|||
padding: 0px 20px; |
|||
.small-data-item-txt { |
|||
flex: 1; |
|||
div { |
|||
&:nth-child(1) { |
|||
font-size: 20px; |
|||
span { |
|||
font-size: 12px; |
|||
padding-left: 6px; |
|||
} |
|||
} |
|||
&:nth-child(2) { |
|||
font-size: 12px; |
|||
} |
|||
} |
|||
} |
|||
.img { |
|||
width: 30px; |
|||
opacity: 0.5; |
|||
} |
|||
} |
|||
.small-data-item1 { |
|||
background: linear-gradient(to left, #fd817d, #fcad80); |
|||
} |
|||
.small-data-item2 { |
|||
background: linear-gradient(to left, #46c6fa, #336bfe); |
|||
} |
|||
.small-data-item3 { |
|||
background: linear-gradient(to left, #96a6cc, #595f82); |
|||
} |
|||
.small-data-item4 { |
|||
background: linear-gradient(to left, #08dcd5, #46e2bb); |
|||
} |
|||
.small-data-item5 { |
|||
background: linear-gradient(to left, #f4c46b, #ffb313); |
|||
} |
|||
.small-data-item6 { |
|||
background: linear-gradient(to left, #6eccf8, #02acfd); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
.two-row { |
|||
display: flex; |
|||
align-content: center; |
|||
justify-content: space-between; |
|||
.data1 { |
|||
background: white; |
|||
padding: 14px; |
|||
} |
|||
} |
|||
</style> |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue