diff --git a/src/views/modules/qc/FAIResultEntry.vue b/src/views/modules/qc/FAIResultEntry.vue index 7b76e06..c174657 100644 --- a/src/views/modules/qc/FAIResultEntry.vue +++ b/src/views/modules/qc/FAIResultEntry.vue @@ -734,8 +734,8 @@
- - + + @@ -852,7 +852,6 @@ import { searchSeqInfo, // 派工单号查询 actionFAIInspection, // 开始检验 dataAcquisition, // 数据采集 - getResponsibleOperatorList, // 获取责任人列表 getFAIItemObjectList, // 查询项目设备 dataAcquisitionByItem, // 根据项目数据采集 cancelApproval2, // 取消审核 @@ -2572,7 +2571,18 @@ export default { getResponsiblePersonList() { this.operatorData.flag = '2' this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo - + if (this.roleList.length > 0) { + let filterList = this.roleList.filter( + (item) => item.roleName === '机修人员' + ) + if (filterList.length > 0) { + this.operatorData.roleId = filterList[0].roleId + } else { + this.operatorData.roleId = this.roleList[0].roleId + } + } else { + this.operatorData.roleId = '' + } // 先清空缓存选中 this.$nextTick(() => this.$refs.operatorTable.clearSelection()) // 拿到选中的人员编号 @@ -2581,7 +2591,7 @@ export default { ? '' : this.detailData.responsiblePerson ).split(';') - getResponsibleOperatorList(this.operatorData).then(({ data }) => { + getOperatorList(this.operatorData).then(({ data }) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach((val) => { @@ -2630,7 +2640,7 @@ export default { ? '' : this.detailData.responsiblePerson ).split(';') - getResponsibleOperatorList(this.operatorData).then(({ data }) => { + getOperatorList(this.operatorData).then(({ data }) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach((val) => { @@ -2660,7 +2670,7 @@ export default { // 确认多选协同人员 confirmOperator() { - if (this.dataListSelections2.length === 0) { + if (this.dataListSelections2.length === 0 && this.operatorData.flag === '1') { this.$message.warning('请勾选人员!') return } @@ -2687,28 +2697,14 @@ export default { this.detailData.operatorName.substring(1) } } else { + const adminIds = [] + const adminNames = [] for (let i = 0; i < this.dataListSelections2.length; i++) { - if ( - !this.detailData.responsiblePerson - .split(';') - .includes(this.dataListSelections2[i].adminID) - ) { - this.detailData.responsiblePersonName = - this.detailData.responsiblePersonName + - ';' + - this.dataListSelections2[i].adminName - this.detailData.responsiblePerson = - this.detailData.responsiblePerson + - ';' + - this.dataListSelections2[i].adminID - } - } - if (this.detailData.responsiblePerson.charAt(0) === ';') { - this.detailData.responsiblePerson = - this.detailData.responsiblePerson.substring(1) - this.detailData.responsiblePersonName = - this.detailData.responsiblePersonName.substring(1) + adminIds.push(this.dataListSelections2[i].adminID) + adminNames.push(this.dataListSelections2[i].adminName) } + this.detailData.responsiblePerson = adminIds.join(';') + this.detailData.responsiblePersonName = adminNames.join(';') } this.operatorData = { flag: '', diff --git a/src/views/modules/qc/FQCResultEntry.vue b/src/views/modules/qc/FQCResultEntry.vue index 7dadfb8..5de7831 100644 --- a/src/views/modules/qc/FQCResultEntry.vue +++ b/src/views/modules/qc/FQCResultEntry.vue @@ -716,8 +716,8 @@
- - + + @@ -836,7 +836,6 @@ import { searchSeqInfo, // 查询派工单号 actionFQCInspection, // 开始检验 dataAcquisition, // 数据采集 - getResponsibleOperatorList, // 获取责任人列表 getFQCItemObjectList, // 查询项目设备 dataAcquisitionByItem, // 根据项目数据采集 cancelApproval2, // 取消审核 @@ -2554,7 +2553,18 @@ export default { getResponsiblePersonList() { this.operatorData.flag = '2' this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo - + if (this.roleList.length > 0) { + let filterList = this.roleList.filter( + (item) => item.roleName === '机修人员' + ) + if (filterList.length > 0) { + this.operatorData.roleId = filterList[0].roleId + } else { + this.operatorData.roleId = this.roleList[0].roleId + } + } else { + this.operatorData.roleId = '' + } // 先清空缓存选中 this.$nextTick(() => this.$refs.operatorTable.clearSelection()) // 拿到选中的人员编号 @@ -2563,7 +2573,7 @@ export default { ? '' : this.detailData.responsiblePerson ).split(';') - getResponsibleOperatorList(this.operatorData).then(({ data }) => { + getOperatorList(this.operatorData).then(({ data }) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach((val) => { @@ -2612,7 +2622,7 @@ export default { ? '' : this.detailData.responsiblePerson ).split(';') - getResponsibleOperatorList(this.operatorData).then(({ data }) => { + getOperatorList(this.operatorData).then(({ data }) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach((val) => { @@ -2642,7 +2652,7 @@ export default { // 确认多选协同人员 confirmOperator() { - if (this.dataListSelections2.length === 0) { + if (this.dataListSelections2.length === 0 && this.operatorData.flag === '1') { this.$message.warning('请勾选人员!') return } @@ -2669,28 +2679,14 @@ export default { this.detailData.operatorName.substring(1) } } else { + const adminIds = [] + const adminNames = [] for (let i = 0; i < this.dataListSelections2.length; i++) { - if ( - !this.detailData.responsiblePerson - .split(';') - .includes(this.dataListSelections2[i].adminID) - ) { - this.detailData.responsiblePersonName = - this.detailData.responsiblePersonName + - ';' + - this.dataListSelections2[i].adminName - this.detailData.responsiblePerson = - this.detailData.responsiblePerson + - ';' + - this.dataListSelections2[i].adminID - } - } - if (this.detailData.responsiblePerson.charAt(0) === ';') { - this.detailData.responsiblePerson = - this.detailData.responsiblePerson.substring(1) - this.detailData.responsiblePersonName = - this.detailData.responsiblePersonName.substring(1) + adminIds.push(this.dataListSelections2[i].adminID) + adminNames.push(this.dataListSelections2[i].adminName) } + this.detailData.responsiblePerson = adminIds.join(';') + this.detailData.responsiblePersonName = adminNames.join(';') } this.operatorData = { flag: '', diff --git a/src/views/modules/qc/IPQCResultEntry.vue b/src/views/modules/qc/IPQCResultEntry.vue index bcb0987..f0abdee 100644 --- a/src/views/modules/qc/IPQCResultEntry.vue +++ b/src/views/modules/qc/IPQCResultEntry.vue @@ -794,8 +794,8 @@
- - + + 0) { + let filterList = this.roleList.filter(item => item.roleName === '机修人员') + if (filterList.length > 0) { + this.operatorData.roleId = filterList[0].roleId + } else { + this.operatorData.roleId = this.roleList[0].roleId + } + } else { + this.operatorData.roleId = '' + } // 先清空缓存选中 this.$nextTick(() => this.$refs.operatorTable.clearSelection()) // 拿到选中的人员编号 let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';') - getResponsibleOperatorList(this.operatorData).then(({data}) => { + getOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2774,7 +2782,7 @@ } else { // 拿到选中的人员编号 let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';') - getResponsibleOperatorList(this.operatorData).then(({data}) => { + getOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2802,7 +2810,7 @@ // 确认多选协同人员 confirmOperator () { - if (this.dataListSelections2.length === 0) { + if (this.dataListSelections2.length === 0 && this.operatorData.flag === '1') { this.$message.warning('请勾选人员!') return } @@ -2818,16 +2826,14 @@ this.detailData.operatorName = this.detailData.operatorName.substring(1) } } else { + const adminIds = [] + const adminNames = [] for (let i = 0; i < this.dataListSelections2.length; i++) { - if (!this.detailData.responsiblePerson.split(';').includes(this.dataListSelections2[i].adminID)) { - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName - this.detailData.responsiblePerson = this.detailData.responsiblePerson + ";" + this.dataListSelections2[i].adminID - } - } - if (this.detailData.responsiblePerson.charAt(0) === ';') { - this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1) - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1) + adminIds.push(this.dataListSelections2[i].adminID) + adminNames.push(this.dataListSelections2[i].adminName) } + this.detailData.responsiblePerson = adminIds.join(';') + this.detailData.responsiblePersonName = adminNames.join(';') } this.operatorData = { flag: '', diff --git a/src/views/modules/qc/IQCResultEntry.vue b/src/views/modules/qc/IQCResultEntry.vue index 09f0909..1592909 100644 --- a/src/views/modules/qc/IQCResultEntry.vue +++ b/src/views/modules/qc/IQCResultEntry.vue @@ -655,8 +655,8 @@
- - + + 0) { - // let filterList = this.roleList.filter(item => item.roleName === '系统管理员') - // if (filterList.length > 0) { - // this.operatorData.roleId = filterList[0].roleId - // } else { - // this.operatorData.roleId = this.roleList[0].roleId - // } - // } else { - // this.operatorData.roleId = '' - // } + if (this.roleList.length > 0) { + let filterList = this.roleList.filter(item => item.roleName === '机修人员') + if (filterList.length > 0) { + this.operatorData.roleId = filterList[0].roleId + } else { + this.operatorData.roleId = this.roleList[0].roleId + } + } else { + this.operatorData.roleId = '' + } // 先清空缓存选中 this.$nextTick(() => this.$refs.operatorTable.clearSelection()) // 拿到选中的人员编号 let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';') - getResponsibleOperatorList(this.operatorData).then(({data}) => { + getOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2278,7 +2277,7 @@ } else { // 拿到选中的人员编号 let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';') - getResponsibleOperatorList(this.operatorData).then(({data}) => { + getOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2306,7 +2305,7 @@ // 确认多选协同人员 confirmOperator () { - if (this.dataListSelections2.length === 0) { + if (this.dataListSelections2.length === 0 && this.operatorData.flag === '1') { this.$message.warning('请勾选人员!') return } @@ -2322,16 +2321,14 @@ this.detailData.operatorName = this.detailData.operatorName.substring(1) } } else { + const adminIds = [] + const adminNames = [] for (let i = 0; i < this.dataListSelections2.length; i++) { - if (!this.detailData.responsiblePerson.split(';').includes(this.dataListSelections2[i].adminID)) { - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName - this.detailData.responsiblePerson = this.detailData.responsiblePerson + ";" + this.dataListSelections2[i].adminID - } - } - if (this.detailData.responsiblePerson.charAt(0) === ';') { - this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1) - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1) + adminIds.push(this.dataListSelections2[i].adminID) + adminNames.push(this.dataListSelections2[i].adminName) } + this.detailData.responsiblePerson = adminIds.join(';') + this.detailData.responsiblePersonName = adminNames.join(';') } this.operatorData = { flag: '', diff --git a/src/views/modules/qc/PQCResultEntry.vue b/src/views/modules/qc/PQCResultEntry.vue index 61c7070..36a2ecd 100644 --- a/src/views/modules/qc/PQCResultEntry.vue +++ b/src/views/modules/qc/PQCResultEntry.vue @@ -892,7 +892,7 @@
- + this.$refs.operatorTable.clearSelection()) // 拿到选中的人员编号 let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';') - getResponsibleOperatorList(this.operatorData).then(({data}) => { + getOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2860,7 +2859,7 @@ export default { } else { // 拿到选中的人员编号 let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';') - getResponsibleOperatorList(this.operatorData).then(({data}) => { + getOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2888,7 +2887,7 @@ export default { // 确认多选协同人员 confirmOperator () { - if (this.dataListSelections2.length === 0) { + if (this.dataListSelections2.length === 0 && this.operatorData.flag === '1') { this.$message.warning('请勾选人员!') return } @@ -2904,16 +2903,14 @@ export default { this.detailData.operatorName = this.detailData.operatorName.substring(1) } } else { + const adminIds = [] + const adminNames = [] for (let i = 0; i < this.dataListSelections2.length; i++) { - if (!this.detailData.responsiblePerson.split(';').includes(this.dataListSelections2[i].adminID)) { - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName - this.detailData.responsiblePerson = this.detailData.responsiblePerson + ";" + this.dataListSelections2[i].adminID - } - } - if (this.detailData.responsiblePerson.charAt(0) === ';') { - this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1) - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1) + adminIds.push(this.dataListSelections2[i].adminID) + adminNames.push(this.dataListSelections2[i].adminName) } + this.detailData.responsiblePerson = adminIds.join(';') + this.detailData.responsiblePersonName = adminNames.join(';') } this.operatorData = { flag: '',