diff --git a/src/views/modules/sampleManagement/com_technical-add-or-update.vue b/src/views/modules/sampleManagement/com_technical-add-or-update.vue index 8038c11..99f392c 100644 --- a/src/views/modules/sampleManagement/com_technical-add-or-update.vue +++ b/src/views/modules/sampleManagement/com_technical-add-or-update.vue @@ -61,12 +61,14 @@ - Select CQC - + + Select CQC + - Select FAI - + + Select FAI + @@ -95,7 +97,7 @@ Select DCC - + @@ -112,7 +114,7 @@ - {{'确定'}} + {{'确定'}} {{'关闭'}} @@ -364,6 +366,41 @@ + + + + + + + + + + + @@ -424,7 +461,9 @@ cqcOperator: '', faiOperator: '', cqcOperatorName: '', + cqcOperatorList:[], faiOperatorName: '', + faiOperatorList: [], peOperater: '', peOperaterName: '', csOperater: '', @@ -508,6 +547,18 @@ proofingModelFlag:false, partList:[], partModelFlag:false, + // 新增加载状态 + saveLoading:false, + + // 人员信息集合 + operatorProp:{ + key: 'operatorId', + label: 'operatorName' + }, + cqcVisible:false, + cqcOperatorList:[], + faiVisible:false, + faiOperatorList:[], } }, created () { @@ -771,7 +822,9 @@ cqcOperator: '', faiOperator: '', cqcOperatorName: '', + cqcOperatorList:[], faiOperatorName: '', + faiOperatorList: [], peOperater: '', peOperaterName: '', csOperater: this.$store.state.user.name, @@ -871,12 +924,7 @@ this.dataForm.finalPartNo = row.finalPartNo this.dataForm.buNo = row.buNo // 查询DCC人员 - let inData = { - site: this.dataForm.site, - buNo: this.dataForm.buNo, - roleNo: 'R015' - } - searchBMUser(inData).then(({data}) => { + this.queryUserInfoByBM('R015').then(({data}) => { if (data && data.code === 0){ this.$nextTick(() => { this.operatorList = data.rows @@ -886,6 +934,28 @@ }) } }) + // CQC + this.queryUserInfoByBM('R008').then(({data}) => { + if (data && data.code === 0){ + this.$nextTick(() => { + this.cqcOperatorList = data.rows + this.dataForm.cqcOperatorList = data.rows.map(item=>item.operatorId) + this.handleSaveCqcOperator() + this.cqcOperatorList = [] + }) + } + }) + // FAI + this.queryUserInfoByBM('R009').then(({data}) => { + if (data && data.code === 0){ + this.$nextTick(() => { + this.faiOperatorList = data.rows + this.dataForm.faiOperatorList = data.rows.map(item=>item.operatorId) + this.handleSaveFaiOperator() + this.faiOperatorList = [] + }) + } + }) this.partModelFlag = false }, @@ -1002,7 +1072,6 @@ // 表单提交 dataFormSubmit () { if(this.dataForm.testPartNo===''){ - this.$message.error('请输入测试料号!') return false } @@ -1014,31 +1083,33 @@ this.dataForm.engineerList.push(this.dataForm.engineerNo); this.dataForm.technicianList = []; this.dataForm.technicianList.push(this.dataForm.technicianNo); + this.saveLoading = true saveTechnicalSpecificationSheet(this.dataForm).then(({data}) => { if (data && data.code === 0) { this.$message.success( '操作成功') this.visible = false this.$emit('refreshDataList') if(this.jumpFlag){ - this.$nextTick(function () { - setTimeout(() => { - let inData = { - site: this.$store.state.user.site, - codeNo: data.row.codeNo, - buNo: data.row.buNo, - username: this.$store.state.user.name - }; - localStorage.setItem('tsfData', JSON.stringify(inData)) - window.open('#/BMPage'); - },500) - }) + setTimeout(() => { + let inData = { + site: this.$store.state.user.site, + codeNo: data.row.codeNo, + buNo: data.row.buNo, + username: this.$store.state.user.name + }; + localStorage.setItem('tsfData', JSON.stringify(inData)) + window.open('#/BMPage'); + },500) } } else { this.$message.error(data.msg) } + this.saveLoading = false + }).catch((error)=>{ + this.$message.error(error) + this.saveLoading = false }) - }, changeTestDesc(){ this.dataForm.proofingNo=""; @@ -1072,19 +1143,85 @@ this.refreshPartList() }, dccChooseModal(){ - let inData={ - site:this.dataForm.site, - buNo:this.dataForm.buNo, - roleNo:'R015' - } + // let inData={ + // site:this.dataForm.site, + // buNo:this.dataForm.buNo, + // roleNo:'R015' + // } this.operatorList = []; - searchBMUser(inData).then(({data}) => { - this.operatorList=data.rows + this.queryUserInfoByBM('R015').then(({data}) => { + this.operatorList = data.rows }) this.dccList = JSON.parse(JSON.stringify(this.dataForm.dccList)); this.dccFlag=true }, - + queryUserInfoByBM(roleNo){ + let params = { + site:this.dataForm.site, + buNo:this.dataForm.buNo, + roleNo:roleNo, + } + return searchBMUser(params) + }, + handleCqcOperator(){ + this.cqcVisible = true; + this.cqcOperatorList = [] + this.queryUserInfoByBM('R008').then(({data}) => { + if (data && data.code === 0){ + this.cqcOperatorList = data.rows + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error); + }) + }, + handleFaiOperator(){ + this.faiVisible = true; + this.faiOperatorList = [] + this.queryUserInfoByBM('R009').then(({data}) => { + if (data && data.code === 0){ + this.faiOperatorList = data.rows + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error); + }) + }, + handleSaveCqcOperator(){ + this.dataForm.cqcOperatorName = this.cqcOperatorList.filter(item => this.dataForm.cqcOperatorList.includes(item.operatorId)).map(item=> item.operatorName).join(';'); + this.cqcVisible = false; + }, + handleSaveFaiOperator(){ + this.dataForm.faiOperatorName = this.faiOperatorList.filter(item => this.dataForm.faiOperatorList.includes(item.operatorId)).map(item=> item.operatorName).join(';'); + this.faiVisible = false; + }, + }, + watch:{ + saveLoading(newVal,oldVal){ + if (newVal){ + setTimeout(()=>{ + this.saveLoading = false + },30000) + } + }, + visible(newVal,oldVal){ + if (!newVal){ + this.dataForm.cqcOperatorList = [] + this.dataForm.faiOperatorList = [] + } + }, + cqcVisible(newVal,oldVal){ + if (!newVal){ + this.cqcOperatorList = [] + } + }, + faiVisible(newVal,oldVal){ + if (!newVal){ + this.faiOperatorList = [] + } + }, }, } diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue index a26d6ba..2c0c7dc 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue @@ -182,16 +182,18 @@
- Select CQC - + + Select CQC +
- Select FAI - + + Select FAI +
@@ -315,6 +317,43 @@ + + + + + + + + + + + + + @@ -421,6 +460,8 @@ technicianNo:'', dcc:'', dccList:'', + cqcOperatorList:[], + faiOperatorList:[], relevancePartNo:'', }, dataRole: { @@ -441,6 +482,15 @@ }, rejectOpinion: '', submitModalFlag: false, + // 人员信息集合 + operatorProp:{ + key: 'operatorId', + label: 'operatorName' + }, + cqcVisible:false, + cqcOperatorList:[], + faiVisible:false, + faiOperatorList:[], } }, methods: { @@ -604,6 +654,7 @@ this.quotationNo = data.rows[0].quotationNo } }) + // dcc 人员查询 let inData5 = { site: this.dataForm.site, codeNo: this.dataForm.codeNo, @@ -612,6 +663,28 @@ searchTechnicalSpecificationTeamStr(inData5).then(({data}) => { this.dataForm.dccList = data.rows }) + // cqc + let cqcParams = { + site: this.dataForm.site, + codeNo: this.dataForm.codeNo, + type: 'cqc', + } + searchTechnicalSpecificationTeamStr(cqcParams).then(({data}) => { + if (data && data.code === 0){ + this.dataForm.cqcOperatorList = data.rows + } + }) + // fai + let faiParams = { + site: this.dataForm.site, + codeNo: this.dataForm.codeNo, + type: 'fai', + } + searchTechnicalSpecificationTeamStr(faiParams).then(({data}) => { + if (data && data.code === 0){ + this.dataForm.faiOperatorList = data.rows + } + }) } else { this.dataList = ''; this.$alert('刷新失败请重新打开技术参数卡', '失败', { @@ -672,6 +745,28 @@ searchTechnicalSpecificationTeamStr(inData5).then(({data}) => { this.dataForm.dccList = data.rows }) + // cqc + let cqcParams = { + site: this.dataForm.site, + codeNo: this.dataForm.codeNo, + type: 'cqc', + } + searchTechnicalSpecificationTeamStr(cqcParams).then(({data}) => { + if (data && data.code === 0){ + this.dataForm.cqcOperatorList = data.rows + } + }) + // fai + let faiParams = { + site: this.dataForm.site, + codeNo: this.dataForm.codeNo, + type: 'fai', + } + searchTechnicalSpecificationTeamStr(faiParams).then(({data}) => { + if (data && data.code === 0){ + this.dataForm.faiOperatorList = data.rows + } + }) } else { this.dataList = ''; } @@ -974,6 +1069,66 @@ }) }, + queryUserInfoByBM(roleNo){ + let params = { + site:this.dataForm.site, + buNo:this.dataForm.buNo, + roleNo:roleNo, + } + return searchBMUser(params) + }, + handleCqcOperator(){ + if(this.ifDisableFlag){ + return + } + this.cqcVisible = true; + this.cqcOperatorList = [] + this.queryUserInfoByBM('R008').then(({data}) => { + if (data && data.code === 0){ + this.cqcOperatorList = data.rows + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error); + }) + }, + handleFaiOperator(){ + if(this.ifDisableFlag){ + return + } + this.faiVisible = true; + this.faiOperatorList = [] + this.queryUserInfoByBM('R009').then(({data}) => { + if (data && data.code === 0){ + this.faiOperatorList = data.rows + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error); + }) + }, + handleSaveCqcOperator(){ + this.dataForm.cqcOperatorName = this.cqcOperatorList.filter(item => this.dataForm.cqcOperatorList.includes(item.operatorId)).map(item=> item.operatorName).join(';'); + this.cqcVisible = false; + }, + handleSaveFaiOperator(){ + this.dataForm.faiOperatorName = this.faiOperatorList.filter(item => this.dataForm.faiOperatorList.includes(item.operatorId)).map(item=> item.operatorName).join(';'); + this.faiVisible = false; + }, + }, + watch:{ + cqcVisible(newVal,oldVal){ + if (!newVal){ + this.cqcOperatorList = [] + } + }, + faiVisible(newVal,oldVal){ + if (!newVal){ + this.faiOperatorList = [] + } + }, }, }