diff --git a/src/api/eam/eam.js b/src/api/eam/eam.js index 5f0e9a6..23f604f 100644 --- a/src/api/eam/eam.js +++ b/src/api/eam/eam.js @@ -151,3 +151,6 @@ export const getObjectItemList= data => createAPI(`/pms/eam/getObjectItemList`,' export const getDefectWithObject= data => createAPI(`/pms/eam/getDefectWithObject`,'post',data) export const saveObjectItemData= data => createAPI(`/pms/eam/saveObjectItemData`,'post',data) export const deleteObjectItem= data => createAPI(`/pms/eam/deleteObjectItem`,'post',data) +export const searchObjectItemAvailable= data => createAPI(`/pms/eam/searchObjectItemAvailable`,'post',data) +export const saveObjectItemAvailable= data => createAPI(`/pms/eam/saveObjectItemAvailable`,'post',data) +export const deleteObjectItemAvailable= data => createAPI(`/pms/eam/deleteObjectItemAvailable`,'post',data) diff --git a/src/views/modules/eam/eamWorkPlanForCheck.vue b/src/views/modules/eam/eamWorkPlanForCheck.vue index 532e7c4..fb66bbc 100644 --- a/src/views/modules/eam/eamWorkPlanForCheck.vue +++ b/src/views/modules/eam/eamWorkPlanForCheck.vue @@ -110,7 +110,7 @@ - 设备编码 + 设备编码 @@ -168,8 +168,7 @@ - - 设备分类编码 + diff --git a/src/views/modules/eam/eam_device_list.vue b/src/views/modules/eam/eam_device_list.vue index f99ce83..b69d303 100644 --- a/src/views/modules/eam/eam_device_list.vue +++ b/src/views/modules/eam/eam_device_list.vue @@ -23,6 +23,7 @@ 查询 新增 + 复制到其他设备 新增备件 - 复制到其他设备 + 复制到其他设备 新增项目 - 复制到其他设备 + 复制到其他设备 新增项目 - 复制到其他设备 + 复制到其他设备 + + + + 新增设备故障 + 复制到其他设备 + + + + + + + + + + + + 新增点检计划 + + + 新增维保计划 + –>--> - - - - - - - - - + @@ -515,6 +519,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
----------------------------------------------------选择其他设备----------------------------------------------------
@@ -577,7 +607,7 @@ - 保存 + 保存 关闭 @@ -628,6 +658,214 @@ 关闭 + + + + + + + + + + + + + + 新增 + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + + + + + + + + + + + + 设备编码 + + + + + + + + + 点检模板 + 维保模板 + + + + + + + + + + + + + + + + + 默认机修人员 + + + + + + + + + + +
+
+ ----------------------------------------------------选择设备---------------------------------------------------- +
+ + + + + + + + + + + + 查询 + + + + + + + + + + + + + + +
+ + 保存 + 关闭 + +
+ + + + + + + + 故障编码 + + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + + + @@ -657,6 +895,13 @@ saveObjectItemData, eamPropertiesItemSearch, deleteObjectItem, + searchObjectItemAvailable, + saveObjectItemAvailable, + deleteObjectItemAvailable, + eamWorkPlanSave, + eamWorkPlanEdit, + eamObjectDefectSave, + eamObjectDefectDelete, } from '@/api/eam/eam.js'; import { updateOssRef @@ -2161,6 +2406,11 @@ familyID:'', oldObjectID:'', oldObjectDesc:'', + type:'', + spareFlag:'Y', + itemAFlag:'Y', + itemBFlag:'Y', + defectFlag:'Y', }, objectCopySelectionList:[], objectCopyList:[], @@ -2705,6 +2955,65 @@ userId:'', }, //设备点检项目分页新增 0315 rq ---end + chooseTableData:[], + itemModalFlag:false, + itemFlag:'text', + itemData:{ + site:'', + objectID:'', + itemNo:'', + valueNo:'', + availableValue:'', + itemType:'', + createdBy: this.$store.state.user.name + }, + chooseModalFlag:false, + chooseModalData:{ + site:'', + objectID:'', + itemNo: '', + itemDesc: '', + itemType:'', + valueTypeDb:'', + }, + planModalDisableFlag:false, + planModalFlag:false, + planModalData:{ + objectList:[], + flag:'', + functionType:'', + site: this.$store.state.user.site, + planID:'', + planDesc:'', + objectID:'', + propertiesCode:'', + propertiesDesc:'', + operator:'', + planPeriod:'', + status:'', + planStartDate:'', + planEndDate:'', + userId:'', + remark:'', + }, + objectData:{ + site: this.$store.state.user.site, + objectID:'', + objectDesc:'', + familyID:'', + }, + objectList:[], + objectSelectionList:[], + defectModalFlag:false, + defectModalData:{ + flag:'', + site: this.$store.state.user.site, + defectID:'', + objectID:'', + active:'', + id:'', + }, + } }, @@ -2724,6 +3033,63 @@ this.getDataList(); }, methods: { + // 获取基础数据列表S + getBaseList (val,type) { + this.tagNo = val + this.$nextTick(() => { + let strVal = '' + if (val === 1024) { + strVal = this.updateItemModal.itemNo + this.$refs.baseList.init(val, strVal) + } + if (val === 1025) { + strVal = this.updateItemModal.itemNo + this.$refs.baseList.init(val, strVal) + } + if (val === 201) { + strVal = this.planModalData.operator + this.$refs.baseList.init(val, strVal) + } + if (val === 1031) { + strVal = this.planModalData.propertiesCode + this.$refs.baseList.init(val, strVal) + } + if (val === 1032) { + strVal = this.planModalData.propertiesCode + this.$refs.baseList.init(val, strVal) + } + if (val === 1033) { + strVal = this.defectModalData.defectID + this.$refs.baseList.init(val, strVal) + } + }) + }, + /* 列表方法的回调 */ + getBaseData (val) { + if (this.tagNo === 1024) { + this.updateItemModal.itemNo = val.ItemNo + this.itemNoBlur('A') + } + if (this.tagNo === 1025) { + this.updateItemModal.itemNo = val.ItemNo + this.itemNoBlur('B') + } + if (this.tagNo === 201) { + this.planModalData.operator = val.AdminID + } + if (this.tagNo === 1031) { + this.planModalData.propertiesCode = val.Code_No + this.planModalData.propertiesDesc = val.Code_Desc + } + if (this.tagNo === 1032) { + this.planModalData.propertiesCode = val.Code_No + this.planModalData.propertiesDesc = val.Code_Desc + } + if (this.tagNo === 1033) { + this.defectModalData.defectID = val.DefectID + this.defectModalData.defectDesc = val.DefectDesc + } + }, // 获取数据列表 getDataList () { this.searchData.limit = this.pageSize @@ -3044,7 +3410,7 @@ } }) }, - copySpares(){ + copyObject(type){ this.spareCopyModalData={ site: this.$store.state.user.site, objectID:'', @@ -3052,13 +3418,18 @@ familyID:'', oldObjectID:this.currentRow.objectID, oldObjectDesc:this.currentRow.objectDesc, + spareFlag:'Y', + itemAFlag:'Y', + itemBFlag:'Y', + defectFlag:'Y', + type:type } this.getObjectCopyList(); this.spareCopyModalFlag=true; }, - saveSpareCopyData(){ + saveCopyData(){ if(this.objectCopySelectionList.length==0){ - this.$alert('请勾选配件!', '错误', { + this.$alert('请勾选设备!', '错误', { confirmButtonText: '确定' }) return false @@ -3071,8 +3442,15 @@ let inList = JSON.parse(JSON.stringify(this.objectCopySelectionList)); for (let i = 0; i < inList.length; i++) { inList[i].oldObjectID = this.currentRow.objectID; + inList[i].type = this.spareCopyModalData.type; + inList[i].createBy=this.$store.state.user.name; + inList[i].spareFlag=this.spareCopyModalData.spareFlag; + inList[i].itemAFlag=this.spareCopyModalData.itemAFlag; + inList[i].itemBFlag=this.spareCopyModalData.itemBFlag; + inList[i].defectFlag=this.spareCopyModalData.defectFlag; } - copyObjectSparesData(inList).then(({data}) => { + + copyObjectSparesData(inList).then(({data}) => { if (data && data.code === 0) { this.spareCopyModalFlag = false; this.$message({ @@ -3088,6 +3466,7 @@ }) } }) + }) }, deleteObjectSpare(row){ @@ -3243,39 +3622,7 @@ }) }, - // 获取基础数据列表S - getBaseList (val,type) { - this.tagNo = val - this.$nextTick(() => { - let strVal = '' - if (val === 1024) { - strVal = this.updateItemModal.itemNo - this.$refs.baseList.init(val, strVal) - } - if (val === 1025) { - strVal = this.updateItemModal.itemNo - this.$refs.baseList.init(val, strVal) - } - if (val === 201) { - strVal = this.modalData.operator - this.$refs.baseList.init(val, strVal) - } - }) - }, - /* 列表方法的回调 */ - getBaseData (val) { - if (this.tagNo === 1024) { - this.updateItemModal.itemNo = val.ItemNo - this.itemNoBlur('A') - } - if (this.tagNo === 1025) { - this.updateItemModal.itemNo = val.ItemNo - this.itemNoBlur('B') - } - if (this.tagNo === 201) { - this.modalData.operator = val.AdminID - } - }, + itemNoBlur(type){ let inData={ itemType:type, @@ -3295,6 +3642,301 @@ } }) }, + + chooseModal(row){ + this.chooseModalData.site=row.site; + this.chooseModalData.objectID=row.objectID; + this.chooseModalData.itemNo=row.itemNo; + this.chooseModalData.itemDesc=row.itemDesc; + this.chooseModalData.itemType=row.itemType; + this.chooseModalData.valueTypeDb=row.valueTypeDb; + searchObjectItemAvailable(this.chooseModalData).then(({data}) => { + this.chooseTableData = data.rows + }) + this.chooseModalFlag=true; + }, + addChooseModal(){ + this.itemFlag= this.chooseModalData.valueTypeDb=='T'?'text':'number'; + this.itemData={ + site:this.chooseModalData.site, + objectID:this.chooseModalData.objectID, + itemNo:this.chooseModalData.itemNo, + valueNo:0, + availableValue:'', + itemType:this.chooseModalData.itemType, + createdBy: this.$store.state.user.name + } + this.itemModalFlag=true; + }, + updateChooseModal(row){ + this.itemFlag= this.chooseModalData.valueTypeDb=='T'?'text':'number'; + this.itemData={ + site:this.chooseModalData.site, + objectID:this.chooseModalData.objectID, + itemNo:this.chooseModalData.itemNo, + valueNo:row.valueNo, + availableValue:row.availableValue, + itemType:this.chooseModalData.itemType, + createdBy: row.createdBy + } + this.itemModalFlag=true; + }, + saveItemAvailable(){ + if(this.itemData.availableValue==''||this.itemData.availableValue==null){ + this.$alert("请输入可选值!",'错误', { + confirmButtonText: '确定' + }) + return false; + } + saveObjectItemAvailable(this.itemData).then(({data}) => { + if (data && data.code === 0) { + searchObjectItemAvailable(this.chooseModalData).then(({data}) => { + this.chooseTableData = data.rows + }) + this.itemModalFlag=false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + deleteItemAvailable(row){ + this.$confirm(`是否删除这个可选值?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + + }).then(() => { + deleteObjectItemAvailable(row).then(({data}) => { + if (data && data.code === 0) { + searchObjectItemAvailable(this.chooseModalData).then(({data}) => { + this.chooseTableData = data.rows + }) + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }).catch(() => { + }) + }, + addPlanModal(type){ + this.planModalData={ + flag:'1', + objectList:[], + functionType:type, + site: this.$store.state.user.site, + planID:'', + planDesc:'', + objectID:'', + objectDesc:'', + propertiesCode:'', + propertiesDesc:'', + operator:'', + planPeriod:'', + status:'', + planStartDate:'', + planEndDate:'', + userId:this.$store.state.user.name, + remark:'', + }; + this.planModalDisableFlag=false; + this.getObjectList(); + this.planModalFlag=true; + }, + getObjectList(){ + getObjectList(this.objectData).then(({data}) => { + this.objectList = data.rows + }) + }, + selectionChangeHandle(val){ + this.objectSelectionList = val + }, + saveData(){ + if (this.planModalData.planDesc == '' || this.planModalData.planDesc == null) { + this.$alert('请输入计划描述 !', '错误', { + confirmButtonText: '确定' + }) + return false + } + if (this.planModalData.propertiesCode == '' || this.planModalData.propertiesCode == null) { + this.$alert('请选择点检模板!', '错误', { + confirmButtonText: '确定' + }) + return false + } + if (this.planModalData.planPeriod == '' || this.planModalData.planPeriod == null) { + this.$alert('选择点检周期!', '错误', { + confirmButtonText: '确定' + }) + return false + } + if (this.planModalData.planStartDate == '' || this.planModalData.planStartDate == null) { + this.$alert('请选择开始日期!', '错误', { + confirmButtonText: '确定' + }) + return false + } + if (this.planModalData.planStartDate < this.dayjs().format("YYYY-MM-DD")) { + this.$alert('计划开始日期不能小于今天!', '错误', { + confirmButtonText: '确定' + }) + return + } + if (this.planModalData.planEndDate == '' || this.planModalData.planEndDate == null) { + this.$alert('请选择结束日期!', '错误', { + confirmButtonText: '确定' + }) + return false + } + if (this.planModalData.planEndDate < this.dayjs().format("YYYY-MM-DD")) { + this.$alert('计划结束日期不能小于今天!', '错误', { + confirmButtonText: '确定' + }) + return + } + if (this.planModalData.planStartDate > this.planModalData.planEndDate) { + this.$alert('计划开始日期不能小于结束日期!', '错误', { + confirmButtonText: '确定' + }) + return + } + if(this.planModalData.flag=='1'){ + if(this.objectSelectionList.length==0){ + this.$alert('请勾选设备!', '错误', { + confirmButtonText: '确定' + }) + return false + } + this.planModalData.objectList=this.objectSelectionList + eamWorkPlanSave(this.planModalData).then(({data}) => { + if (data && data.code === 0) { + this.getCheckPlanData(); + this.getMaintenancePlanData(); + this.planModalFlag=false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }else { + eamWorkPlanEdit(this.modalData).then(({data}) => { + if (data && data.code === 0) { + this.getCheckPlanData(); + this.getMaintenancePlanData(); + this.planModalFlag=false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } + }, + addDefectModal(){ + this.defectModalData={ + flag:'1', + site: this.currentRow.site, + defectID:'', + defectDesc:'', + objectID:this.currentRow.objectID, + objectDesc:this.currentRow.objectDesc, + active:'Y', + id:0, + }; + this.defectModalFlag=true; + }, + saveObjectDefectData(){ + if (this.defectModalData.defectID == '' || this.defectModalData.defectID == null) { + this.$alert('请选择故障编码!', '错误', { + confirmButtonText: '确定' + }) + return false + } + if (this.defectModalData.active == '' || this.defectModalData.active == null) { + this.$alert('选择是否在用!', '错误', { + confirmButtonText: '确定' + }) + return false + } + if(this.defectModalData.flag=='1'){ + eamObjectDefectSave(this.defectModalData).then(({data}) => { + if (data && data.code == '0') { + this.getFaultBehaviorData(); + this.defectModalFlag=false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } + }, + deleteDefect (row) { + this.$confirm(`是否删除这个设备故障?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + + }).then(() => { + eamObjectDefectDelete(row).then(({data}) => { + if (data && data.code == '0') { + this.getFaultBehaviorData(); + this.defectModalFlag=false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }).catch(() => { + }) + }, } }