fix: แก้ ลำดับการแสดงของ สินค้า และ บริการ
This commit is contained in:
parent
e057132470
commit
a460fb5c61
1 changed files with 98 additions and 15 deletions
|
|
@ -1187,20 +1187,111 @@ watch(currentStatus, async () => {
|
||||||
class="row q-col-gutter-lg flex"
|
class="row q-col-gutter-lg flex"
|
||||||
style="padding: 20px"
|
style="padding: 20px"
|
||||||
>
|
>
|
||||||
|
<!-- ACITVE or CREATED -->
|
||||||
<div
|
<div
|
||||||
:class="`${$q.screen.gt.sm ? 'col-3' : $q.screen.gt.xs ? 'col-6' : 'col-12'}`"
|
:class="`${$q.screen.gt.sm ? 'col-3' : $q.screen.gt.xs ? 'col-6' : 'col-12'}`"
|
||||||
v-for="i in productAndServiceTab === 'all' ||
|
v-for="i in productAndServiceTab === 'all' ||
|
||||||
productAndServiceTab === 'product'
|
productAndServiceTab === 'product'
|
||||||
? product?.filter((i) => {
|
? product?.filter((i) => {
|
||||||
if (currentStatus === 'All') {
|
if (currentStatus === 'All' || currentStatus === 'ACTIVE') {
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentStatus === 'ACTIVE') {
|
|
||||||
return i.status === 'ACTIVE' || i.status === 'CREATED';
|
return i.status === 'ACTIVE' || i.status === 'CREATED';
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
: []"
|
||||||
|
:key="i.id"
|
||||||
|
>
|
||||||
|
<TotalProductCardComponent
|
||||||
|
:data="i"
|
||||||
|
:key="i.id"
|
||||||
|
:code="i.code"
|
||||||
|
:price="i.price"
|
||||||
|
:process="i.process"
|
||||||
|
:id="i.id"
|
||||||
|
typeProduct="product"
|
||||||
|
:title="i.name"
|
||||||
|
:isDisabled="i.status === 'INACTIVE' ? true : false"
|
||||||
|
@toggleStatus="
|
||||||
|
() => {
|
||||||
|
toggleStatusProduct(i.id, i.status);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
@menuViewDetail="
|
||||||
|
() => {
|
||||||
|
currentIdProduct = i.id;
|
||||||
|
assignFormDataProduct(i);
|
||||||
|
dialogProductEdit = true;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
@menuEdit="
|
||||||
|
() => {
|
||||||
|
currentIdProduct = i.id;
|
||||||
|
infoProductEdit = true;
|
||||||
|
assignFormDataProduct(i);
|
||||||
|
dialogProductEdit = true;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
@viewDetail="
|
||||||
|
() => {
|
||||||
|
currentIdProduct = i.id;
|
||||||
|
infoProductEdit = false;
|
||||||
|
assignFormDataProduct(i);
|
||||||
|
dialogProductEdit = true;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
if (currentStatus === 'INACTIVE') {
|
<div
|
||||||
|
:class="`${$q.screen.gt.sm ? 'col-3' : $q.screen.gt.xs ? 'col-6' : 'col-12'}`"
|
||||||
|
v-for="i in productAndServiceTab === 'all' ||
|
||||||
|
productAndServiceTab === 'service'
|
||||||
|
? service?.filter((i) => {
|
||||||
|
if (currentStatus === 'All' || currentStatus === 'ACTIVE') {
|
||||||
|
return i.status === 'ACTIVE' || i.status === 'CREATED';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
: []"
|
||||||
|
:key="i.id"
|
||||||
|
>
|
||||||
|
<TotalProductCardComponent
|
||||||
|
typeProduct="service"
|
||||||
|
:code="i.code"
|
||||||
|
:id="i.id"
|
||||||
|
:title="i.name"
|
||||||
|
:isDisabled="i.status === 'INACTIVE' ? true : false"
|
||||||
|
:created-at="i.createdAt"
|
||||||
|
@toggleStatus="
|
||||||
|
() => {
|
||||||
|
toggleStatusService(i.id, i.status);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
@menuViewDetail="
|
||||||
|
() => {
|
||||||
|
currentIdService = i.id;
|
||||||
|
infoServiceEdit = false;
|
||||||
|
assignFormDataProductService(i.id);
|
||||||
|
dialogServiceEdit = true;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
@menuEdit="
|
||||||
|
() => {
|
||||||
|
currentIdService = i.id;
|
||||||
|
infoServiceEdit = true;
|
||||||
|
assignFormDataProductService(i.id);
|
||||||
|
dialogServiceEdit = true;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- INACTIVE -->
|
||||||
|
|
||||||
|
<div
|
||||||
|
:class="`${$q.screen.gt.sm ? 'col-3' : $q.screen.gt.xs ? 'col-6' : 'col-12'}`"
|
||||||
|
v-for="i in productAndServiceTab === 'all' ||
|
||||||
|
productAndServiceTab === 'product'
|
||||||
|
? product?.filter((i) => {
|
||||||
|
if (currentStatus === 'All' || currentStatus === 'INACTIVE') {
|
||||||
return i.status === 'INACTIVE';
|
return i.status === 'INACTIVE';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -1253,15 +1344,7 @@ watch(currentStatus, async () => {
|
||||||
v-for="i in productAndServiceTab === 'all' ||
|
v-for="i in productAndServiceTab === 'all' ||
|
||||||
productAndServiceTab === 'service'
|
productAndServiceTab === 'service'
|
||||||
? service?.filter((i) => {
|
? service?.filter((i) => {
|
||||||
if (currentStatus === 'All') {
|
if (currentStatus === 'All' || currentStatus === 'INACTIVE') {
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentStatus === 'ACTIVE') {
|
|
||||||
return i.status === 'ACTIVE' || i.status === 'CREATED';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentStatus === 'INACTIVE') {
|
|
||||||
return i.status === 'INACTIVE';
|
return i.status === 'INACTIVE';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue