| | |
| | | }) |
| | | console.log(this.bushing); |
| | | this.selectBushing = this.bushing |
| | | this.addFiber() |
| | | this.addFiber(1) |
| | | // 默认勾选 |
| | | setTimeout(() => { |
| | | // this.selectBushing.forEach(item =>{ |
| | | // let rowToSelect = this.bushing.find(a => a.ident == item.ident) |
| | | // this.$refs.table0.toggleRowSelection(rowToSelect, true) |
| | | // }) |
| | | |
| | | this.fiberList.forEach(item =>{ |
| | | this.$refs.table3.toggleRowSelection(item, true) |
| | | }) |
| | |
| | | } |
| | | }) |
| | | }, |
| | | addFiber() { |
| | | addFiber(isInspection) { |
| | | // 最新 |
| | | let colors2 = [] |
| | | if (this.packageInfo.num1 / this.colors.length > 1) { |
| | |
| | | if(this.multiFiberList.length != 0){ |
| | | this.multiFiberList.forEach((a,index) => { |
| | | a.fiber = [] |
| | | for (var i = 0; i < parseInt(a.num); i++) { |
| | | console.log('****',a,index); |
| | | |
| | | if(index > 0 && index < this.multiFiberList.length) { |
| | | if(this.multiFiberList[index].color == this.multiFiberList[index-1].color) { |
| | | |
| | | |
| | | |
| | | console.log('****',this.multiFiberList[index-1].num); |
| | | |
| | | |
| | | |
| | | for (var i = 0; i < parseInt(a.num); i++) { |
| | | let fiber = { |
| | | ident: this.fiberList.length + 1, |
| | | bushColor: a.color, |
| | | color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label, |
| | | // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label, |
| | | color: colors2[i+parseInt(this.multiFiberList[index-1].num)].label, |
| | | model: null, |
| | | noSplitModel: null, |
| | | standard: null, |
| | |
| | | productList: [] |
| | | } |
| | | this.fiberList.push(fiber) |
| | | } |
| | | }else { |
| | | for (var i = 0; i < parseInt(a.num); i++) { |
| | | let fiber = { |
| | | ident: this.fiberList.length + 1, |
| | | bushColor: a.color, |
| | | // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label, |
| | | color: colors2[i].label, |
| | | model: null, |
| | | noSplitModel: null, |
| | | standard: null, |
| | | fibersIdent: a.ident, |
| | | productList: [] |
| | | } |
| | | this.fiberList.push(fiber) |
| | | } |
| | | } |
| | | }else{ |
| | | for (var i = 0; i < parseInt(a.num); i++) { |
| | | let fiber = { |
| | | ident: this.fiberList.length + 1, |
| | | bushColor: a.color, |
| | | // color: colors2[(i+(parseInt(a.num)*index))>colors2.length?0:i+(parseInt(a.num)*index)*index].label, |
| | | color: colors2[i].label, |
| | | model: null, |
| | | noSplitModel: null, |
| | | standard: null, |
| | | fibersIdent: a.ident, |
| | | productList: [] |
| | | } |
| | | this.fiberList.push(fiber) |
| | | } |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | // 根据套管的测试量生成对应的数量的光纤数据 |
| | | this.selectBushing.forEach((item,index) =>{ |
| | | if(item.testNum != null && item.testNum != ''){ |
| | | for(let i =0; i < parseInt(item.testNum); i++){ |
| | | |
| | | // 全检 |
| | | if(isInspection == 1) { |
| | | for(let i =0; i < parseInt(item.testNum); i++){ |
| | | let fiber = { |
| | | ident: this.fiberList.length + 1, |
| | | bushColor: item.color, |
| | | color: colors2[i].label, |
| | | model: null, |
| | | standard: null, |
| | | productList: [] |
| | | } |
| | | this.fiberList.push(fiber) |
| | | } |
| | | }else { |
| | | for(let i =0; i < parseInt(item.testNum); i++){ |
| | | let fiber = { |
| | | ident: this.fiberList.length + 1, |
| | | bushColor: item.color, |
| | |
| | | } |
| | | this.fiberList.push(fiber) |
| | | } |
| | | } |
| | | }else { |
| | | flag = false |
| | | } |