changes
This commit is contained in:
@@ -79,7 +79,6 @@
|
|||||||
<button
|
<button
|
||||||
class="button is-light"
|
class="button is-light"
|
||||||
@click="clearValue"
|
@click="clearValue"
|
||||||
style="height: 100%"
|
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
|
|||||||
@@ -4,9 +4,19 @@
|
|||||||
class="mb-4"
|
class="mb-4"
|
||||||
v-if="currentsetting"
|
v-if="currentsetting"
|
||||||
>
|
>
|
||||||
<p>
|
<span>Đang mở: </span>
|
||||||
Đang mở: <b>{{ $stripHtml(currentsetting.name, 40) }}</b>
|
<b>{{ $stripHtml(currentsetting.name, 40) }}</b>
|
||||||
</p>
|
<button
|
||||||
|
class="button is-small size-7 p-0 ml-1 is-primary is-light is-rounded"
|
||||||
|
@click="$copyToClipboard(currentsetting.name)"
|
||||||
|
>
|
||||||
|
<span class="icon">
|
||||||
|
<Icon
|
||||||
|
name="material-symbols:content-copy-outline-rounded"
|
||||||
|
:size="14"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label">Chọn chế độ lưu</label>
|
<label class="label">Chọn chế độ lưu</label>
|
||||||
@@ -100,7 +110,8 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { useStore } from "@/stores/index";
|
import { useStore } from "@/stores/index";
|
||||||
const emit = defineEmits([]);
|
|
||||||
|
const emit = defineEmits(["modalevent", "close"]);
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
pagename: String,
|
pagename: String,
|
||||||
@@ -109,7 +120,7 @@ const props = defineProps({
|
|||||||
data: Object,
|
data: Object,
|
||||||
focus: Boolean,
|
focus: Boolean,
|
||||||
});
|
});
|
||||||
const { $empty, $copy, $stripHtml, $updateapi, $insertapi, $findIndex, $snackbar } = useNuxtApp();
|
const { $empty, $copy, $copyToClipboard, $stripHtml, $updateapi, $insertapi, $findIndex, $snackbar } = useNuxtApp();
|
||||||
const radioOption = ref();
|
const radioOption = ref();
|
||||||
const login = { id: 1 };
|
const login = { id: 1 };
|
||||||
const errors = ref([]);
|
const errors = ref([]);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<span>{{ $stripHtml(v[name] || v.fullname || v.code || "n/a", 75) }}</span>
|
<span>{{ $stripHtml(v[name] || v.fullname || v.code || "n/a", 75) }}</span>
|
||||||
<span
|
<span
|
||||||
v-if="checked[i] && notick !== true"
|
v-if="checked[i] && notick !== true"
|
||||||
class="icon right-3"
|
class="icon right-3 has-background-inherit"
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
name="material-symbols:check-rounded"
|
name="material-symbols:check-rounded"
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
<span>{{ $stripHtml(v[name] || v.fullname || v.code || "n/a", 75) }}</span>
|
<span>{{ $stripHtml(v[name] || v.fullname || v.code || "n/a", 75) }}</span>
|
||||||
<span
|
<span
|
||||||
v-if="checked[i] && notick !== true"
|
v-if="checked[i] && notick !== true"
|
||||||
class="icon right-3"
|
class="icon right-3 has-background-inherit"
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
name="material-symbols:check-rounded"
|
name="material-symbols:check-rounded"
|
||||||
|
|||||||
@@ -26,16 +26,16 @@ async function submit() {
|
|||||||
<div class="grid">
|
<div class="grid">
|
||||||
<div class="cell is-col-span-4">
|
<div class="cell is-col-span-4">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label class="label">Variant</label>
|
<label class="label">Mã Phiên bản</label>
|
||||||
<SearchBox
|
<SearchBox
|
||||||
v-bind="{
|
v-bind="{
|
||||||
api: 'Product_Variant',
|
api: 'Product_Variant',
|
||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
optionid: variant.id,
|
optionid: variant.id,
|
||||||
|
clearable: false,
|
||||||
disabled: true,
|
disabled: true,
|
||||||
first: true,
|
first: true,
|
||||||
placeholder: 'Variant',
|
|
||||||
}"
|
}"
|
||||||
@option="body.variant = $event?.id ?? $event"
|
@option="body.variant = $event?.id ?? $event"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ watch(product, () => {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
placeholder: 'Tìm sản phẩm',
|
placeholder: 'Tìm sản phẩm',
|
||||||
addon: {
|
addon: {
|
||||||
component: 'imports/AddProductForm',
|
component: 'imports/AddProductForm',
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ async function submit() {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.os,
|
optionid: body.os,
|
||||||
placeholder: 'OS',
|
placeholder: 'OS',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -137,7 +136,6 @@ async function submit() {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.manufacturer,
|
optionid: body.manufacturer,
|
||||||
placeholder: 'Hãng',
|
placeholder: 'Hãng',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -160,7 +158,6 @@ async function submit() {
|
|||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.battery,
|
optionid: body.battery,
|
||||||
placeholder: 'Pin',
|
placeholder: 'Pin',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -183,7 +180,6 @@ async function submit() {
|
|||||||
field: 'label',
|
field: 'label',
|
||||||
column: ['resolution', 'standard', 'technology'],
|
column: ['resolution', 'standard', 'technology'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.screen,
|
optionid: body.screen,
|
||||||
placeholder: 'Màn hình',
|
placeholder: 'Màn hình',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -206,7 +202,6 @@ async function submit() {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
placeholder: 'CPU',
|
placeholder: 'CPU',
|
||||||
optionid: body.cpu,
|
optionid: body.cpu,
|
||||||
addon: {
|
addon: {
|
||||||
@@ -229,7 +224,6 @@ async function submit() {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.gpu,
|
optionid: body.gpu,
|
||||||
placeholder: 'GPU',
|
placeholder: 'GPU',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -252,7 +246,6 @@ async function submit() {
|
|||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.camera_system,
|
optionid: body.camera_system,
|
||||||
placeholder: 'Camera',
|
placeholder: 'Camera',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -275,7 +268,6 @@ async function submit() {
|
|||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.sim,
|
optionid: body.sim,
|
||||||
placeholder: 'SIM',
|
placeholder: 'SIM',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -298,7 +290,6 @@ async function submit() {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.network_technology,
|
optionid: body.network_technology,
|
||||||
placeholder: 'Kết nối',
|
placeholder: 'Kết nối',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -321,7 +312,6 @@ async function submit() {
|
|||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.charging_technology,
|
optionid: body.charging_technology,
|
||||||
placeholder: 'Công nghệ sạc',
|
placeholder: 'Công nghệ sạc',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -344,7 +334,6 @@ async function submit() {
|
|||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.external_storage,
|
optionid: body.external_storage,
|
||||||
placeholder: 'Bộ nhớ ngoài',
|
placeholder: 'Bộ nhớ ngoài',
|
||||||
position: 'is-top-right',
|
position: 'is-top-right',
|
||||||
@@ -368,7 +357,6 @@ async function submit() {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.ip_rating,
|
optionid: body.ip_rating,
|
||||||
placeholder: 'Chỉ số IP',
|
placeholder: 'Chỉ số IP',
|
||||||
position: 'is-top-right',
|
position: 'is-top-right',
|
||||||
@@ -392,7 +380,6 @@ async function submit() {
|
|||||||
field: 'label',
|
field: 'label',
|
||||||
column: ['frame_material', 'back_material'],
|
column: ['frame_material', 'back_material'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.design,
|
optionid: body.design,
|
||||||
placeholder: 'Chất liệu',
|
placeholder: 'Chất liệu',
|
||||||
position: 'is-top-right',
|
position: 'is-top-right',
|
||||||
|
|||||||
@@ -137,7 +137,6 @@ async function submit() {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.color,
|
optionid: body.color,
|
||||||
placeholder: 'Màu sắc',
|
placeholder: 'Màu sắc',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -160,7 +159,6 @@ async function submit() {
|
|||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.ram,
|
optionid: body.ram,
|
||||||
placeholder: 'RAM',
|
placeholder: 'RAM',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -183,7 +181,6 @@ async function submit() {
|
|||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.internal_storage,
|
optionid: body.internal_storage,
|
||||||
placeholder: 'Bộ nhớ trong',
|
placeholder: 'Bộ nhớ trong',
|
||||||
addon: {
|
addon: {
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ async function submit() {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
placeholder: 'Sản phẩm',
|
placeholder: 'Sản phẩm',
|
||||||
addon: {
|
addon: {
|
||||||
component: 'imports/ProductForm',
|
component: 'imports/ProductForm',
|
||||||
@@ -116,7 +115,6 @@ async function submit() {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.color,
|
optionid: body.color,
|
||||||
placeholder: 'Màu sắc',
|
placeholder: 'Màu sắc',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -139,7 +137,6 @@ async function submit() {
|
|||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.ram,
|
optionid: body.ram,
|
||||||
placeholder: 'RAM',
|
placeholder: 'RAM',
|
||||||
addon: {
|
addon: {
|
||||||
@@ -162,7 +159,6 @@ async function submit() {
|
|||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: body.internal_storage,
|
optionid: body.internal_storage,
|
||||||
placeholder: 'Bộ nhớ trong',
|
placeholder: 'Bộ nhớ trong',
|
||||||
addon: {
|
addon: {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export default {
|
|||||||
props: ["api", "pagename", "row", "disable"],
|
props: ["api", "pagename", "row", "disable"],
|
||||||
methods: {
|
methods: {
|
||||||
async openFile(row) {
|
async openFile(row) {
|
||||||
let url = `${this.$getpath()}static/files/${row.file__file || row.file}`;
|
const url = `${this.$getpath()}static/files/${row.file__file || row.file}`;
|
||||||
window.open(url, "_blank");
|
window.open(url, "_blank");
|
||||||
},
|
},
|
||||||
async downloadFile(url, fileName) {
|
async downloadFile(url, fileName) {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ async function fetchImeis() {
|
|||||||
filter: { variant: props.variant.id },
|
filter: { variant: props.variant.id },
|
||||||
});
|
});
|
||||||
|
|
||||||
imeis.value = imeisFetched;
|
imeis.value = imeisFetched.filter((imeiRec) => !store.selectedImeis.find((i) => i.imei === imeiRec.imei));
|
||||||
isLoading.value = false;
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
onMounted(fetchImeis);
|
onMounted(fetchImeis);
|
||||||
@@ -84,27 +84,24 @@ onMounted(fetchImeis);
|
|||||||
v-for="(imeiRec, i) in imeis"
|
v-for="(imeiRec, i) in imeis"
|
||||||
:key="imeiRec.id"
|
:key="imeiRec.id"
|
||||||
class="is-clickable"
|
class="is-clickable"
|
||||||
:class="
|
:class="selectedImeis.find((i) => i.imei === imeiRec.imei) && 'is-selected'"
|
||||||
(store.selectedImeis.find((i) => i.imei === imeiRec.imei) ||
|
|
||||||
selectedImeis.find((i) => i.imei === imeiRec.imei)) &&
|
|
||||||
'is-selected'
|
|
||||||
"
|
|
||||||
@click="toggleSelected(imeiRec)"
|
@click="toggleSelected(imeiRec)"
|
||||||
>
|
>
|
||||||
<td class="is-narrow">
|
<td class="is-narrow">
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
:checked="
|
:checked="selectedImeis.find((i) => i.imei === imeiRec.imei)"
|
||||||
store.selectedImeis.find((i) => i.imei === imeiRec.imei) ||
|
|
||||||
selectedImeis.find((i) => i.imei === imeiRec.imei)
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
<td class="is-narrow">{{ i + 1 }}</td>
|
<td class="is-narrow">{{ i + 1 }}</td>
|
||||||
<td class="is-family-monospace">{{ imeiRec.imei }}</td>
|
<td class="is-family-monospace">{{ imeiRec.imei }}</td>
|
||||||
<td>{{ imeiRec.deleted ? "Không có sẵn" : "Có sẵn" }}</td>
|
<td>
|
||||||
|
<span :class="['tag is-light', imeiRec.deleted ? 'is-danger' : 'is-success']">{{
|
||||||
|
imeiRec.deleted ? "Không có sẵn" : "Có sẵn"
|
||||||
|
}}</span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import ProductCard from "@/components/pos/ProductCard.vue";
|
|||||||
import SearchBox from "@/components/SearchBox.vue";
|
import SearchBox from "@/components/SearchBox.vue";
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
|
const { $numtoString } = useNuxtApp();
|
||||||
|
|
||||||
function openModal() {
|
function openModal() {
|
||||||
store.showmodal = {
|
store.showmodal = {
|
||||||
component: "pos/ProductSelection",
|
component: "pos/ProductSelection",
|
||||||
@@ -12,13 +14,17 @@ function openModal() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const customer = ref(null);
|
const record = ref({
|
||||||
const paymentMethod = ref(null);
|
customer: null,
|
||||||
|
paymentMethod: null,
|
||||||
|
});
|
||||||
|
const subtotal = computed(() => {
|
||||||
|
return store.selectedImeis.reduce((prev, curr) => prev + curr.variant__price, 0);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="card">
|
<div class="block">
|
||||||
<div class="card-content">
|
|
||||||
<button
|
<button
|
||||||
@click="openModal"
|
@click="openModal"
|
||||||
class="button is-primary"
|
class="button is-primary"
|
||||||
@@ -32,8 +38,7 @@ const paymentMethod = ref(null);
|
|||||||
<span>Chọn sản phẩm</span>
|
<span>Chọn sản phẩm</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="fixed-grid has-1-cols-mobile has-12-cols">
|
||||||
<div class="fixed-grid has-12-cols">
|
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<div class="cell is-col-span-8">
|
<div class="cell is-col-span-8">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@@ -46,7 +51,6 @@ const paymentMethod = ref(null);
|
|||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span>Giỏ hàng</span>
|
<span>Giỏ hàng</span>
|
||||||
<span>({{ store.selectedImeis.length }})</span>
|
|
||||||
</p>
|
</p>
|
||||||
<div
|
<div
|
||||||
v-if="store.selectedImeis.length > 0"
|
v-if="store.selectedImeis.length > 0"
|
||||||
@@ -86,7 +90,6 @@ const paymentMethod = ref(null);
|
|||||||
field: 'label',
|
field: 'label',
|
||||||
column: ['label'],
|
column: ['label'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
placeholder: 'Khách hàng',
|
placeholder: 'Khách hàng',
|
||||||
addon: {
|
addon: {
|
||||||
component: 'customer/CustomerQuickAdd',
|
component: 'customer/CustomerQuickAdd',
|
||||||
@@ -94,7 +97,7 @@ const paymentMethod = ref(null);
|
|||||||
height: 'auto',
|
height: 'auto',
|
||||||
title: 'Tạo khách hàng',
|
title: 'Tạo khách hàng',
|
||||||
},
|
},
|
||||||
onOption: (e) => (customer = e),
|
onOption: (e) => (record.customer = e),
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -118,14 +121,43 @@ const paymentMethod = ref(null);
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
placeholder: 'Phương thức thanh toán',
|
placeholder: 'Phương thức thanh toán',
|
||||||
onOption: (e) => (paymentMethod = e),
|
onOption: (e) => (record.paymentMethod = e),
|
||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card mb-3">
|
||||||
|
<div class="card-content">
|
||||||
|
<p class="icon-text fs-17 font-semibold mb-4">Tổng cộng</p>
|
||||||
|
<div>
|
||||||
|
<table class="table is-fullwidth fs-13">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<span>Tạm tính</span>
|
||||||
|
<span> ({{ store.selectedImeis.length }} sản phẩm)</span>
|
||||||
|
</td>
|
||||||
|
<td class="has-text-right">{{ $numtoString(subtotal, { hasUnit: true }) }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="font-bold fs-14">Tổng cộng</td>
|
||||||
|
<td class="has-text-right has-text-success-35 font-bold fs-17">
|
||||||
|
{{ $numtoString(subtotal, { hasUnit: true }) }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<button
|
||||||
|
class="button is-fullwidth is-success"
|
||||||
|
:disabled="!record.customer || !record.paymentMethod"
|
||||||
|
>
|
||||||
|
Thanh toán
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { remove } from "es-toolkit";
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
imei: Object,
|
imei: Object,
|
||||||
});
|
});
|
||||||
const { $copyToClipboard, $numtoString, $snackbar } = useNuxtApp();
|
const { $numtoString, $snackbar } = useNuxtApp();
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
function removeFromCart() {
|
function removeFromCart() {
|
||||||
remove(store.selectedImeis, (imeiRec) => imeiRec.id === props.imei.id);
|
remove(store.selectedImeis, (imeiRec) => imeiRec.id === props.imei.id);
|
||||||
@@ -14,7 +14,7 @@ function removeFromCart() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="card m-0">
|
<div class="card m-0">
|
||||||
<div class="card-content p-4 is-flex is-gap-3 is-justify-content-space-between is-align-items-center">
|
<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="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 m-0">
|
||||||
<div class="media-left">
|
<div class="media-left">
|
||||||
@@ -24,30 +24,16 @@ function removeFromCart() {
|
|||||||
</div>
|
</div>
|
||||||
<div class="media-content">
|
<div class="media-content">
|
||||||
<p class="font-bold fs-15">{{ imei.variant__product__name }}</p>
|
<p class="font-bold fs-15">{{ imei.variant__product__name }}</p>
|
||||||
<p class="fs-13">
|
<p class="fs-13 has-text-grey">
|
||||||
<span>{{ imei.variant__ram__code }}</span>
|
<span>{{ imei.variant__ram__code }}</span>
|
||||||
<span> • </span>
|
<span> • </span>
|
||||||
<span>{{ imei.variant__internal_storage__code }}</span>
|
<span>{{ imei.variant__internal_storage__code }}</span>
|
||||||
<span> • </span>
|
<span> • </span>
|
||||||
<span>{{ imei.variant__color__name }}</span>
|
<span>{{ imei.variant__color__name }}</span>
|
||||||
</p>
|
</p>
|
||||||
<div class="fs-13 is-flex is-gap-0.5 is-align-items-center">
|
|
||||||
<span class="is-family-monospace">IMEI: {{ imei.imei }}</span>
|
|
||||||
<button
|
|
||||||
class="button is-small size-7 p-0 is-primary is-light is-rounded"
|
|
||||||
@click="$copyToClipboard(imei.imei)"
|
|
||||||
>
|
|
||||||
<span class="icon">
|
|
||||||
<Icon
|
|
||||||
name="material-symbols:content-copy-outline-rounded"
|
|
||||||
:size="14"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<p class="has-text-primary-50 font-medium">{{ $numtoString(imei.variant__price, { hasUnit: true }) }}</p>
|
||||||
<p class="has-text-primary-50 font-semibold">{{ $numtoString(imei.variant__price, { hasUnit: true }) }}</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ function selected(api, chosen) {
|
|||||||
<div class="control">
|
<div class="control">
|
||||||
<input
|
<input
|
||||||
class="input"
|
class="input"
|
||||||
v-model.trim="filter.name"
|
v-model.trim="filter.product__name__icontains"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Tên"
|
placeholder="Tên"
|
||||||
/>
|
/>
|
||||||
@@ -34,7 +34,6 @@ function selected(api, chosen) {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: filter.os,
|
optionid: filter.os,
|
||||||
placeholder: 'OS',
|
placeholder: 'OS',
|
||||||
}"
|
}"
|
||||||
@@ -51,7 +50,6 @@ function selected(api, chosen) {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: filter.manufacturer,
|
optionid: filter.manufacturer,
|
||||||
placeholder: 'Hãng',
|
placeholder: 'Hãng',
|
||||||
}"
|
}"
|
||||||
@@ -68,7 +66,6 @@ function selected(api, chosen) {
|
|||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: filter.battery,
|
optionid: filter.battery,
|
||||||
placeholder: 'Pin',
|
placeholder: 'Pin',
|
||||||
}"
|
}"
|
||||||
@@ -85,7 +82,6 @@ function selected(api, chosen) {
|
|||||||
field: 'label',
|
field: 'label',
|
||||||
column: ['resolution', 'standard', 'technology'],
|
column: ['resolution', 'standard', 'technology'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: filter.screen,
|
optionid: filter.screen,
|
||||||
placeholder: 'Màn hình',
|
placeholder: 'Màn hình',
|
||||||
}"
|
}"
|
||||||
@@ -102,7 +98,6 @@ function selected(api, chosen) {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
placeholder: 'CPU',
|
placeholder: 'CPU',
|
||||||
optionid: filter.cpu,
|
optionid: filter.cpu,
|
||||||
}"
|
}"
|
||||||
@@ -119,7 +114,6 @@ function selected(api, chosen) {
|
|||||||
field: 'name',
|
field: 'name',
|
||||||
column: ['name'],
|
column: ['name'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: filter.gpu,
|
optionid: filter.gpu,
|
||||||
placeholder: 'GPU',
|
placeholder: 'GPU',
|
||||||
}"
|
}"
|
||||||
@@ -136,7 +130,6 @@ function selected(api, chosen) {
|
|||||||
field: 'code',
|
field: 'code',
|
||||||
column: ['code'],
|
column: ['code'],
|
||||||
first: true,
|
first: true,
|
||||||
clearable: true,
|
|
||||||
optionid: filter.external_storage,
|
optionid: filter.external_storage,
|
||||||
placeholder: 'Bộ nhớ ngoài',
|
placeholder: 'Bộ nhớ ngoài',
|
||||||
position: 'is-top-right',
|
position: 'is-top-right',
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<p
|
<p
|
||||||
v-html="content"
|
v-html="content"
|
||||||
class="control is-expanded"
|
class="control is-expanded fs-14"
|
||||||
></p>
|
></p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<p v-html="props.content"></p>
|
<p
|
||||||
|
v-html="props.content"
|
||||||
|
class="fs-14"
|
||||||
|
></p>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ setTimeout(() => store.commit("snackbar", undefined), 3900);
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="snackbar is-flex is-align-items-center is-gap-3 pl-3 pr-1.5 py-2 rounded-md has-text-white">
|
<div
|
||||||
|
class="snackbar is-flex is-justify-content-space-between is-align-items-center is-gap-3 pl-3 pr-1.5 py-2 rounded-md has-text-white"
|
||||||
|
>
|
||||||
<Info
|
<Info
|
||||||
v-if="component === 'Info'"
|
v-if="component === 'Info'"
|
||||||
v-bind="vbind"
|
v-bind="vbind"
|
||||||
@@ -47,13 +49,13 @@ setTimeout(() => store.commit("snackbar", undefined), 3900);
|
|||||||
.snackbar {
|
.snackbar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
top: 50px;
|
top: 40px;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
margin-inline: auto;
|
margin-inline: auto;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
max-width: 500px;
|
max-width: min(500px, 90vw);
|
||||||
background-color: hsl(from var(--bulma-grey-darker) h s l / 0.9);
|
background-color: hsl(from var(--bulma-grey-darker) h s l / 0.85);
|
||||||
}
|
}
|
||||||
|
|
||||||
.button.is-ghost {
|
.button.is-ghost {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<p
|
<p
|
||||||
v-html="content"
|
v-html="content"
|
||||||
class="control is-expanded"
|
class="control is-expanded fs-14"
|
||||||
></p>
|
></p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||||||
$store.commit("snackbar", {
|
$store.commit("snackbar", {
|
||||||
component,
|
component,
|
||||||
vbind: {
|
vbind: {
|
||||||
content: typeof content == "string" ? content : JSON.stringify(content),
|
content: typeof content === "string" ? content : JSON.stringify(content),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -190,7 +190,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const copyToClipboard = function (text) {
|
const copyToClipboard = function (text) {
|
||||||
snackbar("Copied to clipboard");
|
snackbar("Copied to clipboard", "Success");
|
||||||
if (window.clipboardData && window.clipboardData.setData) {
|
if (window.clipboardData && window.clipboardData.setData) {
|
||||||
// IE specific code path to prevent textarea being shown while dialog is visible.
|
// IE specific code path to prevent textarea being shown while dialog is visible.
|
||||||
return clipboardData.setData("Text", text);
|
return clipboardData.setData("Text", text);
|
||||||
@@ -296,8 +296,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const download = async function (url, fileName) {
|
const download = async function (url, fileName) {
|
||||||
let name = dayjs(new Date()).format("YYYYMMDDhhmmss") + "-" + fileName;
|
const name = dayjs(new Date()).format("YYYYMMDDhhmmss") + "-" + fileName;
|
||||||
const response = await fetch(url, { method: "GET" });
|
const response = await fetch(url);
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
const urlDownload = window.URL.createObjectURL(blob);
|
const urlDownload = window.URL.createObjectURL(blob);
|
||||||
const link = document.createElement("a");
|
const link = document.createElement("a");
|
||||||
|
|||||||
@@ -1516,9 +1516,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await $fetch(url.toString(), {
|
const response = await $fetch(url.toString());
|
||||||
method: "GET",
|
|
||||||
});
|
|
||||||
|
|
||||||
if (response && response.pdf) {
|
if (response && response.pdf) {
|
||||||
const pdfUrl = `${apiBaseUrl}static/contract/${response.pdf}`;
|
const pdfUrl = `${apiBaseUrl}static/contract/${response.pdf}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user