4 changed files with 341 additions and 67 deletions
-
22src/api/eam/eam_object_list.js
-
4src/views/common/login.vue
-
322src/views/modules/eam/com_eam_object_upload_file.vue
-
60src/views/modules/eam/eam_device_list.vue
@ -1,21 +1,25 @@ |
|||||
import { createAPI } from "@/utils/httpRequest.js"; |
import { createAPI } from "@/utils/httpRequest.js"; |
||||
|
|
||||
/*查询设备清单*/ |
/*查询设备清单*/ |
||||
export const getEamObjectList = data => createAPI('/pms/eamObject/getEamObjectList','post',data) |
|
||||
|
export const getEamObjectList = data => createAPI('api/pms/eamObject/getEamObjectList','post',data) |
||||
/*查询设备的文件内容*/ |
/*查询设备的文件内容*/ |
||||
export const getFileContentList = data => createAPI('/sys/file/getSysFileByOrderRef2','post',data) |
|
||||
|
export const getFileContentList = data => createAPI('api/sys/file/getSysFileByOrderRef2','post',data) |
||||
/*查询设备的备件清单*/ |
/*查询设备的备件清单*/ |
||||
export const getDevicePartList = data => createAPI('/pms/resourcespare/getResourceSpareListByResourceId','post',data) |
|
||||
|
export const getDevicePartList = data => createAPI('api/pms/resourcespare/getResourceSpareListByResourceId','post',data) |
||||
/*查询设备的点检项目列表*/ |
/*查询设备的点检项目列表*/ |
||||
export const getCheckItemList = data => createAPI('/pms/eamObject/getCheckItemList','post',data) |
|
||||
|
export const getCheckItemList = data => createAPI('api/pms/eamObject/getCheckItemList','post',data) |
||||
/*查询设备的维保项目列表*/ |
/*查询设备的维保项目列表*/ |
||||
export const getMaintenanceItemList = data => createAPI('/pms/eamObject/getMaintenanceItemList','post',data) |
|
||||
|
export const getMaintenanceItemList = data => createAPI('api/pms/eamObject/getMaintenanceItemList','post',data) |
||||
/*查询设备的维保计划列表*/ |
/*查询设备的维保计划列表*/ |
||||
export const getMaintenancePlanList = data => createAPI('/pms/eamObject/getMaintenancePlanList','post',data) |
|
||||
|
export const getMaintenancePlanList = data => createAPI('api/pms/eamObject/getMaintenancePlanList','post',data) |
||||
/*查询设备的历史工单列表*/ |
/*查询设备的历史工单列表*/ |
||||
export const getHistoryOrderList = data => createAPI('/pms/eamObject/getHistoryOrderList','post',data) |
|
||||
|
export const getHistoryOrderList = data => createAPI('api/pms/eamObject/getHistoryOrderList','post',data) |
||||
/*查询设备的故障现象列表*/ |
/*查询设备的故障现象列表*/ |
||||
export const getFaultBehaviorList = data => createAPI('/pms/eamObject/getFaultBehaviorList','post',data) |
|
||||
|
export const getFaultBehaviorList = data => createAPI('api/pms/eamObject/getFaultBehaviorList','post',data) |
||||
/*删除当前设备*/ |
/*删除当前设备*/ |
||||
export const deleteEamObject = data => createAPI('/pms/eamObject/deleteEamObject','post',data) |
|
||||
|
export const deleteEamObject = data => createAPI('api/pms/eamObject/deleteEamObject','post',data) |
||||
|
/*图片上传*/ |
||||
|
export const uploadEamObjectFile = data => createAPI('/api/sys/file/upload','post',data) |
||||
|
|
||||
|
|
||||
|
|
||||
@ -0,0 +1,322 @@ |
|||||
|
<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="24"> |
||||
|
<el-form-item class="customer-item" label="设备编码:" > |
||||
|
<el-upload class="customer-upload" |
||||
|
drag |
||||
|
action="javascript:void(0);" ref="uploadFile" :limit="1" |
||||
|
:before-upload="beforeUploadHandle" :on-change="onChange" |
||||
|
accept=".jpg,.pdf,.PDF" :auto-upload="false" |
||||
|
style="text-align: left;"> |
||||
|
<i class="el-icon-upload"></i> |
||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
||||
|
</el-upload> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="24"> |
||||
|
<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="24"> |
||||
|
<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="24"> |
||||
|
<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="24"> |
||||
|
<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; |
||||
|
}, |
||||
|
|
||||
|
// 上传之前 |
||||
|
beforeUploadHandle(file) { |
||||
|
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif' && file.type !== 'application/pdf') { |
||||
|
this.$message.error('只支持图片和PDF文档!') |
||||
|
return false |
||||
|
} |
||||
|
this.num++ |
||||
|
}, |
||||
|
|
||||
|
/*选择上传文件时*/ |
||||
|
onChange(file){ |
||||
|
this.fileList.push(file); |
||||
|
}, |
||||
|
|
||||
|
/*保存标签自定义的信息*/ |
||||
|
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> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue