5 changed files with 3080 additions and 1 deletions
-
6src/api/eam/com_eam_object_add_update.js
-
21src/api/eam/eam_object_list.js
-
15src/assets/scss/global.scss
-
288src/views/modules/eam/com_eam_object_add_update.vue
-
2751src/views/modules/eam/eam_device_list.vue
@ -0,0 +1,6 @@ |
|||
import { createAPI } from "@/utils/httpRequest.js"; |
|||
|
|||
/*新增设备*/ |
|||
export const insertEamObject = data => createAPI('api/pms/eamObject/insertEamObject','post',data) |
|||
/*修改设备*/ |
|||
export const updateEamObject = data => createAPI('api/pms/eamObject/updateEamObject','post',data) |
|||
@ -0,0 +1,21 @@ |
|||
import { createAPI } from "@/utils/httpRequest.js"; |
|||
|
|||
/*查询设备清单*/ |
|||
export const getEamObjectList = data => createAPI('api/pms/eamObject/getEamObjectList','post',data) |
|||
/*查询设备的文件内容*/ |
|||
export const getFileContentList = data => createAPI('api/pms/eamObject/getFileContentList','post',data) |
|||
/*查询设备的备件清单*/ |
|||
export const getDevicePartList = data => createAPI('api/pms/eamObject/getDevicePartList','post',data) |
|||
/*查询设备的点检项目列表*/ |
|||
export const getCheckItemList = data => createAPI('api/pms/eamObject/getCheckItemList','post',data) |
|||
/*查询设备的维保项目列表*/ |
|||
export const getMaintenanceItemList = data => createAPI('api/pms/eamObject/getMaintenanceItemList','post',data) |
|||
/*查询设备的维保计划列表*/ |
|||
export const getMaintenancePlanList = data => createAPI('api/pms/eamObject/getMaintenancePlanList','post',data) |
|||
/*查询设备的历史工单列表*/ |
|||
export const getHistoryOrderList = data => createAPI('api/pms/eamObject/getHistoryOrderList','post',data) |
|||
/*查询设备的故障现象列表*/ |
|||
export const getFaultBehaviorList = data => createAPI('api/pms/eamObject/getFaultBehaviorList','post',data) |
|||
/*删除当前设备*/ |
|||
export const deleteEamObject = data => createAPI('api/pms/eamObject/deleteEamObject','post',data) |
|||
|
|||
@ -0,0 +1,288 @@ |
|||
<template> |
|||
<div class="customer-css"> |
|||
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="360px" style="height: 420px;" class="customer-dialog"> |
|||
<el-form :inline="true" label-position="top" label-width="80px"> |
|||
<!-- --> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item" label="设备编码:" > |
|||
<el-input v-model="pageData.objectID" :disabled="readOnlyFlag" style="width: 120px;" > |
|||
</el-input > |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item" label="设备名称" > |
|||
<el-input v-model="pageData.objectDesc" style="width: 120px;" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item" label="在用" > |
|||
<el-select v-model="pageData.active" style="width: 120px;" > |
|||
<el-option label="Y" value="Y"></el-option> |
|||
<el-option label="N" value="N"></el-option> |
|||
</el-select > |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item"> |
|||
<span slot="label" style="" @click="getBaseList(1026)"><a herf="#">区域:</a></span> |
|||
<el-input v-model="pageData.locationID" style="width: 120px;" > |
|||
</el-input > |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item"> |
|||
<span slot="label" style="" @click="getBaseList(1027)"><a herf="#">分类:</a></span> |
|||
<el-input v-model="pageData.familyID" style="width: 120px;" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item"> |
|||
<span slot="label" style="" @click="getBaseList(1028)"><a herf="#">分组:</a></span> |
|||
<el-input v-model="pageData.groupID" style="width: 120px;" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item"> |
|||
<span slot="label" style="" @click="getBaseList(1029)"><a herf="#">供应商:</a></span> |
|||
<el-input v-model="pageData.supplierID" style="width: 120px;" > |
|||
</el-input > |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item" > |
|||
<span slot="label" style="" @click="getBaseList(1030)"><a herf="#">制造商:</a></span> |
|||
<el-input v-model="pageData.manufacturerID" style="width: 120px;" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item" label="序列号:" > |
|||
<el-input v-model="pageData.seqNo" style="width: 120px;" ></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="12"> |
|||
<el-form-item class="customer-item" label="购入日期:" > |
|||
<el-date-picker class="el-time-width" |
|||
style="width: 120px;" |
|||
v-model="pageData.purchessDate" |
|||
value-format="yyyy-MM-dd"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="saveEamObject()">保存</el-button> |
|||
<el-button type="primary" @click="closeDialog">关闭</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
<!--列表的组件--> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
insertEamObject, |
|||
updateEamObject, |
|||
} from '@/api/eam/com_eam_object_add_update.js'; |
|||
|
|||
/* 引入组件 */ |
|||
import Chooselist from '@/views/modules/common/Chooselist_eam';/* 列表组件 */ |
|||
var functionId = 'C10000001'; |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
titleCon: '设备清单维护', |
|||
visible: false, |
|||
userId: this.$store.state.user.name, |
|||
pageData: { |
|||
site: this.$store.state.user.site, |
|||
username: this.$store.state.user.name, |
|||
objectID: '', |
|||
objectDesc: '', |
|||
locationID: '', |
|||
familyID: '', |
|||
groupID: '', |
|||
supplierID: '', |
|||
manufacturerID: '', |
|||
seqNo: '', |
|||
purchessDate: '', |
|||
active: 'Y', |
|||
addFlag: 'Y', |
|||
checkFlag: 'Y', |
|||
}, |
|||
readOnlyFlag: false, |
|||
dataListLoading: false, |
|||
} |
|||
}, |
|||
methods: { |
|||
//初始化组件的参数 |
|||
init(currentRow) { |
|||
//初始化参数 |
|||
this.pageData = JSON.parse(JSON.stringify(currentRow)); |
|||
//打开页面 |
|||
this.visible = true; |
|||
//判断是否是新增 |
|||
if(this.pageData.addFlag == 'Y'){ |
|||
this.readOnlyFlag = false; |
|||
}else{ |
|||
this.readOnlyFlag = true; |
|||
} |
|||
//重置人员信息 |
|||
this.pageData.username = this.userId; |
|||
//重置标题 |
|||
this.titleCon = this.labels.titleCon; |
|||
}, |
|||
|
|||
/*保存标签自定义的信息*/ |
|||
saveEamObject(){ |
|||
//判断标签内容是否为空 |
|||
let objectID = this.pageData.objectID.trim(); |
|||
let locationID = this.pageData.locationID.trim(); |
|||
let familyID = this.pageData.familyID.trim(); |
|||
let groupID = this.pageData.groupID.trim(); |
|||
let supplierID = this.pageData.supplierID.trim(); |
|||
let manufacturerID = this.pageData.manufacturerID.trim(); |
|||
if(objectID == null || objectID === ''){ |
|||
this.$message.success("设备编码不能为空!"); |
|||
return false; |
|||
} |
|||
if(locationID == null || locationID === ''){ |
|||
this.$message.success("区域不能为空!"); |
|||
return false; |
|||
} |
|||
if(groupID == null || groupID === ''){ |
|||
this.$message.success("分组不能为空!"); |
|||
return false; |
|||
} |
|||
if(familyID == null || familyID === ''){ |
|||
this.$message.success("分类不能为空!"); |
|||
return false; |
|||
} |
|||
if(supplierID == null || supplierID === ''){ |
|||
this.$message.success("供应商不能为空!"); |
|||
return false; |
|||
} |
|||
if(manufacturerID == null || manufacturerID === ''){ |
|||
this.$message.success("制造商不能为空!"); |
|||
return false; |
|||
} |
|||
//判断是否是新增标签自定义 |
|||
if(this.pageData.addFlag === 'Y'){ |
|||
this.insertEamObjectData(); |
|||
}else{ |
|||
this.updateEamObjectData(); |
|||
} |
|||
}, |
|||
|
|||
/*数量失去焦点的事件*/ |
|||
insertEamObjectData(){ |
|||
insertEamObject(this.pageData).then(({data}) => { |
|||
if(data.code == 200){ |
|||
this.$message.success(data.msg); |
|||
setTimeout(this.closeDialog(), 2000); |
|||
}else{ |
|||
this.$message.error(data.msg); |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
/*验证时长的参数*/ |
|||
updateEamObjectData(){ |
|||
updateEamObject(this.pageData).then(({data}) => { |
|||
if(data.code == 200){ |
|||
this.$message.success(data.msg); |
|||
setTimeout(this.closeDialog(), 2000); |
|||
}else{ |
|||
this.$message.error(data.msg); |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
/*关闭modal*/ |
|||
closeDialog(){ |
|||
//刷新报工的页面 |
|||
this.$emit('refreshPageTables'); |
|||
//关闭当前的页面 |
|||
this.visible = false; |
|||
}, |
|||
|
|||
/* 列表方法的回调 */ |
|||
getBaseData(val) { |
|||
if (this.tagNo === 1026) { |
|||
//设置参数 |
|||
this.pageData.locationID = val.LocationID; |
|||
}else if (this.tagNo === 1027) { |
|||
//设置参数 |
|||
this.pageData.familyID = val.FamilyID; |
|||
}else if (this.tagNo === 1028) { |
|||
//设置参数 |
|||
this.pageData.groupID = val.GroupID; |
|||
}else if (this.tagNo === 1029) { |
|||
//设置参数 |
|||
this.pageData.supplierID = val.SupplierID; |
|||
}else if (this.tagNo === 1030) { |
|||
//设置参数 |
|||
this.pageData.manufacturerID = val.ManufacturerID; |
|||
} |
|||
}, |
|||
|
|||
// 获取基础数据列表 |
|||
getBaseList(val) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 1026) { |
|||
strVal = this.pageData.locationID; |
|||
}else if (val === 1027) { |
|||
strVal = this.pageData.familyID; |
|||
}else if (val === 1028) { |
|||
strVal = this.pageData.groupID; |
|||
}else if (val === 1029) { |
|||
strVal = this.pageData.supplierID; |
|||
}else if (val === 1030) { |
|||
strVal = this.pageData.manufacturerID; |
|||
} |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
|
|||
}, |
|||
components: { |
|||
Chooselist, /* 选择的组件 */ |
|||
}, |
|||
watch: { |
|||
pageData: { |
|||
deep: true, |
|||
handler: function (newV, oldV) { |
|||
this.pageData.objectID = this.pageData.objectID.toUpperCase(); |
|||
this.pageData.locationID = this.pageData.locationID.toUpperCase(); |
|||
this.pageData.familyID = this.pageData.familyID.toUpperCase(); |
|||
this.pageData.groupID = this.pageData.groupID.toUpperCase(); |
|||
this.pageData.supplierID = this.pageData.supplierID.toUpperCase(); |
|||
this.pageData.manufacturerID = this.pageData.manufacturerID.toUpperCase(); |
|||
} |
|||
}, |
|||
}, |
|||
created() { |
|||
// this.factoryList() |
|||
// this.getLanguageList() |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
|
|||
</style> |
|||
2751
src/views/modules/eam/eam_device_list.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue