|
|
|
@ -1,5 +1,5 @@ |
|
|
|
<script> |
|
|
|
import {getBomTreeStructure} from "../../../../../api/quotation/quoteOfRouting"; |
|
|
|
import { getRoutingTreeStructure} from "../../../../../api/quotation/quoteOfRouting"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "quoteRouting", |
|
|
|
@ -27,18 +27,30 @@ export default { |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
nodeClick(val){ |
|
|
|
|
|
|
|
if (val.list){ |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}-${this.selectRouting[2]}`) |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
let arr = val.value.split('-'); |
|
|
|
arr[0] = parseInt(arr[0]) |
|
|
|
this.copyRouting = JSON.parse(JSON.stringify(this.selectRouting)) |
|
|
|
this.selectRouting = JSON.parse(JSON.stringify(arr)) |
|
|
|
if (this.copyRouting[0] !== this.selectRouting[0] || this.copyRouting[1] !== this.selectRouting[1] || this.copyRouting[2] !== this.selectRouting[2]){ |
|
|
|
this.changeSelect() |
|
|
|
} |
|
|
|
}, |
|
|
|
getBomTreeStructure(){ |
|
|
|
getRoutingTreeStructure(){ |
|
|
|
let params = { |
|
|
|
site:this.detail.site, |
|
|
|
testPartNo:this.detail.productNo |
|
|
|
} |
|
|
|
getBomTreeStructure(params).then(({data})=>{ |
|
|
|
getRoutingTreeStructure(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.routingTreeStructure = data.rows; |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}-${this.selectBom[2]}`) |
|
|
|
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}-${this.selectRouting[2]}`) |
|
|
|
}) |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
@ -46,6 +58,9 @@ export default { |
|
|
|
}).catch((error)=>{ |
|
|
|
this.$message.error(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
changeSelect(){ |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|