| | |
| | | }; |
| | | const getProductOptions = () => { |
| | | return productTreeList().then(res => { |
| | | productOptions.value = convertIdToValue(res); |
| | | const tree = convertIdToValue(res); |
| | | productOptions.value = filterOutSemiFinished(tree); |
| | | return res; |
| | | }); |
| | | }; |
| | | |
| | | const filterOutSemiFinished = (nodes = []) => { |
| | | return (nodes || []) |
| | | .filter(node => { |
| | | const label = String(node?.label ?? ""); |
| | | return !label.includes("半成品"); |
| | | }) |
| | | .map(node => { |
| | | const next = { ...node }; |
| | | if (next.children && next.children.length > 0) { |
| | | next.children = filterOutSemiFinished(next.children); |
| | | } |
| | | return next; |
| | | }); |
| | | }; |
| | | const getModels = value => { |
| | | if (value) { |
| | | productForm.value.productCategory = |