feat: select result service product list quotation

This commit is contained in:
Methapon Metanipat 2024-10-03 16:23:10 +07:00
parent 23dc6858c6
commit 2bdd524915
2 changed files with 53 additions and 14 deletions

View file

@ -73,6 +73,7 @@ import {
} from 'src/pages/03_customer-management/form';
import QuotationView from './QuotationView.vue';
import { watch } from 'vue';
import { toRaw } from 'vue';
const quotationFormStore = useQuotationForm();
const customerFormStore = useCustomerForm();
@ -1586,6 +1587,20 @@ watch(() => pageState.currentTab, fetchQuotationList);
await getAllProduct(id);
}
"
@submit="
(node) => {
const nodeRecursive = (
v: (typeof node)[number],
): typeof node | (typeof node)[number] => {
if (v.checked && v.children) return v.children.flatMap(nodeRecursive);
if (v.checked) return v;
return [];
};
const filtered = node.flatMap(nodeRecursive);
console.log(JSON.parse(JSON.stringify(filtered.map((v) => v.value))));
}
"
></ProductServiceForm>
</template>