diff --git a/app/components/TopMenu.vue b/app/components/TopMenu.vue index 589aab3..1676ce2 100644 --- a/app/components/TopMenu.vue +++ b/app/components/TopMenu.vue @@ -13,7 +13,7 @@ @click="changeTab(leftmenu[0])" > -
- -
- - Chuyển cột sang trái -
-
- - Chuyển cột sang phải -
-
- - Tăng độ rộng cột -
-
- - Giảm độ rộng cột -
-
- - Ẩn cột -
-
- - Xóa cột -
-
- - Sao chép cột -
-
- - Danh sách cột -
-
- - Tạo cột mới -
-
- - Tùy chọn bảng -
-
- -

- Lưu thiết lập -

-
-
-
- -
-
-

- Tên trường: - {{ currentField.name }} - -

-
- -
-
-
- -
-
- -
-
-
-

- {{ errors.find((v) => v.name === "label").msg }} -

-
-
- -
+
+
+ +
+ + Chuyển cột sang trái +
+
+ + Chuyển cột sang phải +
+
+ + Tăng độ rộng cột +
+
+ + Giảm độ rộng cột +
+
+ + Ẩn cột +
+
+ + Xóa cột +
+
+ + Sao chép cột +
+
+ + Danh sách cột +
+
+ + Tạo cột mới +
+
+ + Tùy chọn bảng +
+
+ +

+ Lưu thiết lập +

-
-
-
- -
- -
-

- {{ errors.find((v) => v.name === "unit").msg }} -

-
-
- -
- -
-
-
+
+
-
+
+

+ Tên trường: + {{ currentField.name }} + +

- + +
+
+
+ +
+
+ +
+
+
+

+ {{ errors.find((v) => v.name === "label").msg }} +

+
+
+
-
+
+
+
+ +
+ - - {{ currentField.template ? "Sửa" : "Tạo" }} định dạng - +
+

+ {{ errors.find((v) => v.name === "unit").msg }} +

+
+
+ +
+ +
+
+
+
+
+
+ +
+ + +
-
-
+
- diff --git a/app/components/pos/AddressForm.vue b/app/components/pos/AddressForm.vue index 5a51a07..71b4bda 100644 --- a/app/components/pos/AddressForm.vue +++ b/app/components/pos/AddressForm.vue @@ -2,10 +2,11 @@ import { isEqual } from "es-toolkit"; const props = defineProps({ + customerId: Number, address: Object, }); -const emit = defineEmits(["modalevent"]); +const emit = defineEmits(["modalevent", "close"]); const { $insertapi, $patchapi } = useNuxtApp(); const addressRef = ref({ ...props.address }); @@ -13,11 +14,16 @@ const isLoading = ref(false); async function submitAddress() { isLoading.value = true; + const payload = { + ...addressRef.value, + customer: props.customerId, + }; const res = props.address - ? await $patchapi("Customer_Address", addressRef.value) - : await $insertapi("Customer_Address", addressRef.value); + ? await $patchapi("Customer_Address", payload) + : await $insertapi("Customer_Address", { data: payload }); isLoading.value = false; emit("modalevent", { name: "submit" }); + emit("close"); } const isDirty = computed(() => { diff --git a/app/components/pos/POS.vue b/app/components/pos/POS.vue index d3c9352..2fdc9ff 100644 --- a/app/components/pos/POS.vue +++ b/app/components/pos/POS.vue @@ -40,6 +40,10 @@ function openAddAddressModal() { title: "Thêm địa chỉ", width: "50%", height: "auto", + vbind: { + customerId: activeCart.value.customer, + address: undefined, + }, }; } @@ -214,25 +218,11 @@ function openAddAddressModal() {

-

Địa chỉ giao hàng

-
-
-
-
-

Khách hàng chưa có địa chỉ

+
+

Địa chỉ giao hàng

+
+
+ Khách hàng chưa có địa chỉ +