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 @@ -