From 5ebb61138e8bdaa13a0c8b856a5c291adb072fa7 Mon Sep 17 00:00:00 2001 From: ruanqi Date: Thu, 16 Mar 2023 18:32:55 +0800 Subject: [PATCH] 1 --- src/api/eam/eam.js | 2 + src/views/modules/eam/eam_device_list.vue | 285 +++++++++++++++++++++- 2 files changed, 284 insertions(+), 3 deletions(-) diff --git a/src/api/eam/eam.js b/src/api/eam/eam.js index fb91ef3..5f0e9a6 100644 --- a/src/api/eam/eam.js +++ b/src/api/eam/eam.js @@ -149,3 +149,5 @@ export const copyObjectSparesData= data => createAPI(`/pms/eam/copyObjectSparesD export const getWorkPlanDataWithObjectID= data => createAPI(`/pms/eam/getWorkPlanDataWithObjectID`,'post',data) export const getObjectItemList= data => createAPI(`/pms/eam/getObjectItemList`,'post',data) 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) diff --git a/src/views/modules/eam/eam_device_list.vue b/src/views/modules/eam/eam_device_list.vue index 86135d1..f99ce83 100644 --- a/src/views/modules/eam/eam_device_list.vue +++ b/src/views/modules/eam/eam_device_list.vue @@ -183,6 +183,10 @@ + + 新增项目 + 复制到其他设备 + + + + + + 新增项目 + 复制到其他设备 + + + + @@ -549,7 +581,54 @@ 关闭 - + + + + + 点检项目编码 + 维保项目编码 + 点检项目编码 + 维保项目编码 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + + @@ -575,6 +654,9 @@ getWorkPlanDataWithObjectID, getObjectItemList, getDefectWithObject, + saveObjectItemData, + eamPropertiesItemSearch, + deleteObjectItem, } from '@/api/eam/eam.js'; import { updateOssRef @@ -584,10 +666,12 @@ } from '@/api/partspare/resourcespare.js' /*引入組件*/ import comAddUpdateEamObject from "./com_eam_object_add_update";/*新增或者修改的組件*/ - + import Chooselist from '@/views/modules/common/Chooselist_eam' export default { + data () { return { + tagNo:'', activeTable: 'file_content', folder: 'eamObject', eamObjectId: '', @@ -2599,11 +2683,34 @@ }, ], //设备维保计划分页新增 0315 rq ---end + //设备点检项目分页新增 0315 rq ---start + updateItemModalFlag:false, + updateItemLabel:{ + itemDescLabel:'', + itemRemarkLabel:'', + }, + updateItemModal:{ + flag:'', + site:'', + objectID:'', + itemNo:'', + itemDesc:'', + itemType:'', + valueTypeDb:'', + itemRemark:'', + valueChooseFlag:'', + defaultValue:'', + maxValue:'', + minValue:'', + userId:'', + }, + //设备点检项目分页新增 0315 rq ---end } }, components: { comAddUpdateEamObject,/*新增或者修改的组件*/ + Chooselist, }, mounted () { @@ -2960,7 +3067,6 @@ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' - }).then(() => { let inList = JSON.parse(JSON.stringify(this.objectCopySelectionList)); for (let i = 0; i < inList.length; i++) { @@ -3016,6 +3122,179 @@ } }); }, + //--------------项目--------------------- + addItemModal(type){ + if(type=='A'){ + this.updateItemLabel={ + itemDescLabel:'点检项目名称', + itemRemarkLabel:'点检方法说明', + } + }else { + this.updateItemLabel={ + itemDescLabel:'维保项目名称', + itemRemarkLabel:'维保方法说明', + } + } + this.updateItemModal={ + flag:'0', + site:this.currentRow.site, + objectID:this.currentRow.objectID, + itemNo:'', + itemDesc:'', + itemType:type, + valueTypeDb:'T', + itemRemark:'', + valueChooseFlag:'', + defaultValue:'', + maxValue:'', + minValue:'', + userId:this.$store.state.user.name, + } + this.updateItemModalFlag=true; + }, + updateObjectItem(row){ + if(row.itemType=='A'){ + this.updateItemLabel={ + itemDescLabel:'点检项目名称', + itemRemarkLabel:'点检方法说明', + } + }else { + this.updateItemLabel={ + itemDescLabel:'维保项目名称', + itemRemarkLabel:'维保方法说明', + } + } + this.updateItemModal={ + flag:'1', + site:this.currentRow.site, + objectID:this.currentRow.objectID, + itemNo:row.itemNo, + itemDesc:row.itemDesc, + itemType:row.itemType, + valueTypeDb:row.valueTypeDb, + itemRemark:row.itemRemark, + valueChooseFlag:row.valueChooseFlag, + defaultValue:row.defaultValue, + maxValue:row.maxValue, + minValue:row.minValue, + userId:this.$store.state.user.name, + } + this.updateItemModalFlag=true; + }, + saveItemsData(){ + console.log(this.updateItemModal) + if (this.updateItemModal.itemNo == '' || this.updateItemModal.itemNo == null) { + this.$alert('请选择项目编码!', '错误', { + confirmButtonText: '确定' + }) + return false + } + saveObjectItemData(this.updateItemModal).then(({data}) => { + if (data && data.code == '0') { + if(this.updateItemModal.itemType=='A'){ + this.getCheckItemData(); + }else { + this.getMaintenanceItemData(); + } + this.updateItemModalFlag=false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + + }, + deleteObjectItem(row){ + this.$confirm(`是否删除这个项目?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + + }).then(() => { + deleteObjectItem(row).then(({data}) => { + if (data && data.code === 0) { + if(row.itemType=='A'){ + this.getCheckItemData(); + }else { + this.getMaintenanceItemData(); + } + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }).catch(() => { + }) + }, + + // 获取基础数据列表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, + itemNo:this.updateItemModal.itemNo + } + eamPropertiesItemSearch(inData).then(({data}) => { + if(data.rows.length>0){ + this.updateItemModal.itemDesc=data.rows[0].itemDesc + this.updateItemModal.valueTypeDb=data.rows[0].valueTypeDb + this.updateItemModal.itemRemark=data.rows[0].itemRemark + this.updateItemModal.valueChooseFlag=data.rows[0].valueChooseFlag + this.updateItemModal.defaultValue=data.rows[0].defaultValue + this.updateItemModal.maxValue=data.rows[0].maxValue + this.updateItemModal.minValue=data.rows[0].minValue + }else { + this.detailData.itemDesc='' + } + }) + }, } }