@@ -848,6 +851,7 @@
import qcFAIUploadFile from "./qc_FAI_upload_file"
import comQcItemImageUploadFile from "./com_qc_itemImage_upload_file"
import subDetailUpload from "./sub_detail_upload"
+ import {getWorkCenterData} from "../../../api/base/site";
export default {
components: {
Chooselist,
@@ -907,6 +911,7 @@
},
tagNo:'',
tagType: '',
+ personnelSynchronizationFlag: true,
searchData: {
site: '',
userName: this.$store.state.user.name,
@@ -2194,6 +2199,7 @@
this.$set(this.IQCSelections[index], 'inspectorNo', this.$store.state.user.name)
})
this.detailModal2(this.IQCSelections[0])
+ this.personnelSynchronizationFlag = true
} else {
this.$message.warning('检验单必须为待检验状态!')
return
@@ -2573,6 +2579,17 @@
if (this.IQCSelections[this.batchIndex].operator.charAt(0) === ';') {
this.IQCSelections[this.batchIndex].operator = this.IQCSelections[this.batchIndex].operator.substring(1)
this.IQCSelections[this.batchIndex].operatorName = this.IQCSelections[this.batchIndex].operatorName.substring(1)
+
+ // 如果是人员同步且有多条数据需要同步 那么就将其他数据的人员也同步
+ if (this.personnelSynchronizationFlag && this.IQCSelections.length > 1) {
+ // 拿到除了this.batchIndex的所有数据
+ let tempData = this.IQCSelections.filter((item, index) => index !== this.batchIndex)
+ // 遍历数据
+ tempData.forEach(item => {
+ this.$set(item, 'operator', this.IQCSelections[this.batchIndex].operator)
+ this.$set(item, 'operatorName', this.IQCSelections[this.batchIndex].operatorName)
+ })
+ }
}
} else if (this.operatorData.flag === '4') {
for (let i = 0; i < this.dataListSelections2.length; i++) {
@@ -2584,6 +2601,17 @@
if (this.IQCSelections[this.batchIndex].responsiblePerson.charAt(0) === ';') {
this.IQCSelections[this.batchIndex].responsiblePerson = this.IQCSelections[this.batchIndex].responsiblePerson.substring(1)
this.IQCSelections[this.batchIndex].responsiblePersonName = this.IQCSelections[this.batchIndex].responsiblePersonName.substring(1)
+
+ // 如果是人员同步且有多条数据需要同步 那么就将其他数据的人员也同步
+ if (this.personnelSynchronizationFlag && this.IQCSelections.length > 1) {
+ // 拿到除了this.batchIndex的所有数据
+ let tempData = this.IQCSelections.filter((item, index) => index !== this.batchIndex)
+ // 遍历数据
+ tempData.forEach(item => {
+ this.$set(item, 'responsiblePerson', this.IQCSelections[this.batchIndex].responsiblePerson)
+ this.$set(item, 'responsiblePersonName', this.IQCSelections[this.batchIndex].responsiblePersonName)
+ })
+ }
}
}
this.operatorData = {