This commit is contained in:
Viet An
2026-06-09 19:21:39 +07:00
parent 128993a93c
commit 7025fd8cd5
7 changed files with 212 additions and 758 deletions

View File

@@ -6,27 +6,26 @@
to=".modal-card:has(.confirm) .modal-card-foot"
>
<div class="field is-grouped w-full is-align-items-center">
<div class="control is-expanded">
<div class="buttons">
<button
class="button is-primary has-text-white"
@click="confirm"
>
Đồng ý
</button>
<button
class="button is-white"
@click="cancel"
>
Hủy
</button>
</div>
</div>
<CountDown
v-if="duration"
:duration="duration"
@close="cancel"
/>
<div class="ml-auto buttons">
<button
class="button is-white"
@click="cancel"
>
Hủy
</button>
<button
ref="confirmBtn"
class="button is-primary has-text-white"
@click="confirm"
>
Đồng ý
</button>
</div>
</div>
</Teleport>
</div>
@@ -49,4 +48,9 @@ function confirm() {
emit("modalevent", { name: "confirm" });
cancel();
}
const confirmBtn = useTemplateRef("confirmBtn");
onMounted(() => {
confirmBtn.value.focus();
});
</script>

View File

@@ -0,0 +1,71 @@
<script setup>
const props = defineProps({
cartItem: Object,
});
const { $deleteapi, $numtoString, $snackbar } = useNuxtApp();
const showConfirmModal = ref();
function openConfirmModal() {
showConfirmModal.value = {
component: "dialog/Confirm",
width: "500px",
height: "auto",
vbind: {
content: `Bạn xác nhận xoá sản phẩm <b>${props.cartItem.imei__variant__product__name}</b> khỏi giỏ hàng?`,
onModalevent: removeFromCart,
},
};
}
const getCart = inject("getCart");
async function removeFromCart() {
await $deleteapi("Cart_Item", props.cartItem.id);
$snackbar("Đã xoá sản phẩm khỏi giỏ hàng", "Success");
getCart();
}
</script>
<template>
<div class="card m-0">
<div class="card-content p-4 is-flex is-gap-2 is-justify-content-space-between is-align-items-center">
<div class="is-flex is-gap-4 is-justify-content-space-between is-align-items-center is-flex-grow-1">
<div class="media m-0">
<div class="media-left">
<figure class="image is-48x48">
<img :src="cartItem.imei__variant__image__path" />
</figure>
</div>
<div class="media-content">
<p class="font-semibold fs-15">{{ cartItem.imei__variant__product__name }}</p>
<p class="fs-13 has-text-grey">
<span>{{ cartItem.imei__variant__ram__code }}</span>
<span> </span>
<span>{{ cartItem.imei__variant__internal_storage__code }}</span>
<span> </span>
<span>{{ cartItem.imei__variant__color__name }}</span>
</p>
</div>
</div>
<p class="has-text-primary-50 font-medium">
{{ $numtoString(cartItem.imei__variant__price, { hasUnit: true }) }}
</p>
</div>
<button
@click="openConfirmModal"
class="button is-danger is-light"
>
<span class="icon">
<Icon
name="material-symbols:delete-outline-rounded"
:size="18"
/>
</span>
</button>
</div>
<Modal
v-if="showConfirmModal"
v-bind="showConfirmModal"
@close="showConfirmModal = undefined"
/>
</div>
</template>

View File

@@ -15,23 +15,54 @@ const imeis = ref([]);
const selectedImeis = ref([]);
function toggleSelected(imeiRec) {
if (
store.selectedImeis.find((i) => i.imei === imeiRec.imei) ||
selectedImeis.value.find((i) => i.imei === imeiRec.imei)
) {
if (selectedImeis.value.find((i) => i.imei === imeiRec.imei)) {
remove(selectedImeis.value, (i) => i.imei === imeiRec.imei);
} else {
selectedImeis.value.push(imeiRec);
}
}
function addToCart() {
// store.selectedImeis = [...store.selectedImeis, ...selectedImeis.value];
/*
insert into cart with customer =
*/
$snackbar(`Thêm ${selectedImeis.value.length} sản phẩm vào giỏ hàng`, "Success");
emit("close");
const cartItems = inject("cartItems");
const getCart = inject("getCart");
const isAdding = ref(false);
async function addToCart() {
try {
isAdding.value = true;
console.log("store.customer", store.customer);
let cart = await $getdata("Cart", {
filter: { customer: store.customer },
first: true,
});
if (!cart) {
const newCart = await $insertapi("Cart", {
data: { customer: store.customer },
notify: false,
});
cart = newCart;
}
const cartItemsPayload = selectedImeis.value.map((imeiRec) => ({
cart: cart.id,
imei: imeiRec.id,
quantity: 1,
total_price: imeiRec.variant__price,
}));
const newCartItems = await $insertapi("Cart_Item", {
data: cartItemsPayload,
notify: false,
});
$snackbar(`Đã thêm ${newCartItems.length} sản phẩm vào giỏ hàng`, "Success");
getCart();
emit("close");
} catch (error) {
console.error(error);
$snackbar("Đã có lỗi khi thêm sản phẩm vào giỏ hàng", "Error");
} finally {
isAdding.value = false;
}
}
async function fetchImeis() {
@@ -40,7 +71,11 @@ async function fetchImeis() {
filter: { variant: props.variant.id },
});
imeis.value = imeisFetched.filter((imeiRec) => !store.selectedImeis.find((i) => i.imei === imeiRec.imei));
imeis.value = imeisFetched.filter((imeiRec) => {
const alreadyInCart = cartItems.value.find((cartItem) => cartItem.imei === imeiRec.id);
return !alreadyInCart;
});
isLoading.value = false;
}
onMounted(fetchImeis);
@@ -111,7 +146,7 @@ onMounted(fetchImeis);
<div class="is-flex is-justify-content-end">
<button
@click="addToCart"
class="button is-primary"
:class="['button is-primary', isAdding && 'is-loading']"
:disabled="selectedImeis.length === 0"
>
<span class="icon">

View File

@@ -1,14 +1,40 @@
<script setup>
import { isNil } from "es-toolkit";
import Address from "~/components/pos/Address.vue";
import ProductCard from "~/components/pos/ProductCard.vue";
import CartItem from "~/components/pos/CartItem.vue";
import SearchBox from "~/components/SearchBox.vue";
const store = useStore();
const { $getdata, $numtoString } = useNuxtApp();
const cart = ref();
const cartItems = ref();
function openModal() {
store.showmodal = {
async function getCart() {
console.count("getCart");
const cartFetched = await $getdata("Cart", {
filter: { customer: store.customer },
first: true,
});
cart.value = cartFetched;
const cartItemsFetched = await $getdata("Cart_Item", {
filter: {
cart: cartFetched.id,
},
});
cartItems.value = cartItemsFetched;
console.log("cartFetched", cartFetched);
console.log("cartItemsFetched", cartItemsFetched);
}
provide("cartItems", cartItems);
provide("getCart", getCart);
onMounted(getCart);
const showProductSelectionModal = ref();
function openProductSelectionModal() {
showProductSelectionModal.value = {
component: "pos/ProductSelection",
title: "Chọn sản phẩm",
width: "85%",
@@ -24,7 +50,8 @@ const orderInfo = ref({
});
const addresses = ref([]);
const subtotal = computed(() => {
return store.selectedImeis.reduce((prev, curr) => prev + curr.variant__price, 0);
return 0;
// return store.selectedImeis.reduce((prev, curr) => prev + curr.variant__price, 0);
});
async function getAddresses() {
@@ -68,7 +95,7 @@ function openConfirmModal() {
<div :class="['cell', store.viewport < 4 ? 'is-col-span-12' : 'is-col-span-8']">
<div class="card">
<div class="card-content">
<div class="is-flex is-justify-content-space-between">
<div class="block is-flex is-justify-content-space-between">
<p class="icon-text fs-16 font-semibold mb-4">
<span class="icon">
<Icon
@@ -79,7 +106,7 @@ function openConfirmModal() {
<span>Giỏ hàng</span>
</p>
<button
@click="openModal"
@click="openProductSelectionModal"
class="button is-primary"
>
<span class="icon">
@@ -92,14 +119,13 @@ function openConfirmModal() {
</button>
</div>
<div
v-if="store.selectedImeis.length > 0"
v-if="cartItems"
class="is-flex is-flex-direction-column is-gap-1"
>
<ProductCard
v-for="imei in store.selectedImeis"
:key="imei.id"
:imei="imei"
deleteable
<CartItem
v-for="cartItem in cartItems"
:key="cartItem.id"
:cartItem="cartItem"
/>
</div>
<p
@@ -253,7 +279,8 @@ function openConfirmModal() {
<tr>
<td>
<span>Tạm tính</span>
<span> ({{ store.selectedImeis.length }} sản phẩm)</span>
<span> ({{ 0 }} sản phẩm)</span>
<!-- <span> ({{ store.selectedImeis.length }} sản phẩm)</span> -->
</td>
<td class="has-text-right">{{ $numtoString(subtotal, { hasUnit: true }) }}</td>
</tr>
@@ -278,6 +305,11 @@ function openConfirmModal() {
</div>
</div>
</div>
<Modal
v-if="showProductSelectionModal"
v-bind="showProductSelectionModal"
@close="showProductSelectionModal = undefined"
/>
<Modal
v-if="showConfirmModal"
v-bind="showConfirmModal"

View File

@@ -1,3 +1,5 @@
/** @typedef {import('~/utils/apis').ApiName} ApiName */
export default defineNuxtPlugin((nuxtApp) => {
const module = "application";
const mode = "dev";
@@ -18,6 +20,9 @@ export default defineNuxtPlugin((nuxtApp) => {
return name ? paths.find((v) => v.name === name).url : path;
};
/**
* @param {ApiName | ApiName[]} apiNames
*/
const findapi = function (name) {
const result = Array.isArray(name)
? apis.filter((v) => name.findIndex((x) => v.name === x) >= 0)
@@ -30,6 +35,9 @@ export default defineNuxtPlugin((nuxtApp) => {
return $copy(result);
};
/**
* @param {ApiName[]} apiNames
*/
const readyapi = function (apiNames) {
const apisWithReady = [];
apiNames.forEach((apiName) => {
@@ -69,6 +77,9 @@ export default defineNuxtPlugin((nuxtApp) => {
}
};
/**
* @param {ApiName} name
*/
const insertapi = async function (name, { data, values, notify = true } = {}) {
try {
const api = findapi(name);
@@ -115,6 +126,9 @@ export default defineNuxtPlugin((nuxtApp) => {
}
};
/**
* @param {ApiName} name
*/
const patchapi = async function (name, data, values, notify) {
try {
const api = findapi(name);
@@ -222,6 +236,9 @@ export default defineNuxtPlugin((nuxtApp) => {
return copy;
};
/**
* @param {ApiName} name
*/
const getdata = async function (name, { filter, params, first = false } = {}) {
const api = findapi(name);
if (params) api.params = params;
@@ -300,7 +317,9 @@ export default defineNuxtPlugin((nuxtApp) => {
return result;
};
// delete data
/**
* @param {ApiName} name
*/
const deleteapi = async function (name, id) {
try {
const found = findapi(name);

View File

@@ -14,7 +14,7 @@ export const useStore = defineStore("maindev", {
branch: {},
rights: [],
product: [],
selectedImeis: [],
customer: undefined,
}),
actions: {
commit(name, data) {
@@ -24,7 +24,7 @@ export const useStore = defineStore("maindev", {
},
persist: {
pick: ["token", "login", "lang", "selectedImeis"],
pick: ["token", "login", "lang", "customer"],
storage: piniaPluginPersistedstate.localStorage(),
},
});

View File

@@ -1,4 +1,4 @@
export default [
export default /** @type {const} */ ([
{ name: "sendemail", url: "send-email/" },
{ name: "deleteentry", url: "delete-entry/" },
{ name: "emailpreview", url: "email-preview/" },
@@ -709,720 +709,13 @@ export default [
name: "Cart_Item",
url: "data/Cart_Item/",
url_detail: "data-detail/Cart_Item/",
params: {},
},
];
const apis = [
{ name: "sendemail", url: "send-email/" },
{ name: "deleteentry", url: "delete-entry/" },
{ name: "emailpreview", url: "email-preview/" },
{ name: "workflow", url: "workflow/execute/" },
{ name: "accountentry", url: "account-entry/", params: {} },
{ name: "accountmultientry", url: "account-multi-entry/", params: {} },
{ name: "modelfields", url: "model-fields/", params: {} },
{ name: "readexcel", url: "read-excel/", params: {} },
{ name: "findkey", url: "find-key/", params: {} },
{ name: "getcodeCustomer", url: "increment/Customer/KH/", params: {} },
{ name: "getcodepeople", url: "increment/People/RE/", params: {} },
{ name: "getcodecompany", url: "increment/Company/CP/", params: {} },
{ name: "exportcsv", url: "exportcsv/", params: {} },
{
name: "importsetting",
url: "data/Import_Setting/",
url_detail: "data-detail/Import_Setting/",
params: {},
},
{
name: "individual",
url: "data/Individual/",
url_detail: "data-detail/Individual/",
params: {
sort: "-id",
values: "id,customer,dob,sex,sex__name,sex__en,zalo,facebook,company,company__fullname,create_time,update_time",
},
},
{
name: "organization",
url: "data/Organization/",
url_detail: "data-detail/Organization/",
params: {
sort: "-id",
values: "id,customer,shortname,established_date,website,type,type__name,create_time,update_time",
},
},
{
name: "companytype",
url: "data/Company_Type/",
url_detail: "data-detail/Company_Type/",
params: {
values: "id,code,name,create_time",
},
},
{
name: "people",
url: "data/People/",
url_detail: "data-detail/People/",
params: {
sort: "-id",
values:
"id,issued_place,issued_place__code,issued_place__name,contact_address,address,country__name,company__fullname,legal_code,company,country,email,creator,code,fullname,dob,sex,legal_code,sex__name,phone,issued_date,legal_type,legal_type__name,address,note,updater,updater__fullname,create_time,update_time",
distinct_values: {
label: { type: "Concat", field: ["code", "fullname", "phone"] },
order: { type: "RowNumber" },
},
summary: "annotate",
"id,code,cart,imei,quantity,status,total_price,deleted,create_time,update_time,imei__code,imei__imei,imei__variant,imei__variant,imei__variant__code,imei__variant__product,imei__variant__product__code,imei__variant__product__name,imei__variant__product__manufacturer,imei__variant__product__os,imei__variant__product__battery,imei__variant__product__screen,imei__variant__product__cpu,imei__variant__product__gpu,imei__variant__product__camera_system,imei__variant__product__sim,imei__variant__product__network_technology,imei__variant__product__charging_technology,imei__variant__product__external_storage,imei__variant__product__ip_rating,imei__variant__product__design,imei__variant__product__creator,imei__variant__product__updater,imei__variant__product__deleted,imei__variant__color,imei__variant__color__code,imei__variant__color__name,imei__variant__color__hex_code,imei__variant__color__deleted,imei__variant__ram,imei__variant__ram__code,imei__variant__ram__capacity,imei__variant__ram__deleted,imei__variant__internal_storage,imei__variant__internal_storage__code,imei__variant__internal_storage__capacity,imei__variant__internal_storage__deleted,imei__variant__image,imei__variant__image__code,imei__variant__image__name,imei__variant__image__path,imei__variant__image__is_active,imei__variant__image__deleted,imei__variant__image__create_time,imei__variant__price,imei__variant__note,imei__variant__creator,imei__variant__updater,imei__variant__deleted,imei__variant__create_time,imei__variant__update_time,imei__deleted,imei__create_time,imei__update_time",
},
},
{
name: "currency",
url: "data/Currency/",
url_detail: "data-detail/Currency/",
params: {},
},
{
name: "approvestatus",
url: "data/Approve_Status/",
url_detail: "data-detail/Approve_Status/",
params: {},
},
{
name: "bizrights",
url: "data/Biz_Rights/",
url_detail: "data-detail/Biz_Rights/",
params: { sort: "-id" },
},
{
name: "documenttype",
url: "data/Document_Type/",
url_detail: "data-detail/Document_Type/",
params: { sort: "index" },
},
{
name: "country",
url: "data/Country/",
commit: "country",
params: {
sort: "id",
values: "id,code,name,en,create_time",
},
},
{
name: "status",
url: "data/Approve_Status/",
]);
params: {
values: "id,code,name,create_time",
},
},
{
name: "image",
url: "data/Image/",
url_detail: "data-detail/Image/",
params: {},
},
{
name: "file",
url: "data/File/",
url_detail: "data-detail/File/",
params: {},
},
{
name: "filetype",
url: "data/File_Type/",
url_detail: "data-detail/File_Type/",
params: {},
},
{
name: "news",
commit: "updateNews",
url: "data/News/",
url_detail: "data-detail/News/",
params: { values: "id,title,subtitle,create_time" },
},
{
name: "category",
commit: "updateCategory",
url: "data/Category/",
url_detail: "data-detail/Category/",
params: {},
},
{
name: "contract",
url: "data/Contract/",
url_detail: "data-detail/Contract/",
params: {
sort: "-id",
},
},
{
name: "token",
url: "data/Token/",
url_detail: "data-detail/Token/",
params: {
values:
"id,token,browser,browser_version,ip,os,platform,expiry,create_time,update_time,user,user__fullname,user__username",
sort: "-id",
},
},
{ name: "authtoken", url: "auth-token/", params: {} },
{
name: "notification",
commit: "updateNotification",
url: "data/Notify/",
url_detail: "data-detail/Notify/",
params: {
values:
"id,title,content,image,link,task_log,user,user__username,user__fullname,event,seen,create_time,event__code,event__name,update_time",
},
},
{
name: "common",
commit: "common",
url: "data/Common/",
url_detail: "data-detail/Common/",
params: { sort: "index" },
},
{ name: "upload", url: "upload/", params: {} },
{
name: "paymentstatus",
url: "data/Payment_Status/",
url_detail: "data-detail/Payment_Status/",
params: {
values: "id,code,name,en,index,create_time",
},
},
{
name: "paymenttype",
url: "data/Payment_Type/",
url_detail: "data-detail/Payment_Type/",
params: {
values: "id,code,name,en,index,create_time",
},
},
{
name: "paymentmethod",
url: "data/Payment_Method/",
url_detail: "data-detail/Payment_Method/",
params: {},
},
{
name: "request",
url: "data/Request/",
url_detail: "data-detail/Request/",
params: {},
},
{
name: "register",
url: "data/Register/",
url_detail: "data-detail/Register/",
params: {},
},
{ name: "sendemail", url: "send-email/", path: "etl", params: {} },
{ name: "sendemailnow", url: "send-email-now/", path: "etl", params: {} },
{
name: "usersession",
url: "data/User_Session/",
url_detail: "data-detail/User_Session/",
params: {},
},
{
name: "userlog",
url: "data/User_Log/",
url_detail: "data-detail/User_Log/",
params: {},
},
{
name: "usersetting",
url: "data/User_Setting/",
url_detail: "data-detail/User_Setting/",
params: {},
},
{ name: "account-entry", url: "/account-entry/", params: {} },
{
name: "valuetype",
url: "data/Value_Type/",
url_detail: "data-detail/Value_Type/",
params: {
values: "id,code,name,en,index,create_time",
sort: "index",
},
},
{
name: "bizsetting",
commit: "bizsetting",
url: "data/Biz_Setting/",
url_detail: "data-detail/Biz_Setting/",
params: {},
},
{
name: "discounttype",
commit: "discounttype",
url: "data/Discount_Type/",
url_detail: "data-detail/Discount_Type/",
params: {
values: "id,code,name,value,type,type__name,method,method__name",
distinct_values: {
label: { type: "Concat", field: ["code", "name", "type__name"] },
},
summary: "annotate",
},
},
{
name: "customer",
url: "data/Customer/",
url_detail: "data-detail/Customer/",
params: {
values:
"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"],
},
order: { type: "RowNumber" },
},
summary: "annotate",
filter: { deleted: 0 },
sort: "-id",
},
},
{
name: "product",
commit: "product",
url: "data/Product/",
url_detail: "data-detail/Product/",
params: {
values:
"id,code,name,manufacturer,manufacturer__name,os,os__name,battery,battery__code,screen,cpu,cpu__name,gpu,gpu__name,camera_system,camera_system__code,sim,sim__code,network_technology,network_technology__name,charging_technology,charging_technology__code,external_storage,external_storage__max_capacity,ip_rating,ip_rating__code,design,create_time,update_time",
distinct_values: {
label: { type: "Concat", field: ["name", "os__name", "manufacturer__name"] },
},
summary: "annotate",
},
},
{
name: "Product_Variant",
url: "data/Product_Variant/",
url_detail: "data-detail/Product_Variant/",
params: {},
},
{
name: "settingclass",
commit: "settingclass",
url: "data/Setting_Class/",
url_detail: "data-detail/Setting_Class/",
params: {},
},
{
name: "user",
url: "data/User/",
url_detail: "data-detail/User/",
params: {
sort: "-id",
values:
"id,auth_method__code,blocked,auth_status__code,username,register_method__code,fullname,type,type__code,type__name,create_time,create_time__date,auth_method,auth_status,register_method,create_time,update_time",
distinct_values: {
label: { type: "Concat", field: ["username", "fullname"] },
},
summary: "annotate",
},
},
{ name: "gethash", url: "get-hash/", params: {} },
{
name: "login",
url: "login/",
params: {
values:
"id,username,password,avatar,fullname,display_name,type,type__code,type__name,blocked,block_reason,block_reason__code,block_reason__name,blocked_by,last_login,auth_method,auth_method__code,auth_method__name,auth_status,auth_status__code,auth_status__name,register_method,register_method__code,register_method__name,create_time,update_time",
},
},
{
name: "settingtype",
commit: "settingtype",
url: "data/Setting_Type/",
url_detail: "data-detail/Setting_Type/",
params: {},
},
{
name: "colorchoice",
commit: "colorchoice",
url: "data/Color_Choice/",
url_detail: "data-detail/Color_Choice/",
params: { sort: "id" },
},
{
name: "filterchoice",
commit: "filterchoice",
url: "data/Filter_Choice/",
url_detail: "data-detail/Filter_Choice/",
params: { sort: "id" },
},
{
name: "datatype",
commit: "datatype",
url: "data/Data_Type/",
url_detail: "data-detail/Data_Type/",
params: { sort: "id" },
},
{
name: "textalign",
commit: "textalign",
url: "data/Text_Align/",
url_detail: "data-detail/Text_Align/",
params: { sort: "id" },
},
{
name: "placement",
commit: "placement",
url: "data/Placement/",
url_detail: "data-detail/Placement/",
params: { sort: "id" },
},
{
name: "colorscheme",
commit: "colorscheme",
url: "data/Color_Scheme/",
url_detail: "data-detail/Color_Scheme/",
params: { sort: "id" },
},
{
name: "textcolor",
commit: "textcolor",
url: "data/Text_Color/",
url_detail: "data-detail/Text_Color/",
params: { sort: "id" },
},
{
name: "filtertype",
commit: "filtertype",
url: "data/Filter_Type/",
url_detail: "data-detail/Filter_Type/",
params: { sort: "id" },
},
{
name: "sorttype",
commit: "sorttype",
url: "data/Sort_Type/",
url_detail: "data-detail/Sort_Type/",
params: { sort: "id" },
},
{
name: "tablesetting",
commit: "tablesetting",
url: "data/Table_Setting/",
url_detail: "data-detail/Table_Setting/",
params: { sort: "id", values: "id,code,name,detail" },
},
{
name: "settingchoice",
commit: "settingchoice",
url: "data/Setting_Choice/",
url_detail: "data-detail/Setting_Choice/",
params: { sort: "id" },
},
{
name: "menuchoice",
commit: "menuchoice",
url: "data/Menu_Choice/",
url_detail: "data-detail/Menu_Choice/",
params: {},
},
{
name: "moneyunit",
commit: "moneyunit",
url: "data/Money_Unit/",
url_detail: "data-detail/Money_Unit/",
params: {},
},
{
name: "legaltype",
commit: "legaltype",
url: "data/Legal_Type/",
url_detail: "data-detail/Legal_Type/",
params: { page: -1 },
},
{
name: "sex",
commit: "sex",
url: "data/Sex/",
url_detail: "data-detail/Sex/",
params: {},
},
{
name: "usertype",
commit: "UserType",
url: "data/User_Type/",
url_detail: "data-detail/User_Type/",
params: {},
},
{
name: "legalrep",
url: "data/Legal_Rep/",
url_detail: "data-detail/Legal_Rep/",
params: {
values:
"id,organization,people,people__code,people__address,people__fullname,people__phone,relation,relation__code,relation__name,relation__en,create_time",
},
},
{
name: "customertype",
url: "data/Customer_Type/",
url_detail: "data-detail/Customer_Type/",
params: { values: "id,code,name,create_time" },
},
{
name: "peoplefile",
url: "data/People_File/",
url_detail: "data-detail/People_File/",
params: { values: "id,ref,file,file__name,file__file" },
},
{
name: "relation",
commit: "relation",
url: "data/Relation/",
url_detail: "data-detail/Relation/",
params: { sort: "id" },
},
{
name: "company",
url: "data/Company/",
url_detail: "data-detail/Company/",
params: {
values:
"id,country,website,email,code,phone,shortname,fullname,address,create_time,update_time,creator,creator__fullname,updater,updater__fullname",
},
},
{
name: "exportlog",
url: "data/Export_Log/",
url_detail: "data-detail/Export_Log/",
params: {},
},
{
name: "bank",
url: "data/Bank/",
url_detail: "data-detail/Bank/",
params: {},
},
{
name: "Email_Template",
url: "data/Email_Template/",
url_detail: "data-detail/Email_Template/",
params: {},
},
{
name: "issuedplace",
url: "data/Issued_Place/",
url_detail: "data-detail/Issued_Place/",
params: { values: "id,code,name,create_time" },
},
{
name: "grouprights",
commit: "grouprights",
url: "data/Group_Rights/",
url_detail: "data-detail/Group_Rights/",
params: {
values: "id,setting,setting__vi,setting__code,setting__category,group,group__name,is_edit,create_time",
sort: "-id",
},
},
{
name: "discountmethod",
commit: "discountmethod",
url: "data/Discount_Method/",
url_detail: "data-detail/Discount_Method/",
params: { sort: "-id" },
},
{
name: "emailtemplate",
url: "data/Email_Template/",
url_detail: "data-detail/Email_Template/",
params: { values: "id,name,content,create_time,update_time" },
},
{
name: "gift",
commit: "gift",
url: "data/Gift/",
url_detail: "data-detail/Gift/",
params: { sort: "-id" },
},
{
name: "transactiongift",
commit: "transactiongift",
url: "data/Transaction_Gift/",
url_detail: "data-detail/Transaction_Gift/",
params: {},
},
{
name: "Invoice",
url: "data/Invoice/",
url_detail: "data-detail/Invoice/",
params: {},
},
{
name: "Manufacturer",
url: "data/Manufacturer/",
url_detail: "data-detail/Manufacturer/",
params: {},
},
{
name: "OS",
url: "data/OS/",
url_detail: "data-detail/OS/",
params: {
sort: "name",
},
},
{
name: "Battery",
url: "data/Battery/",
url_detail: "data-detail/Battery/",
params: {},
},
{
name: "Screen",
url: "data/Screen/",
url_detail: "data-detail/Screen/",
params: {
values: "id,code,resolution,standard,technology,size,create_time",
distinct_values: {
label: {
type: "Concat",
field: ["resolution", "standard", "technology"],
},
},
summary: "annotate",
},
},
{
name: "CPU",
url: "data/CPU/",
url_detail: "data-detail/CPU/",
params: {},
},
{
name: "GPU",
url: "data/GPU/",
url_detail: "data-detail/GPU/",
params: {},
},
{
name: "Camera_System",
url: "data/Camera_System/",
url_detail: "data-detail/Camera_System/",
params: {},
},
{
name: "SIM",
url: "data/SIM/",
url_detail: "data-detail/SIM/",
params: {},
},
{
name: "Network_Technology",
url: "data/Network_Technology/",
url_detail: "data-detail/Network_Technology/",
params: {},
},
{
name: "Charging_Technology",
url: "data/Charging_Technology/",
url_detail: "data-detail/Charging_Technology/",
params: {},
},
{
name: "External_Storage",
url: "data/External_Storage/",
url_detail: "data-detail/External_Storage/",
params: {},
},
{
name: "IP_Rating",
url: "data/IP_Rating/",
url_detail: "data-detail/IP_Rating/",
params: {},
},
{
name: "Design",
url: "data/Design/",
url_detail: "data-detail/Design/",
params: {
values: "id,code,frame_material,back_material,create_time",
distinct_values: {
label: {
type: "Concat",
field: ["frame_material", "back_material"],
},
},
summary: "annotate",
},
},
{
name: "Color",
url: "data/Color/",
url_detail: "data-detail/Color/",
params: {},
},
{
name: "RAM",
url: "data/RAM/",
url_detail: "data-detail/RAM/",
params: {
sort: "capacity",
},
},
{
name: "Internal_Storage",
url: "data/Internal_Storage/",
url_detail: "data-detail/Internal_Storage/",
params: {
sort: "capacity",
},
},
{
name: "IMEI",
url: "data/IMEI/",
url_detail: "data-detail/IMEI/",
params: {
sort: "id",
values:
"id,code,imei,variant,variant,variant__code,variant__product,variant__product__code,variant__product__name,variant__product__manufacturer,variant__product__os,variant__product__battery,variant__product__screen,variant__product__cpu,variant__product__gpu,variant__product__camera_system,variant__product__sim,variant__product__network_technology,variant__product__charging_technology,variant__product__external_storage,variant__product__ip_rating,variant__product__design,variant__product__creator,variant__product__updater,variant__product__deleted,variant__color,variant__color__code,variant__color__name,variant__color__hex_code,variant__color__deleted,variant__ram,variant__ram__code,variant__ram__capacity,variant__ram__deleted,variant__internal_storage,variant__internal_storage__code,variant__internal_storage__capacity,variant__internal_storage__deleted,variant__image,variant__image__code,variant__image__name,variant__image__path,variant__image__is_active,variant__image__deleted,variant__image__create_time,variant__price,variant__note,variant__creator,variant__updater,variant__deleted,variant__create_time,variant__update_time,deleted,create_time,update_time",
},
},
{
name: "Product_Image",
url: "data/Product_Image/",
url_detail: "data-detail/Product_Image/",
params: {},
},
{
name: "Payment_Method",
url: "data/Payment_Method/",
url_detail: "data-detail/Payment_Method/",
params: {},
},
{
name: "Customer_Address",
url: "data/Customer_Address/",
url_detail: "data-detail/Customer_Address/",
params: {},
},
{
name: "Delivery_Method",
url: "data/Delivery_Method/",
url_detail: "data-detail/Delivery_Method/",
params: {},
},
{
name: "Cart",
url: "data/Cart/",
url_detail: "data-detail/Cart/",
params: {},
},
{
name: "Cart_Item",
url: "data/Cart_Item/",
url_detail: "data-detail/Cart_Item/",
params: {},
},
];
/**
* @typedef {apis[number]['name']} ApiName
*/