From 3ebef1bd473aac41b8191869ee0d89be7022015e Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期四, 11 四月 2024 15:59:36 +0800 Subject: [PATCH] 设备的弹框输入净重之后给对应表格的单元格赋值的逻辑处理+失去焦点之后自动跳转到下一个单元格的逻辑处理 --- src/views/productManage/productRegisterForm/addProductRegisterPage.vue | 86 +++++++++++++++++++++++++++++++------------ 1 files changed, 62 insertions(+), 24 deletions(-) diff --git a/src/views/productManage/productRegisterForm/addProductRegisterPage.vue b/src/views/productManage/productRegisterForm/addProductRegisterPage.vue index a942a8c..adce78a 100644 --- a/src/views/productManage/productRegisterForm/addProductRegisterPage.vue +++ b/src/views/productManage/productRegisterForm/addProductRegisterPage.vue @@ -471,14 +471,14 @@ {{getPeopleYield(scope.row)}} </template> </el-table-column> - <el-table-column + <el-table-column prop="hourYield" label="鍙版椂浜ч噺" width="60" align="center" > <template slot-scope="scope"> - {{getHourYield(scope.row)}} + {{(ruleForm.record&&scope.row.oneYield)?(scope.row.oneYield/ruleForm.record).toFixed(2):''}} </template> </el-table-column> <el-table-column @@ -505,7 +505,7 @@ align="center" > <template slot-scope="scope"> - {{getoneYield(scope.row,1)}} + {{(ruleForm.record&&scope.row.allYield1)?(scope.row.allYield1/ruleForm.record).toFixed(2):''}} </template> </el-table-column> <el-table-column @@ -532,7 +532,7 @@ align="center" > <template slot-scope="scope"> - {{getoneYield(scope.row,2)}} + {{(ruleForm.record&&scope.row.allYield2)?(scope.row.allYield2/ruleForm.record).toFixed(2):''}} </template> </el-table-column> <el-table-column @@ -559,7 +559,7 @@ align="center" > <template slot-scope="scope"> - {{getoneYield(scope.row,3)}} + {{(ruleForm.record&&scope.row.allYield3)?(scope.row.allYield3/ruleForm.record).toFixed(2):''}} </template> </el-table-column> <el-table-column @@ -715,6 +715,7 @@ string=string+Number(row.pieceNumber34) } } + row.oneYield=string; return string; }, getPeopleYield(row){ @@ -741,13 +742,6 @@ } } }, - getHourYield(row){ - let hourYield='' - if(this.ruleForm.record&&this.ruleForm.record!=0){ - hourYield=row.oneYield/this.ruleForm.record - } - return hourYield; - }, getallYield(row,val){ let string=''; if(row['pieceNumber'+val+'1']||row['pieceNumber'+val+'2']||row['pieceNumber'+val+'3']||row['pieceNumber'+val+'4']){ @@ -764,14 +758,8 @@ string=string+Number(row['pieceNumber'+val+'4']) } } + row['allYield'+val]=string; return string; - }, - getoneYield(row,val){ - let oneYield='' - if(this.ruleForm.record&&this.ruleForm.record!=0){ - oneYield=row['allYield'+val]/this.ruleForm.record - } - return oneYield; }, changeForm(form,val){ if(val){ @@ -795,6 +783,8 @@ } if(form.pieceNumber==3&&form.pieces==4){ this.$refs.addProductDialog.proForm.carNumber=this.tableData[Number(string)+1].carNumber + this.$refs.addProductDialog.proForm.pieceNumber=1 + this.$refs.addProductDialog.proForm.pieces=1 }else{ if(form.pieces==4){ this.$refs.addProductDialog.proForm.pieceNumber=Number(form.pieceNumber)+1 @@ -949,14 +939,62 @@ // params.workshopGroup=Number(params.workshopGroup) this.isAddloading = true; delete form.circleTwo; - let finenessList = JSON.parse( - JSON.stringify(this.tableList.tableData) + let circles=[] + let items=[] + let tableData = JSON.parse( + JSON.stringify(this.tableData) ); - for (let i in finenessList) { - delete finenessList[i].productId; + // row.pieceNumber11||row.pieceNumber12||row.pieceNumber13||row.pieceNumber14||row.pieceNumber21||row.pieceNumber22||row.pieceNumber23||row.pieceNumber24||row.pieceNumber31||row.pieceNumber32||row.pieceNumber33||row.pieceNumber34){ + + for(let i in tableData){ + circles.push({ + allYield:tableData[i].allYield1, //浜ч噺 + carNumber:tableData[i].carNumber, + circle:1,//鍥炴暟 + oneYield:tableData[i].oneYield1,// 鍙颁骇 + value1:tableData[i].pieceNumber11,//鐗囨暟 + value2:tableData[i].pieceNumber12,//鐗囨暟 + value3:tableData[i].pieceNumber13,//鐗囨暟 + value4:tableData[i].pieceNumber14,//鐗囨暟 + reelingdiscount:tableData[i].reelingdiscount1, //缂姌 + // yieldRegisterId:'' + }) + circles.push({ + allYield:tableData[i].allYield2, //浜ч噺 + carNumber:tableData[i].carNumber, + circle:2,//鍥炴暟 + oneYield:tableData[i].oneYield2,// 鍙颁骇 + value1:tableData[i].pieceNumber21,//鐗囨暟 + value2:tableData[i].pieceNumber22,//鐗囨暟 + value3:tableData[i].pieceNumber23,//鐗囨暟 + value4:tableData[i].pieceNumber24,//鐗囨暟 + reelingdiscount:tableData[i].reelingdiscount2, //缂姌 + // yieldRegisterId:'' + }) + circles.push({ + allYield:tableData[i].allYield3, //浜ч噺 + carNumber:tableData[i].carNumber, + circle:3,//鍥炴暟 + oneYield:tableData[i].oneYield3,// 鍙颁骇 + value1:tableData[i].pieceNumber31,//鐗囨暟 + value2:tableData[i].pieceNumber32,//鐗囨暟 + value3:tableData[i].pieceNumber33,//鐗囨暟 + value4:tableData[i].pieceNumber34,//鐗囨暟 + reelingdiscount:tableData[i].reelingdiscount3, //缂姌 + // yieldRegisterId:'' + }) + items.push({ + hourYield:tableData[i].hourYield, + carNumber:tableData[i].carNumber, + oneYield:tableData[i].oneYield, + peopleYield:tableData[i].peopleYield, + personReelingdiscount:tableData[i].personReelingdiscount, + // yieldRegisterId:'' + }) } let params = { - finenessList: finenessList, + circles: circles, + items:items, ...form, }; // 缂栬緫 -- Gitblit v1.8.0