| | |
| | | </el-tag> |
| | | </template> |
| | | <template #quantity="{ row }"> |
| | | <el-input-number v-model="row.quantity" :min="0" size="small" /> |
| | | <el-input-number v-model="row.quantity" |
| | | :min="0" |
| | | size="small" /> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | |
| | | ); |
| | | if (opt) { |
| | | let restoredData = (opt.productData || []).map(normalizeProductRow); |
| | | const selectedIds = form.value.productModelIds ? String(form.value.productModelIds).split(",") : []; |
| | | const quantities = form.value.productModelQuantities ? String(form.value.productModelQuantities).split(",") : []; |
| | | tableData.value = restoredData.filter(item => selectedIds.includes(String(item.id))).map(item => { |
| | | let qIndex = selectedIds.indexOf(String(item.id)); |
| | | if (qIndex !== -1 && qIndex < quantities.length && quantities[qIndex] !== "") { |
| | | item.quantity = Number(quantities[qIndex]); |
| | | } |
| | | return item; |
| | | }); |
| | | const selectedIds = form.value.productModelIds |
| | | ? String(form.value.productModelIds).split(",") |
| | | : []; |
| | | const quantities = form.value.productModelQuantities |
| | | ? String(form.value.productModelQuantities).split(",") |
| | | : []; |
| | | tableData.value = restoredData |
| | | .filter(item => selectedIds.includes(String(item.id))) |
| | | .map(item => { |
| | | let qIndex = selectedIds.indexOf(String(item.id)); |
| | | if ( |
| | | qIndex !== -1 && |
| | | qIndex < quantities.length && |
| | | quantities[qIndex] !== "" |
| | | ) { |
| | | item.quantity = Number(quantities[qIndex]); |
| | | } |
| | | return item; |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | transform: translateY(-50%); |
| | | width: 4px; |
| | | height: 1rem; |
| | | background-color: #002fa7; /* Element 默认红色 */ |
| | | background-color: #374d77; /* Element 默认红色 */ |
| | | border-radius: 2px; |
| | | } |
| | | </style> |