Merge branch 'ui-new' of frappet.github.com:Frappet/jws-frontend into ui-new

This commit is contained in:
oat_dev 2024-07-08 17:17:47 +07:00
commit bedc4a8b4c
13 changed files with 513 additions and 83 deletions

View file

@ -469,7 +469,7 @@ async function toggleStatusProduct(id: string, status: Status) {
status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE',
});
await fetchListOfProduct();
await alternativeFetch();
flowStore.rotate();
}
@ -478,7 +478,7 @@ async function toggleStatusService(id: string, status: Status) {
status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE',
});
await fetchListOfService();
await alternativeFetch();
flowStore.rotate();
}
async function toggleStatusType(id: string, status: Status) {
@ -973,6 +973,11 @@ async function fetchStatus() {
}
async function alternativeFetch() {
console.log('asdasds');
if (productAndServiceTab.value === 'all') {
await fetchListOfProductAndService();
flowStore.rotate();
@ -1022,6 +1027,22 @@ onMounted(async () => {
watch(productMode, () => {
inputSearch.value = '';
currentStatus.value = 'All';
const tmp: typeof utilsStore.currentTitle.path = [];
if (productMode.value === 'type' || productMode.value === 'service') {
tmp.push({
text: 'productGroup',
argsi18n: { name: pathGroupName.value },
handler: () => {
productMode.value = 'type';
},
});
}
if (productMode.value === 'service') {
tmp.push({ text: 'productType', argsi18n: { name: pathTypeName.value } });
}
utilsStore.currentTitle.path = tmp;
});
watch(currentStatus, async () => {
@ -1183,47 +1204,6 @@ watch(inputSearchProductAndService, async () => {
</div>
</transition>
<!-- title type/service -->
<div
class="row items-center q-mb-md"
v-if="productMode === 'service' || productMode === 'type'"
>
<q-btn
round
icon="mdi-arrow-left"
flat
dense
@click="productMode = productMode === 'service' ? 'type' : 'group'"
class="q-mr-md"
/>
<div
class="text-h6 hover-underline"
:class="{
'app-text-muted': productMode !== 'type',
'text-weight-bold': productMode === 'type',
}"
@click="productMode = 'type'"
>
{{ pathGroupName }}
</div>
<div
class="text-h6 app-text-muted q-mx-sm"
v-if="productMode === 'service'"
>
/
</div>
<div
v-if="productMode === 'service'"
class="text-h6"
:class="{
'app-text-muted': productMode !== 'service',
'text-weight-bold': productMode === 'service',
}"
>
{{ pathTypeName }}
</div>
</div>
<!-- group/type -->
<div
v-if="productMode === 'group' || productMode === 'type'"