From 6685a43360a1876e6f9b6510704f7c4c86a1949d Mon Sep 17 00:00:00 2001 From: Viet An Date: Mon, 25 May 2026 15:23:12 +0700 Subject: [PATCH] changes --- app/components/SearchBox.vue | 9 +- app/components/common/ActionInfo.vue | 5 +- app/components/common/Note.vue | 10 +- app/components/common/NoteInfo.vue | 2 +- app/components/customer/Company.vue | 10 +- app/components/customer/CustomerInfo.vue | 1195 ++++++++--------- app/components/customer/CustomerInfo2.vue | 699 ---------- app/components/customer/CustomerView.vue | 38 +- app/components/datepicker/EventDetail.vue | 5 +- app/components/dialog/ApprovalCode.vue | 5 +- app/components/dialog/Delete.vue | 2 +- app/components/imports/Imports.vue | 22 - app/components/imports/ProductForm.vue | 14 +- app/components/imports/ProductVariantForm.vue | 10 +- .../marketing/email/viewEmail/ViewEmail.vue | 2 +- app/components/media/FileCount.vue | 6 +- app/components/media/FileGallery.vue | 6 +- app/components/media/FileInfo.vue | 2 +- app/components/media/FileList.vue | 8 +- app/components/media/ImageGallery.vue | 4 +- app/components/media/ImageLayout.vue | 24 +- app/components/media/ImageShow.vue | 2 +- app/components/media/Imagebox.vue | 4 +- app/components/menu/MenuCollab.vue | 5 +- app/components/modal/InternalEntry.vue | 5 +- app/components/modal/Reservation.vue | 10 +- app/components/parameter/AllocationRules.vue | 63 - app/components/parameter/Dealer.vue | 107 -- app/components/parameter/DeleteCart.vue | 62 - app/components/parameter/DeletePayable.vue | 55 - app/components/parameter/DiscountType.vue | 114 -- app/components/parameter/DuePayables.vue | 111 -- app/components/parameter/GiftType.vue | 82 -- app/components/parameter/ImportData.vue | 2 +- app/components/parameter/NewCart.vue | 168 --- app/components/parameter/OverduePayables.vue | 90 -- app/components/parameter/SalePolicy.vue | 471 ------- app/components/parameter/TransactionPhase.vue | 120 -- app/components/people/PeopleInfo.vue | 7 +- app/components/people/PeopleView.vue | 5 +- app/components/user/ConfirmCode.vue | 2 +- app/components/user/EditUser.vue | 15 +- app/components/user/NewUser.vue | 2 +- app/components/user/SetPassword.vue | 5 +- app/components/user/UserInfo.vue | 10 +- app/layouts/default.vue | 14 +- app/plugins/02-connection.js | 20 +- app/plugins/04-components.js | 4 +- 48 files changed, 732 insertions(+), 2901 deletions(-) delete mode 100644 app/components/customer/CustomerInfo2.vue delete mode 100644 app/components/parameter/AllocationRules.vue delete mode 100644 app/components/parameter/Dealer.vue delete mode 100644 app/components/parameter/DeleteCart.vue delete mode 100644 app/components/parameter/DeletePayable.vue delete mode 100644 app/components/parameter/DiscountType.vue delete mode 100644 app/components/parameter/DuePayables.vue delete mode 100644 app/components/parameter/GiftType.vue delete mode 100644 app/components/parameter/NewCart.vue delete mode 100644 app/components/parameter/OverduePayables.vue delete mode 100644 app/components/parameter/SalePolicy.vue delete mode 100644 app/components/parameter/TransactionPhase.vue diff --git a/app/components/SearchBox.vue b/app/components/SearchBox.vue index 6bae37e..6359716 100644 --- a/app/components/SearchBox.vue +++ b/app/components/SearchBox.vue @@ -196,7 +196,10 @@ if (props.first) { } } } else if (props.optionid) { - selected.value = await $getdata(props.api, { id: props.optionid }, undefined, true); + selected.value = await $getdata(props.api, { + filter: { id: props.optionid }, + first: true, + }); } if (selected.value) doSelect(selected.value); @@ -282,7 +285,7 @@ function findObject(val) { async function getData() { isLoading.value = true; params.value.filter = props.filter; - const data = await $getdata(props.api, undefined, params.value); + const data = await $getdata(props.api, { params: params.value }); isLoading.value = false; return data; } @@ -301,7 +304,7 @@ async function getSuggestions(val) { params.value.filter_or = filter_or; if (props.filter) params.value.filter = $copy(props.filter); isLoading.value = true; - suggestions.value = await $getdata(props.api, undefined, params.value); + suggestions.value = await $getdata(props.api, { params: params.value }); isLoading.value = false; } diff --git a/app/components/common/ActionInfo.vue b/app/components/common/ActionInfo.vue index 8e162d8..d8ce46a 100644 --- a/app/components/common/ActionInfo.vue +++ b/app/components/common/ActionInfo.vue @@ -249,7 +249,10 @@ var image = ref(); var file = ref(); var link = ref(); var tab = ref("message"); -var record = await $getdata("useraction", { user: 1, action: props.row.id }, undefined, true); +var record = await $getdata("useraction", { + first: true, + filter: { user: 1, action: props.row.id }, +}); var option = ref(record ? "your" : "system"); function getValue() { if (option.value === "your") { diff --git a/app/components/common/Note.vue b/app/components/common/Note.vue index ae43652..78f2c47 100644 --- a/app/components/common/Note.vue +++ b/app/components/common/Note.vue @@ -26,10 +26,16 @@ const props = defineProps({ row: Object, pagename: String, }); -var record = await $getdata("application", { id: props.row.id }, undefined, true); +let record = await $getdata("application", { + filter: { id: props.row.id }, + first: true, +}); async function save() { await $updateapi("application", record); - record = await $getdata("application", { id: props.row.id }, undefined, true); + record = await $getdata("application", { + filter: { id: props.row.id }, + first: true, + }); $updatepage(props.pagename, record); emit("close"); } diff --git a/app/components/common/NoteInfo.vue b/app/components/common/NoteInfo.vue index 6c175bb..85afcd7 100644 --- a/app/components/common/NoteInfo.vue +++ b/app/components/common/NoteInfo.vue @@ -95,7 +95,7 @@ export default { }, async created() { if (!this.row) return; - this.data = await this.$getdata(this.api, { ref: this.row.id }); + this.data = await this.$getdata(this.api, { filter: { ref: this.row.id } }); }, computed: { login: { diff --git a/app/components/customer/Company.vue b/app/components/customer/Company.vue index 9db3fbf..b8b43b8 100644 --- a/app/components/customer/Company.vue +++ b/app/components/customer/Company.vue @@ -256,7 +256,10 @@ async function update() { if (checkError()) return; if (!record.value.id) { if (record.value.phone) record.value.phone = record.value.phone.trim(); - let obj = await $getdata("company", { phone: record.value.phone }, undefined, true); + const obj = await $getdata("company", { + first: true, + filter: { phone: record.value.phone }, + }); if (obj) { existedCustomer = obj; errors.phone = "Số điện thoại đã tồn tại trong hệ thống."; @@ -271,7 +274,10 @@ async function update() { if (rs === "error") return; if (!record.value.id) $snackbar(`Khách hàng đã được khởi tạo với mã ${rs.code}`, "Success"); record.value.id = rs.id; - let ele = await $getdata("company", { id: rs.id }, null, true); + let ele = await $getdata("company", { + first: true, + filter: { id: rs.id }, + }); emit("update", ele); emit("modalevent", { name: "dataevent", data: ele }); } diff --git a/app/components/customer/CustomerInfo.vue b/app/components/customer/CustomerInfo.vue index 4848138..df17c4e 100644 --- a/app/components/customer/CustomerInfo.vue +++ b/app/components/customer/CustomerInfo.vue @@ -1,229 +1,169 @@ -