| @@ -65,6 +65,7 @@ | |||
| "vue3-datepicker": "^0.4.0", | |||
| "vue3-google-map": "^0.18.0", | |||
| "vue3-persian-datetime-picker": "^1.2.2", | |||
| "vue3-select-component": "^0.11.3", | |||
| "vue3-select2-component": "^0.1.7", | |||
| "vue3-toastify": "^0.2.5", | |||
| "vuex": "^4.1.0", | |||
| @@ -13697,6 +13698,15 @@ | |||
| "moment-jalaali": "^0.9.4" | |||
| } | |||
| }, | |||
| "node_modules/vue3-select-component": { | |||
| "version": "0.11.3", | |||
| "resolved": "https://registry.npmjs.org/vue3-select-component/-/vue3-select-component-0.11.3.tgz", | |||
| "integrity": "sha512-Tw2iBpwONIhasPm3UrQ9o6bvUWPhAVPHGiYtGB0e9nXLcqESDx5LxG3k4+55n9FF0jFoKRji1UdCNt1dsJkxbw==", | |||
| "license": "MIT", | |||
| "peerDependencies": { | |||
| "vue": "^3.5.0" | |||
| } | |||
| }, | |||
| "node_modules/vue3-select2-component": { | |||
| "version": "0.1.7", | |||
| "resolved": "https://registry.npmjs.org/vue3-select2-component/-/vue3-select2-component-0.1.7.tgz", | |||
| @@ -65,6 +65,7 @@ | |||
| "vue3-datepicker": "^0.4.0", | |||
| "vue3-google-map": "^0.18.0", | |||
| "vue3-persian-datetime-picker": "^1.2.2", | |||
| "vue3-select-component": "^0.11.3", | |||
| "vue3-select2-component": "^0.1.7", | |||
| "vue3-toastify": "^0.2.5", | |||
| "vuex": "^4.1.0", | |||
| @@ -209,8 +209,8 @@ export default { | |||
| }, 500); | |||
| }) | |||
| .catch((error) => { | |||
| console.error(error); | |||
| toast.error("!افزودن کاربر با مشکل مواجه شد", { | |||
| console.error(error.response.data.message); | |||
| toast.error(`${error.response.data.message}` , { | |||
| position: "top-right", | |||
| autoClose: 1000, | |||
| }); | |||
| @@ -196,7 +196,7 @@ export default { | |||
| }) | |||
| .catch((error) => { | |||
| console.error(error); | |||
| toast.success("!مشکلی در ویرایش ویژگی پیش آمد", { | |||
| toast.error("!مشکلی در ویرایش ویژگی پیش آمد", { | |||
| position: "top-right", | |||
| autoClose: 1000, | |||
| }); | |||
| @@ -1,13 +1,13 @@ | |||
| <template> | |||
| <div | |||
| class="modal fade" | |||
| id="showDescription" | |||
| tabindex="-1" | |||
| role="dialog" | |||
| aria-labelledby="exampleModalLabel" | |||
| aria-hidden="true" | |||
| :inert="localDesc" | |||
| > | |||
| <div | |||
| class="modal fade" | |||
| id="showDescription" | |||
| tabindex="-1" | |||
| role="dialog" | |||
| aria-labelledby="exampleModalLabel" | |||
| aria-hidden="true" | |||
| > | |||
| <div class="modal-dialog modal-lg" role="document"> | |||
| <div class="modal-content"> | |||
| <div class="modal-header"> | |||
| @@ -241,7 +241,7 @@ export default { | |||
| <td>{{ convertToJalali(attribute?.created_at) }}</td> | |||
| <td> | |||
| <button | |||
| <!-- <button | |||
| @click=" | |||
| editModalData( | |||
| attribute?.id, | |||
| @@ -254,7 +254,7 @@ export default { | |||
| class="btn btn-sm btn-outline-warning me-1" | |||
| > | |||
| ویرایش | |||
| </button> | |||
| </button> --> | |||
| <button | |||
| @click="deleteAttribute(attribute.id, attribute.title)" | |||
| class="btn btn-sm btn-outline-danger" | |||
| @@ -183,12 +183,11 @@ | |||
| > | |||
| <label for="token">صفحه محصول</label> | |||
| <Select2 | |||
| id="token" | |||
| <VueSelect | |||
| style="--vs-min-height: 48px; --vs-border-radius: 8px ; margin-top: 7px;" | |||
| v-model="selectedLandingProduct" | |||
| :options="formattedUsers" | |||
| :settings="{ settingOption: value, settingOption: value }" | |||
| style="height: 60px" | |||
| :options="formattedProducts" | |||
| placeholder="محصولی را انتخاب کنید" | |||
| /> | |||
| <small v-if="errors.selectedLandingProduct" class="text-danger"> | |||
| {{ errors.selectedLandingProduct }} | |||
| @@ -384,7 +383,7 @@ | |||
| </template> | |||
| <script> | |||
| import Select2 from "vue3-select2-component"; | |||
| import VueSelect from "vue3-select-component"; | |||
| import catBanner from "@/components/modals/helperModals/catBanner.vue"; | |||
| import mainPageBanner from "@/components/modals/helperModals/mainPageBanner.vue"; | |||
| import { toast } from "vue3-toastify"; | |||
| @@ -399,7 +398,7 @@ export default { | |||
| Layout, | |||
| mainPageBanner, | |||
| catBanner, | |||
| Select2, | |||
| VueSelect, | |||
| }, | |||
| setup() { | |||
| const title = ref(); | |||
| @@ -467,10 +466,10 @@ export default { | |||
| } | |||
| }; | |||
| const formattedUsers = computed(() => { | |||
| const formattedProducts = computed(() => { | |||
| return products.value.map((product) => ({ | |||
| id: product.id, | |||
| text: product.title, | |||
| value: product.id, | |||
| label: product.title, | |||
| })); | |||
| }); | |||
| @@ -558,7 +557,6 @@ export default { | |||
| if (pannel.value === "wholesale") { | |||
| formData.append("type", "slider"); | |||
| formData.append("location", "A"); | |||
| console.log("test") | |||
| } | |||
| if (selectedLoc.value) { | |||
| @@ -602,7 +600,7 @@ export default { | |||
| submitForm, | |||
| clearError, | |||
| pageType, | |||
| formattedUsers, | |||
| formattedProducts, | |||
| landingType, | |||
| selectedLandingCat, | |||
| selectedLandingProduct, | |||
| @@ -251,7 +251,7 @@ export default { | |||
| type="button" | |||
| data-bs-toggle="modal" | |||
| data-bs-target="#showDescription" | |||
| @click="descriptionModal(call.text)" | |||
| @click="descriptionModal(banner.title)" | |||
| class="subject-box" | |||
| aria-haspopup="dialog" | |||
| aria-controls="showDescription" | |||
| @@ -158,12 +158,15 @@ | |||
| > | |||
| <label for="token">صفحه محصول</label> | |||
| <Select2 | |||
| id="token" | |||
| <VueSelect | |||
| style=" | |||
| --vs-min-height: 48px; | |||
| --vs-border-radius: 8px; | |||
| margin-top: 7px; | |||
| " | |||
| v-model="selectedLandingProduct" | |||
| :options="formattedUsers" | |||
| :settings="{ settingOption: value, settingOption: value }" | |||
| style="height: 60px" | |||
| :options="formattedProducts" | |||
| placeholder="محصولی را انتخاب کنید" | |||
| /> | |||
| <small v-if="errors.selectedLandingProduct" class="text-danger"> | |||
| {{ errors.selectedLandingProduct }} | |||
| @@ -359,8 +362,8 @@ | |||
| </template> | |||
| <script> | |||
| import VueSelect from "vue3-select-component"; | |||
| import { useRoute } from "vue-router"; | |||
| import Select2 from "vue3-select2-component"; | |||
| import catBanner from "@/components/modals/helperModals/catBanner.vue"; | |||
| import mainPageBanner from "@/components/modals/helperModals/mainPageBanner.vue"; | |||
| import { toast } from "vue3-toastify"; | |||
| @@ -375,7 +378,7 @@ export default { | |||
| Layout, | |||
| mainPageBanner, | |||
| catBanner, | |||
| Select2, | |||
| VueSelect, | |||
| }, | |||
| setup() { | |||
| const route = useRoute(); | |||
| @@ -443,10 +446,10 @@ export default { | |||
| } | |||
| }; | |||
| const formattedUsers = computed(() => { | |||
| const formattedProducts = computed(() => { | |||
| return products.value.map((product) => ({ | |||
| id: product.id, | |||
| text: product.title, | |||
| value: product.id, | |||
| label: product.title, | |||
| })); | |||
| }); | |||
| @@ -491,7 +494,7 @@ export default { | |||
| selectedLoc.value = data?.location; | |||
| selectedLandingCat.value = data?.category_id; | |||
| selectedLandingProduct.value = data?.product_id; | |||
| pageType.value = data.page_type | |||
| pageType.value = data.page_type; | |||
| if (data.page_id) { | |||
| pageType.value = "category"; | |||
| selectedCatPage.value = data?.page_id; | |||
| @@ -609,7 +612,7 @@ export default { | |||
| submitForm, | |||
| clearError, | |||
| pageType, | |||
| formattedUsers, | |||
| formattedProducts, | |||
| landingType, | |||
| selectedLandingCat, | |||
| selectedLandingProduct, | |||
| @@ -141,14 +141,15 @@ | |||
| class="mt-3" | |||
| style="margin-top: 30px" | |||
| > | |||
| <label for="token"> انتخاب محصول </label> | |||
| <label for="token" style="margin-bottom: 5px"> | |||
| انتخاب محصول | |||
| </label> | |||
| <Select2 | |||
| id="token" | |||
| <VueSelect | |||
| style="--vs-min-height: 48px; --vs-border-radius: 8px" | |||
| v-model="selectedProduct" | |||
| :options="formattedProducts" | |||
| :settings="{ settingOption: value, settingOption: value }" | |||
| style="height: 60px" | |||
| placeholder="محصولی را انتخاب کنید" | |||
| /> | |||
| <small v-if="errors.selectedProduct" class="text-danger"> | |||
| {{ errors.selectedProduct }} | |||
| @@ -163,7 +164,6 @@ | |||
| :format="'jYYYY/jMM/jDD HH:mm:ss'" | |||
| type="datetime" | |||
| v-model="startDate" | |||
| @input="handleStartDateInput" | |||
| ></DatePicker> | |||
| </div> | |||
| <small v-if="errors.startDate" class="text-danger"> | |||
| @@ -179,7 +179,6 @@ | |||
| :format="'jYYYY/jMM/jDD HH:mm:ss'" | |||
| type="datetime" | |||
| v-model="expire" | |||
| @input="handleExpireDateInput" | |||
| ></DatePicker> | |||
| </div> | |||
| <small v-if="errors.expire" class="text-danger"> | |||
| @@ -212,8 +211,8 @@ | |||
| </template> | |||
| <script> | |||
| import Select2 from "vue3-select2-component"; | |||
| import moment from "moment"; | |||
| import VueSelect from "vue3-select-component"; | |||
| import moment from "moment-jalaali"; | |||
| import { toast } from "vue3-toastify"; | |||
| import "vue3-toastify/dist/index.css"; | |||
| import ApiServiece from "@/services/ApiService"; | |||
| @@ -226,7 +225,8 @@ export default { | |||
| components: { | |||
| Layout, | |||
| DatePicker, | |||
| Select2, | |||
| VueSelect, | |||
| }, | |||
| setup() { | |||
| const title = ref(); | |||
| @@ -264,31 +264,10 @@ export default { | |||
| }); | |||
| }; | |||
| const handleStartDateInput = () => { | |||
| if (startDate.value) { | |||
| startDate.value = moment( | |||
| startDate.value, | |||
| "jYYYY/jMM/jDD HH:mm:ss" | |||
| ).format("YYYY-MM-DD HH:mm:ss"); | |||
| } else { | |||
| clearError("startDate"); | |||
| } | |||
| }; | |||
| const handleExpireDateInput = () => { | |||
| if (expire.value) { | |||
| expire.value = moment(expire.value, "jYYYY/jMM/jDD HH:mm:ss").format( | |||
| "YYYY-MM-DD HH:mm:ss" | |||
| ); | |||
| } else { | |||
| clearError("expire"); | |||
| } | |||
| }; | |||
| const formattedProducts = computed(() => { | |||
| return products.value.map((product) => ({ | |||
| id: product.id, | |||
| text: product.title, | |||
| value: product.id, | |||
| label: product.title, | |||
| })); | |||
| }); | |||
| @@ -331,7 +310,16 @@ export default { | |||
| getProduct(); | |||
| }); | |||
| function convertJalaliToGregorian(jalaliDate) { | |||
| return moment(jalaliDate, "jYYYY/jMM/jDD HH:mm:ss").format( | |||
| "YYYY-MM-DD HH:mm:ss" | |||
| ); | |||
| } | |||
| const submitForm = () => { | |||
| startDate.value = convertJalaliToGregorian(startDate.value); | |||
| expire.value = convertJalaliToGregorian(expire.value); | |||
| if (!validateForm()) { | |||
| toast.error("لطفا فیلد های لازم را وارد نمایید", { | |||
| position: "top-right", | |||
| @@ -390,8 +378,6 @@ export default { | |||
| expire, | |||
| maxUsage, | |||
| submitForm, | |||
| handleStartDateInput, | |||
| handleExpireDateInput, | |||
| whichPart, | |||
| clearError, | |||
| loading, | |||
| @@ -448,4 +434,6 @@ export default { | |||
| .delete-btn:focus { | |||
| outline: none; | |||
| } | |||
| .custom-select { | |||
| } | |||
| </style> | |||
| @@ -390,7 +390,7 @@ export default { | |||
| ApiServiece.post(`/admin/discounts`, formData) | |||
| .then((resp) => { | |||
| loading.value = false; | |||
| toast.success("!تخفیف با موفقیت اضافه شد", { | |||
| toast.success("!تخفیف با موفقیت ویرایش شد", { | |||
| position: "top-right", | |||
| autoClose: 1000, | |||
| }); | |||
| @@ -3,13 +3,13 @@ import Layout from "@/layout/custom.vue"; | |||
| import ApiServiece from "@/services/ApiService"; | |||
| import { onMounted, ref, watch, computed } from "vue"; | |||
| import DatePicker from "vue3-persian-datetime-picker"; | |||
| import Select2 from "vue3-select2-component"; | |||
| import VueSelect from "vue3-select-component"; | |||
| import moment from "jalali-moment"; | |||
| export default { | |||
| name: "PRODUCT-LIST", | |||
| components: { | |||
| Layout, | |||
| Select2, | |||
| VueSelect, | |||
| DatePicker, | |||
| }, | |||
| setup() { | |||
| @@ -61,10 +61,10 @@ export default { | |||
| .format("YYYY/MM/DD"); | |||
| }; | |||
| const formattedUsers = computed(() => { | |||
| const formattedBrands = computed(() => { | |||
| return brands.value.map((brand) => ({ | |||
| id: brand?.id, | |||
| text: brand?.title, | |||
| value: brand?.id, | |||
| label: brand?.title, | |||
| })); | |||
| }); | |||
| @@ -181,7 +181,7 @@ export default { | |||
| convertToJalali, | |||
| searchPage, | |||
| brands, | |||
| formattedUsers, | |||
| formattedBrands, | |||
| selectedBrand, | |||
| date, | |||
| isLoading, | |||
| @@ -201,17 +201,13 @@ export default { | |||
| <!-- Button to Trigger Export --> | |||
| <BRow> | |||
| <BCol sm="3" class="mt-3"> | |||
| <Select2 | |||
| id="token" | |||
| <VueSelect | |||
| style="--vs-border-radius: 8px" | |||
| v-model="selectedBrand" | |||
| :options="formattedUsers" | |||
| :settings="{ | |||
| placeholder: 'انتخاب برند', | |||
| dir: 'rtl', | |||
| width: '100%', | |||
| theme: 'classic', | |||
| }" | |||
| class="select2 custom-select2" | |||
| :options="formattedBrands" | |||
| placeholder="انتخاب برند" | |||
| /> | |||
| </BCol> | |||
| <BCol style="margin-right: 180px" class="mt-3" sm="3"> | |||
| @@ -291,7 +287,9 @@ export default { | |||
| v-if="product?.product?.wholesale_price" | |||
| class="text-end" | |||
| > | |||
| {{ formatWithCommas(product?.product?.wholesale_price) }}تومان | |||
| {{ | |||
| formatWithCommas(product?.product?.wholesale_price) | |||
| }}تومان | |||
| </td> | |||
| <td | |||
| v-if="!product?.product?.wholesale_price" | |||
| @@ -146,7 +146,7 @@ export default { | |||
| formData.append("status", status); | |||
| ApiServiece.put(`admin/orders/${id}`, formData) | |||
| .then(() => { | |||
| toast.success("!تغییر وضعیت سبد خرید با موفقیت انجام شد", { | |||
| toast.success("تغییر وضعیت سبد خرید با موفقیت انجام شد", { | |||
| position: "top-right", | |||
| autoClose: 3000, | |||
| }); | |||
| @@ -941,6 +941,7 @@ export default { | |||
| .catch((error) => { | |||
| console.error(error); | |||
| loading.value = false; | |||
| toast.error(`${error?.response?.data?.message}`, { | |||
| position: "top-right", | |||
| autoClose: 1000, | |||
| @@ -190,7 +190,7 @@ export default { | |||
| searchPage, | |||
| visiblePages, | |||
| restoreProduct, | |||
| formatWithCommas | |||
| formatWithCommas, | |||
| }; | |||
| }, | |||
| }; | |||
| @@ -232,9 +232,9 @@ export default { | |||
| <td>برگزیده</td> | |||
| <td>قیمت انتخاب شده</td> | |||
| <td>ویژه</td> | |||
| <td>قیمت</td> | |||
| <td>قیمت عمده</td> | |||
| <td>قیمت تک</td> | |||
| <td>وضعیت</td> | |||
| <th>تاریخ ایجاد</th> | |||
| <th>عملیات</th> | |||
| </tr> | |||
| </thead> | |||
| @@ -291,9 +291,11 @@ export default { | |||
| <td v-if="product?.wholesale_price"> | |||
| {{ formatWithCommas(product.wholesale_price) }} | |||
| </td> | |||
| <td v-if="!product?.wholesale_price">ندارد</td> | |||
| <td v-if="product?.retail_price"> | |||
| {{ formatWithCommas(product?.retail_price) }} | |||
| </td> | |||
| <td v-if="!product?.retail_price">ندارد</td> | |||
| <td v-if="!product.deleted_at"> | |||
| <span class="badge bg-success text-white">فعال</span> | |||
| @@ -302,7 +304,6 @@ export default { | |||
| <span class="badge bg-danger text-white">حذف شده</span> | |||
| </td> | |||
| <td>{{ convertToJalali(product?.created_at) }}</td> | |||
| <td> | |||
| <router-link | |||
| :to="`/editProduct/${product?.id}`" | |||
| @@ -259,7 +259,6 @@ export default { | |||
| <thead> | |||
| <tr> | |||
| <th>نام</th> | |||
| <th>موبایل</th> | |||
| <th>نقش</th> | |||
| <th>تاریخ ایجاد</th> | |||