ruanqi 3 years ago
parent
commit
5ebb61138e
  1. 2
      src/api/eam/eam.js
  2. 285
      src/views/modules/eam/eam_device_list.vue

2
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)

285
src/views/modules/eam/eam_device_list.vue

@ -183,6 +183,10 @@
</el-tab-pane>
<!-- 点检项目 -->
<el-tab-pane label="点检项目" name="check_item">
<el-form :inline="true" label-position="top" style="margin-top: 5px">
<el-button type="primary" @click="addItemModal('A')">新增项目</el-button>
<el-button type="primary" @click="copyCheckItems('A')">复制到其他设备</el-button>
</el-form>
<el-table
:height="secondHeight"
:data="checkItemList"
@ -205,10 +209,26 @@
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="100"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="updateObjectItem(scope.row)">修改</a>
<a type="text" size="small" @click="deleteObjectItem(scope.row)">删除</a>
<a type="text" size="small" v-if="scope.row.valueChooseFlag=='Y'" @click="chooseModal(scope.row)">可选值</a>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<!-- 维保项目 -->
<el-tab-pane label="维保项目" name="maintenance_item">
<el-form :inline="true" label-position="top" style="margin-top: 5px">
<el-button type="primary" @click="addItemModal('B')">新增项目</el-button>
<el-button type="primary" @click="copyCheckItems('B')">复制到其他设备</el-button>
</el-form>
<el-table
:height="secondHeight"
:data="maintenanceItemList"
@ -231,6 +251,18 @@
style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="100"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="updateObjectItem(scope.row)">修改</a>
<a type="text" size="small" @click="deleteObjectItem(scope.row)">删除</a>
<a type="text" size="small" v-if="scope.row.valueChooseFlag=='Y'" @click="chooseModal(scope.row)">可选值</a>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<!-- 维保计划 -->
@ -549,7 +581,54 @@
<el-button type="primary" @click="spareCopyModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 维护点检项目 -->
<el-dialog title="维护项目" :close-on-click-modal="false" v-drag :visible.sync="updateItemModalFlag" width="430px">
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item >
<span slot="label" v-if="updateItemModal.itemType=='A'&&updateItemModal.flag=='0'" style="" @click="getBaseList(1024)"><a herf="#">点检项目编码</a></span>
<span slot="label" v-if="updateItemModal.itemType=='B'&&updateItemModal.flag=='0'" style="" @click="getBaseList(1025)"><a herf="#">维保项目编码</a></span>
<span slot="label" v-if="updateItemModal.itemType=='A'&&updateItemModal.flag=='1'" style="" >点检项目编码</span>
<span slot="label" v-if="updateItemModal.itemType=='B'&&updateItemModal.flag=='1'" style="" >维保项目编码</span>
<el-input v-model="updateItemModal.itemNo" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="updateItemLabel.itemDescLabel">
<el-input v-model="updateItemModal.itemDesc" disabled style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'检测值类型'">
<el-select filterable v-model="updateItemModal.valueTypeDb" style="width: 120px">
<el-option label="文本" value="T"></el-option>
<el-option label="数字" value="N"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item :label="updateItemLabel.itemRemarkLabel">
<el-input v-model="updateItemModal.itemRemark" disabled style="width: 254px"></el-input>
</el-form-item>
<el-form-item :label="'是否值可选'">
<el-select filterable v-model="updateItemModal.valueChooseFlag" style="width: 120px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="参照值:">
<el-input v-model="updateItemModal.defaultValue" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="最大值:">
<el-input v-model="updateItemModal.maxValue" type="number" style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="最小值:">
<el-input v-model="updateItemModal.minValue" type="number" style="width: 120px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:40px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="saveItemsData()">保存</el-button>
<el-button type="primary" @click="updateItemModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
@ -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=''
}
})
},
}
}
</script>

Loading…
Cancel
Save