| | |
| | | align="center" |
| | | > |
| | | <template slot-scope="scope"> |
| | | {{scope.row.peopleYield}} |
| | | {{scope.row.peopleYield!=0?scope.row.peopleYield:''}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | <script> |
| | | import addProductDialog from "./components/addProductDialog"; |
| | | import { |
| | | // getYieldRegisterInfo, |
| | | getYieldRegisterInfo, |
| | | saveYieldRegister, |
| | | getWorkshopManageCar, |
| | | getWorkshopManageGroup, |
| | |
| | | isAddloading: false, |
| | | productRegisterId:null, |
| | | productRegisterNumber:null, |
| | | tableDataItems:[], |
| | | tableDataCircles:[], |
| | | }; |
| | | }, |
| | | mounted() { |
| | |
| | | this.productRegisterNumber = query.number ? query.number : ""; |
| | | } |
| | | this.getSelectDataList(); |
| | | this.getDetailsData() |
| | | }, |
| | | methods: { |
| | | getDetailsData(){ |
| | | this.ruleForm = { |
| | | number: "", |
| | | record: "", |
| | | createTime: "", |
| | | circle: "", |
| | | marketId: "", |
| | | fallingSilkCocoonNumber: "", |
| | | workshopId: "", |
| | | bucketCocoonNumber: "", |
| | | groupNumber: "", |
| | | vehicleSpeed: "", |
| | | spec: "", |
| | | timeYi: "", |
| | | jieZhuang: "", |
| | | timeJia: "", |
| | | level: "", |
| | | groupReelingdiscount: "", |
| | | fallingSilkBucket: "", |
| | | fallingSilkBucketOne: "", |
| | | isfallingSilkBucketOne: "", |
| | | fallingSilkBucketTwo: "", |
| | | isfallingSilkBucketTwo: "", |
| | | fallingSilkBucketThree: "", |
| | | isfallingSilkBucketThree: "", |
| | | back: "", |
| | | oneBack: "", |
| | | twoBack: "", |
| | | threeBack: "", |
| | | theorySilkAmount: "", |
| | | total: "", |
| | | hourYield: "", |
| | | }; |
| | | if (this.productRegisterNumber) { |
| | | getYieldRegisterInfo({ number:this.productRegisterNumber }).then( |
| | | (response) => { |
| | | if (response.code === 200) { |
| | | let config = JSON.parse( |
| | | JSON.stringify(response.data ? response.data : {}) |
| | | ); |
| | | this.ruleForm = config; |
| | | this.tableDataItems=config.items |
| | | ? config.items |
| | | : []; |
| | | this.tableDataCircles=config.circles |
| | | ? config.circles |
| | | : []; |
| | | this.getGroupNumber(true) |
| | | } |
| | | } |
| | | ); |
| | | } |
| | | }, |
| | | getTableEdit(){ |
| | | this.tableData=this.tableDataItems |
| | | 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] |
| | | if(pieceNumberList.length>0){ |
| | | for(let k in pieceNumberList){ |
| | | this.tableData[i]['pieceNumber'+circle+pieceNumberList[k].pieceNumber] |
| | | } |
| | | } |
| | | this.tableData[i] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | // 表格的计算问题 |
| | | getOneYield(row){ |
| | | let string=''; |
| | |
| | | row['allYield'+val]=Number(string); |
| | | return string; |
| | | }, |
| | | changeForm(form,val){ |
| | | changeForm(form,val,data){ |
| | | if(val){ |
| | | this.ruleForm.createTime=form.createTime |
| | | this.ruleForm.groupNumber=form.groupNumber |
| | | this.ruleForm.spec=form.spec |
| | | this.ruleForm.marketId=form.marketId |
| | | this.getGroupNumber() |
| | | if(Object.keys(data).length>0){ |
| | | let config = JSON.parse( |
| | | JSON.stringify(data ? data : {}) |
| | | ); |
| | | this.ruleForm = config; |
| | | this.tableDataItems=config.items |
| | | ? config.items |
| | | : []; |
| | | this.tableDataCircles=config.circles |
| | | ? config.circles |
| | | : []; |
| | | this.$router.push({ |
| | | name:'addProductRegisterPage', |
| | | query:{ |
| | | id:data.id, |
| | | number:data.number, |
| | | } |
| | | }); |
| | | this.getGroupNumber(true) |
| | | } |
| | | } |
| | | }, |
| | | cellStyle({row,columnIndex}){ |
| | |
| | | } |
| | | }); |
| | | }, |
| | | getGroupNumber(){ |
| | | getGroupNumber(val){ |
| | | if(this.ruleForm.workshopId){ |
| | | //组别 |
| | | getWorkshopManageGroup({number:this.ruleForm.workshopId}).then((res) => { |
| | |
| | | } |
| | | this.tableData[0].isBlue=true |
| | | } |
| | | // 编辑 |
| | | if(val){ |
| | | this.getTableEdit() |
| | | } |
| | | this.ruleForm.carNumber=this.tableData.length>0?this.tableData[0].carNumber:'' |
| | | |
| | | } |