From 197e0aa55a18a27d804d6dd87d90449fedbb9805 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Tue, 18 Jun 2024 11:23:09 +0800 Subject: [PATCH] =?UTF-8?q?2024-06-18=20=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qc/qc.js | 1 + src/views/modules/qc/FAIResultEntry.vue | 44 ++++++++++---------- src/views/modules/qc/FQCResultEntry.vue | 44 ++++++++++---------- src/views/modules/qc/IPQCResultEntry.vue | 44 ++++++++++---------- src/views/modules/qc/IQCResultEntry.vue | 53 ++++++++++++++---------- 5 files changed, 102 insertions(+), 84 deletions(-) diff --git a/src/api/qc/qc.js b/src/api/qc/qc.js index e78353f..51f05d9 100644 --- a/src/api/qc/qc.js +++ b/src/api/qc/qc.js @@ -168,6 +168,7 @@ export const actionIPQCInspection = data => createAPI(`/pms/qc/actionIPQCInspect export const actionFQCInspection = data => createAPI(`/pms/qc/actionFQCInspection`,'post',data) export const dataAcquisition = data => createAPI(`/pms/qc/dataAcquisition`,'post',data) export const getEquipmentNoList = data => createAPI(`/pms/qc/getEquipmentNoList`,'post',data) +export const getResponsibleOperatorList = data => createAPI(`/pms/qc/getResponsibleOperatorList`,'post',data) diff --git a/src/views/modules/qc/FAIResultEntry.vue b/src/views/modules/qc/FAIResultEntry.vue index b05d061..0910768 100644 --- a/src/views/modules/qc/FAIResultEntry.vue +++ b/src/views/modules/qc/FAIResultEntry.vue @@ -775,7 +775,7 @@
- + 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(';') - getOperatorList(this.operatorData).then(({data}) => { + getResponsibleOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2428,7 +2421,7 @@ } else { // 拿到选中的人员编号 let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';') - getOperatorList(this.operatorData).then(({data}) => { + getResponsibleOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2462,18 +2455,26 @@ } if (this.operatorData.flag === '1') { for (let i = 0; i < this.dataListSelections2.length; i++) { - this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName - this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID + if (!this.detailData.operator.split(';').includes(this.dataListSelections2[i].adminID)) { + this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName + this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID + } + } + if (this.detailData.operator.charAt(0) === ';') { + this.detailData.operator = this.detailData.operator.substring(1) + this.detailData.operatorName = this.detailData.operatorName.substring(1) } - this.detailData.operator = this.detailData.operator.substring(1) - this.detailData.operatorName = this.detailData.operatorName.substring(1) } else { for (let i = 0; i < this.dataListSelections2.length; i++) { - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName - this.detailData.responsiblePerson = this.detailData.responsiblePerson + ";" + this.dataListSelections2[i].adminID + 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) } - this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1) - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1) } this.operatorData = { flag: '', @@ -2483,6 +2484,7 @@ adminName: '', roleName: '', roleId: '', + userName: this.$store.state.user.name } this.operatorModelFlag = false }, diff --git a/src/views/modules/qc/FQCResultEntry.vue b/src/views/modules/qc/FQCResultEntry.vue index ce70ef7..2d18585 100644 --- a/src/views/modules/qc/FQCResultEntry.vue +++ b/src/views/modules/qc/FQCResultEntry.vue @@ -751,7 +751,7 @@
- + 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(';') - getOperatorList(this.operatorData).then(({data}) => { + getResponsibleOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2403,7 +2396,7 @@ } else { // 拿到选中的人员编号 let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';') - getOperatorList(this.operatorData).then(({data}) => { + getResponsibleOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2437,18 +2430,26 @@ } if (this.operatorData.flag === '1') { for (let i = 0; i < this.dataListSelections2.length; i++) { - this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName - this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID + if (!this.detailData.operator.split(';').includes(this.dataListSelections2[i].adminID)) { + this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName + this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID + } + } + if (this.detailData.operator.charAt(0) === ';') { + this.detailData.operator = this.detailData.operator.substring(1) + this.detailData.operatorName = this.detailData.operatorName.substring(1) } - this.detailData.operator = this.detailData.operator.substring(1) - this.detailData.operatorName = this.detailData.operatorName.substring(1) } else { for (let i = 0; i < this.dataListSelections2.length; i++) { - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName - this.detailData.responsiblePerson = this.detailData.responsiblePerson + ";" + this.dataListSelections2[i].adminID + 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) } - this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1) - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1) } this.operatorData = { flag: '', @@ -2458,6 +2459,7 @@ adminName: '', roleName: '', roleId: '', + userName: this.$store.state.user.name } this.operatorModelFlag = false }, diff --git a/src/views/modules/qc/IPQCResultEntry.vue b/src/views/modules/qc/IPQCResultEntry.vue index 2e0ef2f..f5b7f47 100644 --- a/src/views/modules/qc/IPQCResultEntry.vue +++ b/src/views/modules/qc/IPQCResultEntry.vue @@ -773,7 +773,7 @@
- + 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(';') - getOperatorList(this.operatorData).then(({data}) => { + getResponsibleOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2457,7 +2450,7 @@ } else { // 拿到选中的人员编号 let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';') - getOperatorList(this.operatorData).then(({data}) => { + getResponsibleOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -2491,18 +2484,26 @@ } if (this.operatorData.flag === '1') { for (let i = 0; i < this.dataListSelections2.length; i++) { - this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName - this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID + if (!this.detailData.operator.split(';').includes(this.dataListSelections2[i].adminID)) { + this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName + this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID + } + } + if (this.detailData.operator.charAt(0) === ';') { + this.detailData.operator = this.detailData.operator.substring(1) + this.detailData.operatorName = this.detailData.operatorName.substring(1) } - this.detailData.operator = this.detailData.operator.substring(1) - this.detailData.operatorName = this.detailData.operatorName.substring(1) } else { for (let i = 0; i < this.dataListSelections2.length; i++) { - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName - this.detailData.responsiblePerson = this.detailData.responsiblePerson + ";" + this.dataListSelections2[i].adminID + 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) } - this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1) - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1) } this.operatorData = { flag: '', @@ -2512,6 +2513,7 @@ adminName: '', roleName: '', roleId: '', + userName: this.$store.state.user.name } this.operatorModelFlag = false }, diff --git a/src/views/modules/qc/IQCResultEntry.vue b/src/views/modules/qc/IQCResultEntry.vue index 829f4be..4baafc3 100644 --- a/src/views/modules/qc/IQCResultEntry.vue +++ b/src/views/modules/qc/IQCResultEntry.vue @@ -489,7 +489,7 @@
- + 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(';') - getOperatorList(this.operatorData).then(({data}) => { + getResponsibleOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -1745,7 +1747,7 @@ } else { // 拿到选中的人员编号 let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';') - getOperatorList(this.operatorData).then(({data}) => { + getResponsibleOperatorList(this.operatorData).then(({data}) => { if (data && data.code === 0) { this.operatorList = data.rows this.operatorList.forEach(val => { @@ -1779,18 +1781,26 @@ } if (this.operatorData.flag === '1') { for (let i = 0; i < this.dataListSelections2.length; i++) { - this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName - this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID + if (!this.detailData.operator.split(';').includes(this.dataListSelections2[i].adminID)) { + this.detailData.operatorName = this.detailData.operatorName + ";" + this.dataListSelections2[i].adminName + this.detailData.operator = this.detailData.operator + ";" + this.dataListSelections2[i].adminID + } + } + if (this.detailData.operator.charAt(0) === ';') { + this.detailData.operator = this.detailData.operator.substring(1) + this.detailData.operatorName = this.detailData.operatorName.substring(1) } - this.detailData.operator = this.detailData.operator.substring(1) - this.detailData.operatorName = this.detailData.operatorName.substring(1) } else { for (let i = 0; i < this.dataListSelections2.length; i++) { - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName + ";" + this.dataListSelections2[i].adminName - this.detailData.responsiblePerson = this.detailData.responsiblePerson + ";" + this.dataListSelections2[i].adminID + 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) } - this.detailData.responsiblePerson = this.detailData.responsiblePerson.substring(1) - this.detailData.responsiblePersonName = this.detailData.responsiblePersonName.substring(1) } this.operatorData = { flag: '', @@ -1800,6 +1810,7 @@ adminName: '', roleName: '', roleId: '', + userName: this.$store.state.user.name } this.operatorModelFlag = false },