From 07001f3125daa074f8a5e919c9412d8eab60f2c5 Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Wed, 20 Nov 2024 10:07:18 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99=E7=BC=96=E7=A0=81=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=94=B9=E4=B8=BA=E8=A1=A8=E6=A0=BC=E5=8B=BE=E9=80=89?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/back/component/addReturn.vue | 155 +++++++++++------- .../material/purchase/goodsAccept/index.vue | 2 +- 2 files changed, 97 insertions(+), 60 deletions(-) diff --git a/src/views/material/back/component/addReturn.vue b/src/views/material/back/component/addReturn.vue index cd278ec3..d95c6374 100644 --- a/src/views/material/back/component/addReturn.vue +++ b/src/views/material/back/component/addReturn.vue @@ -158,7 +158,7 @@ - + + + - + - + @@ -343,12 +344,12 @@ - - - +
保存 @@ -927,71 +928,107 @@ export default { template.useNum = node.data.useNum return template }, - //编码下拉选数据 - getMachineById(typeId){ + + // changeMachine(val){ + // console.log(val) + // this.maData = this.machineList.find(option => option.maId == val); + // // = this.machineList[index] + // }, + //编码数据 + async getMachineById(typeId){ let param = { unitId:this.queryParams.unitId, proId:this.queryParams.proId, typeId:typeId } - getMachineById(param).then((res) => { + await getMachineById(param).then((res) => { this.machineList=res.data + this.machineList.forEach((item)=>{ + item.bmFileInfos=[]; + item.apDetection="" + }) }) }, - changeMachine(val){ - console.log(val) - this.maData = this.machineList.find(option => option.maId == val); - // = this.machineList[index] - }, //编码类型-弹窗 - openAddCode(row){ - this.rowData=row; - this.getMachineById(row.typeId) - this.maId="" - this.maCodeList=[] - if(this.rowData.maCodeList&&this.rowData.maCodeList.length>0){ - this.maCodeList = this.rowData.maCodeList - } + async openAddCode(row){ + this.rowData=row; + await this.getMachineById(row.typeId) + // this.maId="" + if(this.rowData.maCodeList&&this.rowData.maCodeList.length>0){ + this.maCodeList = this.rowData.maCodeList; + // console.log(this.maCodeList) + // console.log(this.machineList) + if (this.rowId != '') {//编辑插入已选数据后再回显勾选 + this.maCodeList.forEach((item)=>{ + this.machineList.unshift(item)//插入 + this.$nextTick(() => { + this.$refs.codeTableList.toggleRowSelection(item,true); + }) + }) + }else{//新增回显勾选 + // console.log("新增") + this.machineList.forEach((item)=>{ + this.maCodeList.forEach((sub)=>{ + if(sub.maId==item.maId){ + this.$nextTick(() => { + setTimeout(()=>{ + this.$refs.codeTableList.toggleRowSelection(item,true); + },500) + }) + } + }) + }) + } + }else{ + this.maCodeList=[] + } this.open=true; }, + codeSelectionChange(selection) { + this.maCodeList=selection + // console.log(selection) + + // this.queryParams.equipmentList = selection + }, //查询添加 handleAddCode(){ - console.log(this.rowData) - console.log(this.maId) - console.log(this.maData) - if(this.maId!=""){ - let obj = { - materialName:this.maData.materialName, - typeId:this.maData.typeId, - typeName:this.maData.typeName, - maId:this.maData.maId, - maCode:this.maData.maCode, - maStatus:this.maData.maStatus, - bmFileInfos:[], - apDetection:"", - } - let index = this.maCodeList.findIndex(v=>v.maId==this.maId) - if(index>-1){ - this.$message.error('设备编码已存在!') - }else{ - this.maCodeList.push(obj) - } - }else{ - this.$message.error('请先填写设备编码!') - } - }, - /** 删除按钮操作 */ - handleDeleteCode(row) { - this.maCodeList.splice(row.index, 1) - }, - // 弹窗保存 - saveDevCode(){ // console.log(this.rowData) // console.log(this.maCodeList) + // console.log(this.maId) + // console.log(this.maData) + // if(this.maId!=""){ + // let obj = { + // materialName:this.maData.materialName, + // typeId:this.maData.typeId, + // typeName:this.maData.typeName, + // maId:this.maData.maId, + // maCode:this.maData.maCode, + // maStatus:this.maData.maStatus, + // bmFileInfos:[], + // apDetection:"", + // } + // let index = this.maCodeList.findIndex(v=>v.maId==this.maId) + // if(index>-1){ + // this.$message.error('设备编码已存在!') + // }else{ + // this.maCodeList.push(obj) + // } + // }else{ + // this.$message.error('请先填写设备编码!') + // } + }, + // /** 删除按钮操作 */ + // handleDeleteCode(row) { + // this.maCodeList.splice(row.index, 1) + // }, + // 弹窗保存 + saveDevCode(){ + console.log(this.rowData) + console.log(this.maCodeList) this.rowData.maCodeList = this.maCodeList; this.rowData.preNum = this.maCodeList.length; this.open=false - // console.log(this.equipmentList) + console.log(this.equipmentList) }, //文件上传前 beforeFileUpload(row){ diff --git a/src/views/material/purchase/goodsAccept/index.vue b/src/views/material/purchase/goodsAccept/index.vue index 880d6ed3..ad4bd623 100644 --- a/src/views/material/purchase/goodsAccept/index.vue +++ b/src/views/material/purchase/goodsAccept/index.vue @@ -81,7 +81,7 @@ - +