changes
This commit is contained in:
@@ -178,14 +178,15 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
};
|
||||
|
||||
const resetNull = function (obj) {
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
if (typeof value === "string") {
|
||||
let val = value.trim();
|
||||
if (val === "" || val === "") val = null;
|
||||
obj[key] = val;
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
return Object.fromEntries(
|
||||
Object.entries(obj).map(([key, value]) => {
|
||||
if (typeof value === "string") {
|
||||
const val = value.trim();
|
||||
return [key, val === "" ? null : val];
|
||||
}
|
||||
return [key, value];
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
const copyToClipboard = function (text) {
|
||||
|
||||
@@ -448,55 +448,13 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
url_detail: "data-detail/Customer/",
|
||||
params: {
|
||||
values:
|
||||
"id,update_time,creator,creator__fullname,country,country__name,country__en,issued_date,issued_place,issued_place__name,code,email,fullname,legal_code,phone,legal_type,legal_type__name,address,contact_address,note,type,type__name,updater,updater__fullname,create_time,update_time",
|
||||
"id,code,fullname,phone,email,type,type__name,creator,creator__fullname,updater,updater__fullname,create_time,update_time",
|
||||
distinct_values: {
|
||||
label: {
|
||||
type: "Concat",
|
||||
field: ["code", "fullname", "phone", "legal_code"],
|
||||
field: ["code", "fullname", "phone"],
|
||||
},
|
||||
order: { type: "RowNumber" },
|
||||
image_count: {
|
||||
type: "Count",
|
||||
field: "id",
|
||||
subquery: { model: "Customer_File", column: "ref" },
|
||||
},
|
||||
count_note: {
|
||||
type: "Count",
|
||||
field: "id",
|
||||
subquery: { model: "Customer_Note", column: "ref" },
|
||||
},
|
||||
count_product: {
|
||||
type: "Count",
|
||||
field: "id",
|
||||
subquery: {
|
||||
model: "Product_Booked",
|
||||
column: "transaction__customer",
|
||||
},
|
||||
},
|
||||
sum_product: {
|
||||
type: "Sum",
|
||||
field: "transaction__sale_price",
|
||||
subquery: {
|
||||
model: "Product_Booked",
|
||||
column: "transaction__customer",
|
||||
},
|
||||
},
|
||||
sum_receiver: {
|
||||
type: "Sum",
|
||||
field: "transaction__amount_received",
|
||||
subquery: {
|
||||
model: "Product_Booked",
|
||||
column: "transaction__customer",
|
||||
},
|
||||
},
|
||||
sum_remain: {
|
||||
type: "Sum",
|
||||
field: "transaction__amount_remain",
|
||||
subquery: {
|
||||
model: "Product_Booked",
|
||||
column: "transaction__customer",
|
||||
},
|
||||
},
|
||||
},
|
||||
summary: "annotate",
|
||||
filter: { deleted: 0 },
|
||||
@@ -1130,6 +1088,12 @@ export default defineNuxtPlugin((nuxtApp) => {
|
||||
url_detail: "data-detail/Product_Image/",
|
||||
params: {},
|
||||
},
|
||||
{
|
||||
name: "Payment_Method",
|
||||
url: "data/Payment_Method/",
|
||||
url_detail: "data-detail/Payment_Method/",
|
||||
params: {},
|
||||
},
|
||||
];
|
||||
const { $copy, $clone, $updateSeriesFields, $snackbar, $store, $remove, $dialog } = nuxtApp;
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ import MenuParam from "@/components/menu/MenuParam.vue";
|
||||
import MenuAdd from "@/components/menu/MenuAdd.vue";
|
||||
import MenuCollab from "@/components/menu/MenuCollab.vue";
|
||||
import MenuNote from "@/components/menu/MenuNote.vue";
|
||||
import MenuFile from "@/components/menu/MenuFile.vue";
|
||||
import MenuPayment from "@/components/menu/MenuPayment.vue";
|
||||
import ScrollBox from "@/components/datatable/ScrollBox.vue";
|
||||
import Reservation from "@/components/modal/Reservation.vue";
|
||||
@@ -88,13 +89,12 @@ import MenuAccount from "@/components/menu/MenuAccount.vue";
|
||||
import ImageLayout from "@/components/media/ImageLayout.vue";
|
||||
|
||||
import CountdownTimer from "@/components/common/CountdownTimer.vue";
|
||||
import CustomerInfo from "@/components/customer/CustomerInfo.vue";
|
||||
import CustomerForm from "@/components/customer/CustomerForm.vue";
|
||||
import MenuFile from "@/components/menu/MenuFile.vue";
|
||||
import CustomerQuickAdd from "@/components/customer/CustomerQuickAdd.vue";
|
||||
|
||||
const components = {
|
||||
PivotDataView,
|
||||
CustomerInfo,
|
||||
CustomerQuickAdd,
|
||||
CustomerForm,
|
||||
CountdownTimer,
|
||||
InternalEntry,
|
||||
|
||||
Reference in New Issue
Block a user