changes
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
@click="changeTab(leftmenu[0])"
|
@click="changeTab(leftmenu[0])"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
style="max-height: none; width: 44px"
|
style="max-height: none; width: 40px"
|
||||||
width="80"
|
width="80"
|
||||||
height="80"
|
height="80"
|
||||||
viewBox="0 0 80 80"
|
viewBox="0 0 80 80"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="toolbar field has-addons is-justify-content-center">
|
<div class="is-flex is-flex-direction-column max-h-full">
|
||||||
|
<div class="is-flex-shrink-0 toolbar field has-addons is-justify-content-center">
|
||||||
<!-- <div class="control">
|
<!-- <div class="control">
|
||||||
<button
|
<button
|
||||||
class="button is-light is-primary"
|
class="button is-light is-primary"
|
||||||
@@ -238,7 +239,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tabs">
|
<div class="is-flex-shrink-0 tabs">
|
||||||
<ul>
|
<ul>
|
||||||
<li
|
<li
|
||||||
v-for="(v, i) in getMenu().filter((x) =>
|
v-for="(v, i) in getMenu().filter((x) =>
|
||||||
@@ -261,7 +262,7 @@
|
|||||||
<span class="font-semibold">Tên trường:</span>
|
<span class="font-semibold">Tên trường:</span>
|
||||||
<span>{{ currentField.name }}</span>
|
<span>{{ currentField.name }}</span>
|
||||||
<button
|
<button
|
||||||
class="button is-small size-8 is-primary is-light is-rounded"
|
class="button is-small size-8 is-primary is-light rounded-full p-0"
|
||||||
@click="$copyToClipboard(currentField.name)"
|
@click="$copyToClipboard(currentField.name)"
|
||||||
>
|
>
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
@@ -397,7 +398,9 @@
|
|||||||
>
|
>
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<Icon
|
<Icon
|
||||||
:name="currentField.template ? 'material-symbols:edit-outline-rounded' : 'material-symbols:add-rounded'"
|
:name="
|
||||||
|
currentField.template ? 'material-symbols:edit-outline-rounded' : 'material-symbols:add-rounded'
|
||||||
|
"
|
||||||
:size="17"
|
:size="17"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
@@ -407,18 +410,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="currentTab === 'value'">
|
|
||||||
<ScrollBox
|
<ScrollBox
|
||||||
|
v-else-if="currentTab === 'value'"
|
||||||
v-bind="{
|
v-bind="{
|
||||||
data: props.filterData,
|
data: filterData,
|
||||||
name: props.field.name,
|
name: field.name,
|
||||||
maxHeight: '380px',
|
|
||||||
perpage: 20,
|
perpage: 20,
|
||||||
inContext: true,
|
inContext: true,
|
||||||
}"
|
}"
|
||||||
@selected="doSelect"
|
@selected="doSelect"
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
<Modal
|
<Modal
|
||||||
v-bind="showmodal"
|
v-bind="showmodal"
|
||||||
v-if="showmodal"
|
v-if="showmodal"
|
||||||
@@ -426,6 +427,7 @@
|
|||||||
@updatefields="updateFields"
|
@updatefields="updateFields"
|
||||||
@close="close"
|
@close="close"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import ScrollBox from "~/components/datatable/ScrollBox.vue";
|
import ScrollBox from "~/components/datatable/ScrollBox.vue";
|
||||||
|
|||||||
@@ -122,7 +122,7 @@
|
|||||||
<li
|
<li
|
||||||
v-for="(v, i) in tabs"
|
v-for="(v, i) in tabs"
|
||||||
:key="i"
|
:key="i"
|
||||||
:class="tab.code === v.code && 'is-active'"
|
:class="['fs-14', tab.code === v.code && 'is-active']"
|
||||||
@click="changeTab(v)"
|
@click="changeTab(v)"
|
||||||
>
|
>
|
||||||
<a class="has-text-inherit">{{ v.name }}</a>
|
<a class="has-text-inherit">{{ v.name }}</a>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<span class="icon">
|
<span class="icon">
|
||||||
<Icon
|
<Icon
|
||||||
name="material-symbols:content-copy-outline-rounded"
|
name="material-symbols:content-copy-outline-rounded"
|
||||||
:size="14"
|
:size="16"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -102,7 +102,13 @@
|
|||||||
:class="['button is-primary', isLoading && 'is-loading']"
|
:class="['button is-primary', isLoading && 'is-loading']"
|
||||||
@click="saveSetting"
|
@click="saveSetting"
|
||||||
>
|
>
|
||||||
Lưu lại
|
<span class="icon">
|
||||||
|
<Icon
|
||||||
|
name="material-symbols:check-rounded"
|
||||||
|
:size="18"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span>Lưu lại</span>
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,7 +9,10 @@ const props = defineProps({
|
|||||||
<template>
|
<template>
|
||||||
<div class="is-flex is-flex-direction-column is-gap-2">
|
<div class="is-flex is-flex-direction-column is-gap-2">
|
||||||
<div
|
<div
|
||||||
class="p-4 rounded-md has-background-primary-95 is-flex is-justify-content-space-between is-align-items-center"
|
v-if="invoice.delivery"
|
||||||
|
class="p-4 rounded-md is-flex is-justify-content-space-between is-align-items-center"
|
||||||
|
:class="`has-background-${invoice.delivery__delivery_status__color}-95`"
|
||||||
|
:style="{ border: `1px solid var(--bulma-${invoice.delivery__delivery_status__color}-80)` }"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<p class="fs-14 has-text-grey-40">Mã giao hàng</p>
|
<p class="fs-14 has-text-grey-40">Mã giao hàng</p>
|
||||||
@@ -28,7 +31,10 @@ const props = defineProps({
|
|||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p class="font-medium has-text-primary-50">
|
<p
|
||||||
|
class="font-medium"
|
||||||
|
:class="`has-text-${invoice.delivery__delivery_status__color}-40`"
|
||||||
|
>
|
||||||
{{ capitalize(invoice.delivery__delivery_status__name) }}
|
{{ capitalize(invoice.delivery__delivery_status__name) }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ const invoiceProducts = computed(() => {
|
|||||||
<div
|
<div
|
||||||
v-for="product in invoiceProducts"
|
v-for="product in invoiceProducts"
|
||||||
:key="product.id"
|
:key="product.id"
|
||||||
class="p-4 has-background-white-ter rounded-md is-flex is-gap-2 is-justify-content-space-between is-align-items-flex-end"
|
class="p-4 has-background-grey-100 rounded-md is-flex is-gap-2 is-justify-content-space-between is-align-items-flex-end"
|
||||||
|
style="border: 1px solid var(--bulma-grey-90)"
|
||||||
>
|
>
|
||||||
<div class="is-flex-grow-1 is-flex is-gap-2">
|
<div class="is-flex-grow-1 is-flex is-gap-2">
|
||||||
<NuxtImg
|
<NuxtImg
|
||||||
|
|||||||
@@ -45,12 +45,23 @@ const activeTab = ref(tabs[0]);
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="invoice">
|
<div v-if="invoice">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<div class="is-flex is-gap-1.5 is-align-items-center">
|
<div class="is-flex is-align-items-center">
|
||||||
<span class="fs-17 font-bold">{{ invoice.code }}</span>
|
<span class="fs-17 font-bold">{{ invoice.code }}</span>
|
||||||
|
<button
|
||||||
|
class="button size-7 ml-1.5 is-primary is-light is-small p-0 rounded-full"
|
||||||
|
@click="$copyToClipboard(invoice.code)"
|
||||||
|
>
|
||||||
|
<span class="icon">
|
||||||
|
<Icon
|
||||||
|
name="material-symbols:content-copy-outline-rounded"
|
||||||
|
:size="16"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
<span
|
<span
|
||||||
:class="[
|
:class="[
|
||||||
'tag rounded-full',
|
'tag rounded-full ml-3',
|
||||||
`has-background-${invoice.invoice_status__color}-80 has-text-${invoice.invoice_status__color}-25`,
|
`has-background-${invoice.invoice_status__color}-90 has-text-${invoice.invoice_status__color}-25`,
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
{{ invoice.invoice_status__name }}
|
{{ invoice.invoice_status__name }}
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
|
import useActiveCart from "~/components/pos/composables/useActiveCart";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
address: Object,
|
address: Object,
|
||||||
selected: Boolean,
|
selected: Boolean,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { activeCart } = useActiveCart();
|
||||||
const showModal = ref(false);
|
const showModal = ref(false);
|
||||||
|
|
||||||
function openEditModal() {
|
function openEditModal() {
|
||||||
@@ -12,7 +15,10 @@ function openEditModal() {
|
|||||||
title: "Cập nhật địa chỉ",
|
title: "Cập nhật địa chỉ",
|
||||||
width: "50%",
|
width: "50%",
|
||||||
height: "auto",
|
height: "auto",
|
||||||
vbind: { address: props.address },
|
vbind: {
|
||||||
|
customerId: activeCart.value.customer,
|
||||||
|
address: props.address,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
import { isEqual } from "es-toolkit";
|
import { isEqual } from "es-toolkit";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
customerId: Number,
|
||||||
address: Object,
|
address: Object,
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(["modalevent"]);
|
const emit = defineEmits(["modalevent", "close"]);
|
||||||
|
|
||||||
const { $insertapi, $patchapi } = useNuxtApp();
|
const { $insertapi, $patchapi } = useNuxtApp();
|
||||||
const addressRef = ref({ ...props.address });
|
const addressRef = ref({ ...props.address });
|
||||||
@@ -13,11 +14,16 @@ const isLoading = ref(false);
|
|||||||
|
|
||||||
async function submitAddress() {
|
async function submitAddress() {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
|
const payload = {
|
||||||
|
...addressRef.value,
|
||||||
|
customer: props.customerId,
|
||||||
|
};
|
||||||
const res = props.address
|
const res = props.address
|
||||||
? await $patchapi("Customer_Address", addressRef.value)
|
? await $patchapi("Customer_Address", payload)
|
||||||
: await $insertapi("Customer_Address", addressRef.value);
|
: await $insertapi("Customer_Address", { data: payload });
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
emit("modalevent", { name: "submit" });
|
emit("modalevent", { name: "submit" });
|
||||||
|
emit("close");
|
||||||
}
|
}
|
||||||
|
|
||||||
const isDirty = computed(() => {
|
const isDirty = computed(() => {
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ function openAddAddressModal() {
|
|||||||
title: "Thêm địa chỉ",
|
title: "Thêm địa chỉ",
|
||||||
width: "50%",
|
width: "50%",
|
||||||
height: "auto",
|
height: "auto",
|
||||||
|
vbind: {
|
||||||
|
customerId: activeCart.value.customer,
|
||||||
|
address: undefined,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -214,25 +218,11 @@ function openAddAddressModal() {
|
|||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<p class="mb-2">Địa chỉ giao hàng</p>
|
<div class="block is-flex is-justify-content-space-between is-align-items-center">
|
||||||
<div v-if="addresses.length > 0">
|
<p>Địa chỉ giao hàng</p>
|
||||||
<Address
|
|
||||||
v-for="address in addresses"
|
|
||||||
:key="address"
|
|
||||||
:address="address"
|
|
||||||
:selected="orderInfo.address?.id === address.id"
|
|
||||||
@selectAddress="orderInfo.address = $event"
|
|
||||||
@submit="posStore.getAddresses(activeCart.customer)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-else
|
|
||||||
class="has-text-centered"
|
|
||||||
>
|
|
||||||
<p class="has-text-grey p-4">Khách hàng chưa có địa chỉ</p>
|
|
||||||
<button
|
<button
|
||||||
@click="openAddAddressModal"
|
@click="openAddAddressModal"
|
||||||
class="button is-light is-primary"
|
class="button is-small is-light is-primary"
|
||||||
>
|
>
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<Icon
|
<Icon
|
||||||
@@ -243,6 +233,21 @@ function openAddAddressModal() {
|
|||||||
<span>Thêm địa chỉ</span>
|
<span>Thêm địa chỉ</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<Address
|
||||||
|
v-if="addresses.length > 0"
|
||||||
|
v-for="address in addresses"
|
||||||
|
:key="address"
|
||||||
|
:address="address"
|
||||||
|
:selected="orderInfo.address?.id === address.id"
|
||||||
|
@selectAddress="orderInfo.address = $event"
|
||||||
|
@submit="posStore.getAddresses(activeCart.customer)"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
v-else
|
||||||
|
class="has-text-grey has-text-centered p-4"
|
||||||
|
>
|
||||||
|
Khách hàng chưa có địa chỉ
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p
|
<p
|
||||||
@@ -370,6 +375,7 @@ function openAddAddressModal() {
|
|||||||
v-if="showModal"
|
v-if="showModal"
|
||||||
v-bind="showModal"
|
v-bind="showModal"
|
||||||
@close="showModal = undefined"
|
@close="showModal = undefined"
|
||||||
|
@submit="posStore.getAddresses(activeCart.customer)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user