feat: submitService/clearFormService
/fetchListOfService
This commit is contained in:
parent
7a21247fd3
commit
deeb6283ee
1 changed files with 33 additions and 0 deletions
|
|
@ -50,7 +50,9 @@ const {
|
||||||
fetchListProduct,
|
fetchListProduct,
|
||||||
createProduct,
|
createProduct,
|
||||||
|
|
||||||
|
fetchListService,
|
||||||
fetchListServiceById,
|
fetchListServiceById,
|
||||||
|
createService,
|
||||||
} = productServiceStore;
|
} = productServiceStore;
|
||||||
|
|
||||||
import ItemCard from 'src/components/ItemCard.vue';
|
import ItemCard from 'src/components/ItemCard.vue';
|
||||||
|
|
@ -93,6 +95,7 @@ const productMode = ref<'group' | 'type' | 'service' | 'product'>('group');
|
||||||
const productGroup = ref<ProductGroup[]>();
|
const productGroup = ref<ProductGroup[]>();
|
||||||
const productType = ref<ProductGroup[]>();
|
const productType = ref<ProductGroup[]>();
|
||||||
const product = ref<ProductList[]>();
|
const product = ref<ProductList[]>();
|
||||||
|
const service = ref<Service[]>();
|
||||||
|
|
||||||
const productAndServiceTab = ref<string>('all');
|
const productAndServiceTab = ref<string>('all');
|
||||||
const previousValue = ref();
|
const previousValue = ref();
|
||||||
|
|
@ -215,6 +218,14 @@ async function fetchListOfProduct(productTypeId: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function fetchListOfService() {
|
||||||
|
const res = await fetchListService({ productTypeId: currentIdType.value });
|
||||||
|
|
||||||
|
if (res) {
|
||||||
|
service.value = res.result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function searchType() {
|
async function searchType() {
|
||||||
const res = await await fetchListProductServiceType({
|
const res = await await fetchListProductServiceType({
|
||||||
query: inputSearch.value,
|
query: inputSearch.value,
|
||||||
|
|
@ -379,6 +390,28 @@ function clearFormProduct() {
|
||||||
dialogProduct.value = false;
|
dialogProduct.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearFormService() {
|
||||||
|
formDataProductService.value = {
|
||||||
|
code: '',
|
||||||
|
name: '',
|
||||||
|
detail: '',
|
||||||
|
attributes: {
|
||||||
|
additional: [],
|
||||||
|
},
|
||||||
|
work: [],
|
||||||
|
};
|
||||||
|
dialogService.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function submitService() {
|
||||||
|
const res = await createService(formDataProductService.value);
|
||||||
|
if (res) {
|
||||||
|
await fetchListOfService();
|
||||||
|
}
|
||||||
|
|
||||||
|
clearFormService();
|
||||||
|
}
|
||||||
|
|
||||||
async function submitProduct() {
|
async function submitProduct() {
|
||||||
formDataProduct.value.productTypeId = currentIdType.value;
|
formDataProduct.value.productTypeId = currentIdType.value;
|
||||||
if (profileSubmit.value) {
|
if (profileSubmit.value) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue