| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <el-form-item label="车间" prop="workshopId"> |
| | | <el-form-item label="车间" prop="workshopNumber"> |
| | | <el-select |
| | | v-model="ruleForm.workshopId" |
| | | v-model="ruleForm.workshopNumber" |
| | | placeholder="请选择" |
| | | class="select-width" |
| | | @change='getGroupNumber' |
| | |
| | | placeholder="请先选择车间" |
| | | no-data-text='请先选择车间' |
| | | class="select-width" |
| | | @change='getGroupNumber' |
| | | @change="getGroupNumber(false,'groupNumber')" |
| | | > |
| | | <el-option |
| | | v-for="item in workshopGroupList" |
| | |
| | | label="" |
| | | @input="inputStart" |
| | | label-width="0" |
| | | label-position="right" |
| | | prop="fallingSilkBucketOne" |
| | | :rules="[ |
| | | { |
| | | required: ruleForm.selectOne, |
| | | message: '请填写', |
| | | trigger: 'change', |
| | | }, |
| | | ]" |
| | | class='margin_right_10px select-width-input' |
| | | > |
| | | <el-input |
| | | v-model="ruleForm.fallingSilkBucketOne" |
| | | size="small" |
| | | class="d-b-c-input" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-checkbox |
| | | v-model="ruleForm.isfallingSilkBucketOne" |
| | | v-model="ruleForm.selectOne" |
| | | ></el-checkbox> |
| | | </div> |
| | | <div class="select-width"> |
| | |
| | | label="" |
| | | @input="inputStart" |
| | | label-width="0" |
| | | :rules="[ |
| | | { |
| | | required: ruleForm.selectTwo, |
| | | message: '请填写', |
| | | trigger: 'change', |
| | | }, |
| | | ]" |
| | | prop="fallingSilkBucketTwo" |
| | | class='margin_right_10px select-width-input' |
| | | > |
| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-checkbox |
| | | v-model="ruleForm.isfallingSilkBucketTwo" |
| | | v-model="ruleForm.selectTwo" |
| | | ></el-checkbox> |
| | | </div> |
| | | <div class="select-width"> |
| | | <el-form-item |
| | | label="" |
| | | @input="inputStart" |
| | | label-width="0" |
| | | label-width="" |
| | | :rules="[ |
| | | { |
| | | required: ruleForm.selectThree, |
| | | message: '请填写', |
| | | trigger: 'change', |
| | | }, |
| | | ]" |
| | | prop="fallingSilkBucketThree" |
| | | class='margin_right_10px select-width-input' |
| | | > |
| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-checkbox |
| | | v-model="ruleForm.isfallingSilkBucketThree" |
| | | v-model="ruleForm.selectThree" |
| | | ></el-checkbox> |
| | | </div> |
| | | </div> |
| | |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | border |
| | | v-if='tableShow' |
| | | :height="'calc(100% - 0px)'" |
| | | :cell-style='cellStyle' |
| | | > |
| | |
| | | align="center" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{(ruleForm.record&&scope.row.oneYield)?(scope.row.oneYield/ruleForm.record).toFixed(2):''}} |
| | | {{(ruleForm.record&&ruleForm.record!=0&&scope.row.oneYield)?(scope.row.oneYield/ruleForm.record).toFixed(2):''}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | align="center" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{(ruleForm.record&&scope.row.allYield1)?(scope.row.allYield1/ruleForm.record).toFixed(2):''}} |
| | | {{(ruleForm.record&&ruleForm.record!=0&&scope.row.allYield1)?(scope.row.allYield1/ruleForm.record).toFixed(2):''}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | align="center" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{(ruleForm.record&&scope.row.allYield2)?(scope.row.allYield2/ruleForm.record).toFixed(2):''}} |
| | | {{(ruleForm.record&&ruleForm.record!=0&&scope.row.allYield2)?(scope.row.allYield2/ruleForm.record).toFixed(2):''}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | align="center" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{(ruleForm.record&&scope.row.allYield3)?(scope.row.allYield3/ruleForm.record).toFixed(2):''}} |
| | | {{(ruleForm.record&&ruleForm.record!=0&&scope.row.allYield3)?(scope.row.allYield3/ruleForm.record).toFixed(2):''}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | circle: "", |
| | | marketId: "", |
| | | fallingSilkCocoonNumber: "", |
| | | workshopId: "", |
| | | workshopNumber: "", |
| | | bucketCocoonNumber: "", |
| | | groupNumber: "", |
| | | vehicleSpeed: "", |
| | |
| | | groupReelingdiscount: "", |
| | | fallingSilkBucket: "", |
| | | fallingSilkBucketOne: "", |
| | | isfallingSilkBucketOne: "", |
| | | selectOne: false, |
| | | fallingSilkBucketTwo: "", |
| | | isfallingSilkBucketTwo: "", |
| | | selectTwo: false, |
| | | fallingSilkBucketThree: "", |
| | | isfallingSilkBucketThree: "", |
| | | selectThree: false, |
| | | back: "", |
| | | oneBack: "", |
| | | twoBack: "", |
| | |
| | | marketId: [ |
| | | { required: true, message: "请选择", trigger: ["change", "blur"] }, |
| | | ], |
| | | workshopId: [ |
| | | workshopNumber: [ |
| | | { required: true, message: "请选择", trigger: ["change", "blur"] }, |
| | | ], |
| | | groupNumber: [ |
| | |
| | | productRegisterNumber:null, |
| | | tableDataItems:[], |
| | | tableDataCircles:[], |
| | | yieldRegisterId:'', |
| | | tableShow:true, |
| | | }; |
| | | }, |
| | | mounted() { |
| | |
| | | this.getDetailsData() |
| | | }, |
| | | methods: { |
| | | getDetailsData(){ |
| | | async getDetailsData(){ |
| | | this.ruleForm = { |
| | | number: "", |
| | | record: "", |
| | |
| | | circle: "", |
| | | marketId: "", |
| | | fallingSilkCocoonNumber: "", |
| | | workshopId: "", |
| | | workshopNumber: "", |
| | | bucketCocoonNumber: "", |
| | | groupNumber: "", |
| | | vehicleSpeed: "", |
| | |
| | | groupReelingdiscount: "", |
| | | fallingSilkBucket: "", |
| | | fallingSilkBucketOne: "", |
| | | isfallingSilkBucketOne: "", |
| | | selectOne: false, |
| | | fallingSilkBucketTwo: "", |
| | | isfallingSilkBucketTwo: "", |
| | | selectTwo: false, |
| | | fallingSilkBucketThree: "", |
| | | isfallingSilkBucketThree: "", |
| | | selectThree: false, |
| | | back: "", |
| | | oneBack: "", |
| | | twoBack: "", |
| | |
| | | hourYield: "", |
| | | }; |
| | | if (this.productRegisterNumber) { |
| | | getYieldRegisterInfo({ number:this.productRegisterNumber }).then( |
| | | await getYieldRegisterInfo({ number:this.productRegisterNumber }).then( |
| | | (response) => { |
| | | if (response.code === 200) { |
| | | let config = JSON.parse( |
| | | JSON.stringify(response.data ? response.data : {}) |
| | | ); |
| | | this.ruleForm = config; |
| | | this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'') |
| | | this.tableDataItems=config.items |
| | | ? config.items |
| | | : []; |
| | |
| | | } |
| | | }, |
| | | getTableEdit(){ |
| | | this.tableData=this.tableDataItems |
| | | if( this.tableDataCircles.length>0){ |
| | | if(this.tableData.length>0){ |
| | | for(let i in this.tableData){ |
| | | if(this.tableDataItems.length>0){ |
| | | for(let j in this.tableDataItems){ |
| | | if(this.tableData[i].carNumber==this.tableDataItems[j].carNumber){ |
| | | this.tableData[i]={ |
| | | perList:this.tableData[i].perList, |
| | | isBlue:this.tableData[i].isBlue, |
| | | ...this.tableDataItems[j], |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | this.yieldRegisterId=this.tableDataItems.length>0?this.tableDataItems[0].yieldRegisterId:"" |
| | | if(this.tableDataCircles.length>0){ |
| | | for(let i in this.tableData){ |
| | | for(let j in this.tableDataCircles){ |
| | | if(this.tableDataCircles[j].carNumber==this.tableData[i].carNumber){ |
| | | let circle=this.tableDataCircles[j].circle |
| | | let pieceNumberList=this.tableDataCircles[j].pieceNumber||[] |
| | | this.tableData[i]['allYield'+circle]=this.tableDataCircles[j]['allYield'+circle] |
| | | this.tableData[i]['oneYield'+circle]=this.tableDataCircles[j]['oneYield'+circle] |
| | | this.tableData[i]['reelingdiscount'+circle]=this.tableDataCircles[j]['reelingdiscount'+circle] |
| | | let pieceNumberList=this.tableDataCircles[j].pieceNumbers||[] |
| | | this.tableData[i]['allYield'+circle]=this.tableDataCircles[j]['allYield'] |
| | | this.tableData[i]['oneYield'+circle]=this.tableDataCircles[j]['oneYield'] |
| | | this.tableData[i]['reelingdiscount'+circle]=this.tableDataCircles[j]['reelingdiscount'] |
| | | if(pieceNumberList.length>0){ |
| | | for(let k in pieceNumberList){ |
| | | this.tableData[i]['pieceNumber'+circle+pieceNumberList[k].pieceNumber] |
| | | this.tableData[i]['pieceNumber'+circle+pieceNumberList[k].pieceNumber]=pieceNumberList[k].value |
| | | } |
| | | } |
| | | this.tableData[i] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | this.ruleForm.carNumber=this.tableData.length>0?this.tableData[0].carNumber:'' |
| | | }, |
| | | // 表格的计算问题 |
| | | getOneYield(row){ |
| | |
| | | JSON.stringify(data ? data : {}) |
| | | ); |
| | | this.ruleForm = config; |
| | | this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'') |
| | | this.tableDataItems=config.items |
| | | ? config.items |
| | | : []; |
| | |
| | | number:data.number, |
| | | } |
| | | }); |
| | | this.getGroupNumber(true) |
| | | } |
| | | } |
| | | }, |
| | |
| | | }) |
| | | this.$set(this.tableData[i],'isBlue',true) |
| | | this.$set(this.tableData[i],'pieceNumber'+form.pieceNumber+form.pieces,form.netWeight) |
| | | this.tableShow=false; |
| | | this.$nextTick(()=>{ |
| | | this.tableShow=true; |
| | | this.$forceUpdate(); |
| | | }) |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if(form.netWeight){ |
| | | if(form.pieceNumber==3&&form.pieces==4){ |
| | | this.$refs.addProductDialog.proForm.carNumber=this.tableData[Number(string)+1].carNumber |
| | | this.$set(this.tableData[Number(string)],'isBlue',false) |
| | | this.$set(this.tableData[Number(string+1)],'isBlue',true) |
| | | this.$refs.addProductDialog.proForm.pieceNumber=1 |
| | | this.$refs.addProductDialog.proForm.pieces=1 |
| | | if(Number(string)+1<=this.tableData.length){ |
| | | this.$refs.addProductDialog.proForm.carNumber=this.tableData[Number(string)+1].carNumber |
| | | this.$refs.addProductDialog.proForm.pieceNumber=1 |
| | | this.$refs.addProductDialog.proForm.pieces=1 |
| | | this.$set(this.tableData[Number(string)+1],'isBlue',true) |
| | | this.$set(this.tableData[Number(string)],'isBlue',false) |
| | | this.tableShow=false; |
| | | this.$nextTick(()=>{ |
| | | this.tableShow=true; |
| | | this.$forceUpdate(); |
| | | }) |
| | | } |
| | | }else{ |
| | | if(form.pieces==4){ |
| | | this.$refs.addProductDialog.proForm.pieceNumber=Number(form.pieceNumber)+1 |
| | |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.nameList = res.data || []; |
| | | this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'') |
| | | } |
| | | }); |
| | | //规格 |
| | |
| | | } |
| | | }); |
| | | }, |
| | | getGroupNumber(val){ |
| | | if(this.ruleForm.workshopId){ |
| | | getGroupNumber(val,prop){ |
| | | if(this.ruleForm.workshopNumber){ |
| | | //组别 |
| | | getWorkshopManageGroup({number:this.ruleForm.workshopId}).then((res) => { |
| | | getWorkshopManageGroup({number:this.ruleForm.workshopNumber}).then((res) => { |
| | | if (res.code == 200) { |
| | | this.workshopGroupList=[] |
| | | let workshopGroupList = res.data || {}; |
| | | this.workshopGroupList=[] |
| | | if(Object.keys(workshopGroupList).length>0){ |
| | | for(let i in workshopGroupList){ |
| | | this.workshopGroupList.push(workshopGroupList[i]) |
| | | } |
| | | if(prop&&prop!='groupNumber'){ |
| | | this.ruleForm.groupNumber='' |
| | | } |
| | | // 编辑 |
| | | if(val){ |
| | | setTimeout(()=>{ |
| | | this.$set(this.ruleForm,'groupNumber',this.ruleForm.groupNumber) |
| | | },200) |
| | | } |
| | | } |
| | | }else{ |
| | | this.workshopGroupList=[] |
| | | this.ruleForm.groupNumber='' |
| | | } |
| | | }); |
| | | if(this.ruleForm.groupNumber&&this.ruleForm.marketId){ |
| | | let workshopName='' |
| | | for(let i in this.nameList){ |
| | | if( this.nameList[i].number==this.ruleForm.workshopId){ |
| | | if( this.nameList[i].number==this.ruleForm.workshopNumber){ |
| | | workshopName= this.nameList[i].name |
| | | break; |
| | | } |
| | |
| | | } |
| | | this.tableData[0].isBlue=true |
| | | } |
| | | this.ruleForm.carNumber=this.tableData.length>0?this.tableData[0].carNumber:'' |
| | | |
| | | // 编辑 |
| | | if(val){ |
| | | this.getTableEdit() |
| | | } |
| | | this.ruleForm.carNumber=this.tableData.length>0?this.tableData[0].carNumber:'' |
| | | |
| | | }else{ |
| | | this.tableData=[] |
| | | this.ruleForm.level='' |
| | | this.ruleForm.carNumber='' |
| | | } |
| | | }); |
| | | } |
| | |
| | | circle: "", |
| | | marketId: "", |
| | | fallingSilkCocoonNumber: "", |
| | | workshopId: "", |
| | | workshopNumber: "", |
| | | bucketCocoonNumber: "", |
| | | groupNumber: "", |
| | | vehicleSpeed: "", |
| | |
| | | groupReelingdiscount: "", |
| | | fallingSilkBucket: "", |
| | | fallingSilkBucketOne: "", |
| | | isfallingSilkBucketOne: "", |
| | | selectOne: false, |
| | | fallingSilkBucketTwo: "", |
| | | isfallingSilkBucketTwo: "", |
| | | selectTwo: false, |
| | | fallingSilkBucketThree: "", |
| | | isfallingSilkBucketThree: "", |
| | | selectThree:false, |
| | | back: "", |
| | | oneBack: "", |
| | | twoBack: "", |
| | |
| | | form.theorySilkAmount=Number(form.theorySilkAmount) |
| | | form.total=Number(form.total) |
| | | form.vehicleSpeed=Number(form.vehicleSpeed) |
| | | form.workshopId =Number(form.workshopId) |
| | | delete form.isfallingSilkBucketOne |
| | | delete form.isfallingSilkBucketThree |
| | | delete form.isfallingSilkBucketTwo |
| | | for(let i in tableData){ |
| | | circles.push({ |
| | | let listItems1={ |
| | | allYield:Number(tableData[i].allYield1)||0, //产量 |
| | | carNumber:tableData[i].carNumber, |
| | | circle:1,//回数 |
| | | oneYield:Number(tableData[i].oneYield1)||0,// 台产 |
| | | pieceNumber:[ |
| | | pieceNumbers:[ |
| | | { |
| | | pieceNumber:1, |
| | | value:Number(tableData[i].pieceNumber11)||0 |
| | |
| | | }, |
| | | ], |
| | | reelingdiscount:tableData[i].reelingdiscount1||'', //缫折 |
| | | // yieldRegisterId:'' |
| | | }) |
| | | circles.push({ |
| | | } |
| | | let listItems2={ |
| | | allYield:Number(tableData[i].allYield2)||0, //产量 |
| | | carNumber:tableData[i].carNumber, |
| | | circle:2,//回数 |
| | | pieceNumber:[ |
| | | pieceNumbers:[ |
| | | { |
| | | pieceNumber:1, |
| | | value:Number(tableData[i].pieceNumber21)||0 |
| | |
| | | ], |
| | | oneYield:Number(tableData[i].oneYield2)||0,// 台产 |
| | | reelingdiscount:tableData[i].reelingdiscount2||'', //缫折 |
| | | // yieldRegisterId:'' |
| | | }) |
| | | circles.push({ |
| | | } |
| | | let listItems3={ |
| | | allYield:Number(tableData[i].allYield3)||0, //产量 |
| | | carNumber:tableData[i].carNumber, |
| | | circle:3,//回数 |
| | | oneYield:Number(tableData[i].oneYield3)||0,// 台产 |
| | | pieceNumber:[ |
| | | pieceNumbers:[ |
| | | { |
| | | pieceNumber:1, |
| | | value:Number(tableData[i].pieceNumber31)||0 |
| | |
| | | ], |
| | | reelingdiscount:tableData[i].reelingdiscount3||'', //缫折 |
| | | // yieldRegisterId:'' |
| | | }) |
| | | items.push({ |
| | | } |
| | | let listItems4={ |
| | | hourYield:Number(tableData[i].hourYield)||0, |
| | | carNumber:tableData[i].carNumber, |
| | | oneYield:Number(tableData[i].oneYield)||0, |
| | | peopleYield:Number(tableData[i].peopleYield)||0, |
| | | personReelingdiscount:tableData[i].personReelingdiscount||'', |
| | | // yieldRegisterId:'' |
| | | }) |
| | | } |
| | | if(this.yieldRegisterId){ |
| | | listItems1.yieldRegisterId=this.yieldRegisterId |
| | | listItems2.yieldRegisterId=this.yieldRegisterId |
| | | listItems3.yieldRegisterId=this.yieldRegisterId |
| | | listItems4.yieldRegisterId=this.yieldRegisterId |
| | | } |
| | | circles.push(listItems1) |
| | | circles.push(listItems2) |
| | | circles.push(listItems3) |
| | | items.push(listItems4) |
| | | } |
| | | let params = { |
| | | ...form, |
| | | circles: circles, |
| | | items:items, |
| | | ...form, |
| | | }; |
| | | // 编辑 |
| | | if (this.productRegisterId) { |
| | | params.id = this.ruleForm.id ? this.ruleForm.id : Number(this.productRegisterId); |
| | | } |
| | | console.log(params,'===params111') |
| | | saveYieldRegister(params) |
| | | .then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | .select-width { |
| | | width: calc(100% - 20px); |
| | | .select-width-input{ |
| | | width:calc(100% - 200px);float:left; |
| | | width:150px; |
| | | float:left; |
| | | } |
| | | } |
| | | .body-top { |
| | |
| | | .c-n { |
| | | cursor: no-drop; |
| | | } |
| | | |
| | | ::v-deep { |
| | | } |
| | | </style> |
| | | </style> |