diff --git a/src/views/modules/eam/com_eam_object_add_update.vue b/src/views/modules/eam/com_eam_object_add_update.vue index df366b5..2e41fd7 100644 --- a/src/views/modules/eam/com_eam_object_add_update.vue +++ b/src/views/modules/eam/com_eam_object_add_update.vue @@ -112,6 +112,12 @@ + + + 设备负责人 + + + 关闭 + + + +
+ + + + + + + + + + + + + + + 查询 + + +
+ + + + + + + + + + 保存 + 关闭 + +
+ @@ -142,6 +210,7 @@ import { import {getSiteAndBuByUserName} from "@/api/eam/eam.js" /* 引入组件 */ import Chooselist from '@/views/modules/common/Chooselist_eam'; +import {getOperatorList, getUserRoleList} from "../../../api/eam/eam"; var functionId = 'C10000001'; export default { @@ -150,6 +219,11 @@ export default { titleCon: '设备清单维护', visible: false, userId: this.$store.state.user.name, + detailData:{}, + fastAddFlag:false, + roleList:[], + itemSelections:[], + operatorList:[], pageData: { site: '', bu: '', @@ -263,6 +337,49 @@ export default { } }) }, + addDeviceManager(){ + this.detailData.bu = this.pageData.bu + //查询角色列表 + this.getUserRoleList() + //设置默认查询 机修人员 + this.$set(this.detailData, 'roleId', 20) + //查询人员 + this.getOperatorList() + this.fastAddFlag = true + }, + getOperatorList(){ + getOperatorList(this.detailData).then(({data})=>{ + if (data && data.code === 0) { + this.operatorList = data.rows + } + }) + }, + // 获取用户角色 + getUserRoleList () { + getUserRoleList().then(({data}) => { + if (data.code === 0) { + this.roleList = data.rows + console.log(this.roleList) + } else { + this.roleList = [] + } + }) + }, + addOperators(){ + let str = '' + this.itemSelections.forEach((item)=>{ + str = str + item.adminID + ';' + }) + str = str.slice(0,-1) + this.pageData.deviceManager = str + this.fastAddFlag = false + }, + selectionItemList (val) { + this.itemSelections = val + }, + selectFlag () { + return true + }, // 初始化组件的参数 init (currentRow) { diff --git a/src/views/modules/eam/eamFeedBack.vue b/src/views/modules/eam/eamFeedBack.vue index 601f1d7..82f2ec5 100644 --- a/src/views/modules/eam/eamFeedBack.vue +++ b/src/views/modules/eam/eamFeedBack.vue @@ -167,7 +167,7 @@ - 选择计划执行人员 + 选择计划执行人员 @@ -298,7 +298,7 @@
- 计划维修人员 + 计划维修人员 @@ -1561,15 +1561,28 @@ } this.saveFeedMatterFlag = true }, - getClassesList() { + async getClassesList() { let split = this.saveModalData.bu.split('_') let params = { site: split[0], buNo: split[1] } - getClassesList(params).then(({data}) => { + await getClassesList(params).then(({data}) => { if (data.code === 0) { this.classesList = data.rows + let h = new Date().getHours(); + this.classesList.forEach((options)=>{ + //判断当前时间是白班|夜班 + if (h >= 8 && h < 20){ + if (options.description.includes('白班')){ + this.$set(this.operatorData,'classesCode',options.code) + } + } else { + if (options.description.includes('夜班')){ + this.$set(this.operatorData,'classesCode',options.code) + } + } + }) } else { this.$message.warning(data.msg) } @@ -1683,13 +1696,25 @@ }, // 列表方法的回调 - getBaseData (val) { + async getBaseData (val) { if (this.tagNo === 201) { this.saveMatterData.trackingPersonnel = val.username } if (this.tagNo === 200) { this.saveModalData.objectID = val.ObjectID this.saveModalData.objectDesc = val.ObjectDesc + if (val.deviceManager!=''&&val.deviceManager!=null){ + let peopleList = val.deviceManager.split(';') + await this.getOperatorList(1) + peopleList.forEach((username)=>{ + this.operatorList.forEach((item)=>{ + if (item.adminID === username){ + this.saveModalData.planOperator = item.adminID + this.saveModalData.planOperatorName = item.adminName + } + }) + }) + } } if (this.tagNo === 1055) { this.saveModalData.defectID = val.DefectID @@ -1843,7 +1868,7 @@ }, // 获取机修人员列表 - getOperatorList () { + async getOperatorList (type) { this.operatorData.bu = this.saveModalData.bu this.$set(this.operatorData,'date',this.saveModalData.defectDate) if (this.roleList.length > 0) { @@ -1859,12 +1884,14 @@ //先清空班次信息 this.$set(this.operatorData,'classesCode','') //根据bu查询班次信息 - this.getClassesList() + await this.getClassesList() // 查询人员 - getOperatorListByOrder(this.operatorData).then(({data}) => { + await getOperatorListByOrder(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows - this.operatorModelFlag = true + if (type != 1){ + this.operatorModelFlag = true + } } else { this.operatorList = [] }