feat(admin-panel): responsive branches, workshops, products and orders
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
syntax becomes Vue 3 named slots.
|
||||
-->
|
||||
<div id="page-user-list">
|
||||
<a-card :title="is_branch ? 'لیست سفارش' : 'لیست سفارش های تک فروشی'">
|
||||
<XTable ref="tbl" :model="model">
|
||||
<a-card :title="is_branch ? 'لیست سفارش' : 'لیست سفارش های تک فروشی'" class="page-card">
|
||||
<XTable ref="tbl" :model="model" mobile-cards>
|
||||
<template #opt="{ record }">
|
||||
<div class="flex">
|
||||
<TooltipBtn
|
||||
@@ -51,7 +51,7 @@
|
||||
</XTable>
|
||||
|
||||
<!-- وضعیت سفارش -->
|
||||
<a-modal v-model:open="visibleSts" title="وضعیت سفارش">
|
||||
<a-modal v-model:open="visibleSts" title="وضعیت سفارش" wrap-class-name="detail-modal">
|
||||
<a-timeline v-if="tempRow">
|
||||
<a-timeline-item
|
||||
v-for="(item, index) in tempRow.activity"
|
||||
@@ -93,7 +93,7 @@
|
||||
</a-modal>
|
||||
|
||||
<!-- مشاهده سفارش -->
|
||||
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%">
|
||||
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%" wrap-class-name="detail-modal">
|
||||
<div v-if="tempRow">
|
||||
<a-descriptions>
|
||||
<a-descriptions-item label="مشتری">
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
delete action and the report link are COMMENTED OUT in legacy and stay absent.
|
||||
-->
|
||||
<div id="page-user-list">
|
||||
<a-card title="سفارش های ساختنی">
|
||||
<XTable ref="tbl" :model="model">
|
||||
<a-card title="سفارش های ساختنی" class="page-card">
|
||||
<XTable ref="tbl" :model="model" mobile-cards>
|
||||
<template #name="{ record }">
|
||||
{{ record.customer?.name }}
|
||||
</template>
|
||||
@@ -41,6 +41,7 @@
|
||||
v-model:open="visibleList"
|
||||
title="مشاهده سفارش"
|
||||
width="80%"
|
||||
wrap-class-name="detail-modal"
|
||||
@cancel="onCloseDetail"
|
||||
>
|
||||
<div v-if="tempRow">
|
||||
@@ -69,7 +70,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="flex gap-8">
|
||||
<div class="flex gap-8 make-detail">
|
||||
<div>
|
||||
<img
|
||||
v-if="tempRow.designImageUrl"
|
||||
@@ -220,4 +221,14 @@ function onCloseDetail() {
|
||||
.mr-3 {
|
||||
margin-left: 0.75rem;
|
||||
}
|
||||
|
||||
@media (max-width: 575px) {
|
||||
.make-detail {
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
.make-detail > .flex {
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
report endpoint directly) but now points at the new API.
|
||||
-->
|
||||
<div id="page-user-list">
|
||||
<a-card title="لیست سفارش های عمده">
|
||||
<XTable ref="tbl" :model="model">
|
||||
<a-card title="لیست سفارش های عمده" class="page-card">
|
||||
<XTable ref="tbl" :model="model" mobile-cards>
|
||||
<template #city="{ text }">
|
||||
<div v-if="text">{{ getCity(text) }}</div>
|
||||
<div v-else>-</div>
|
||||
@@ -55,7 +55,7 @@
|
||||
</XTable>
|
||||
|
||||
<!-- وضعیت سفارش -->
|
||||
<a-modal v-model:open="visibleSts" title="وضعیت سفارش">
|
||||
<a-modal v-model:open="visibleSts" title="وضعیت سفارش" wrap-class-name="detail-modal">
|
||||
<a-timeline v-if="tempRow">
|
||||
<a-timeline-item
|
||||
v-for="(item, index) in tempRow.activity"
|
||||
@@ -97,7 +97,7 @@
|
||||
</a-modal>
|
||||
|
||||
<!-- مشاهده سفارش -->
|
||||
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%">
|
||||
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%" wrap-class-name="detail-modal">
|
||||
<div v-if="tempRow">
|
||||
<a-descriptions>
|
||||
<a-descriptions-item label="مشتری">
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
the legacy markup but is COMMENTED OUT — preserved as absent, not re-added.
|
||||
-->
|
||||
<div id="page-user-list">
|
||||
<a-card title="لیست سفارش های عمده">
|
||||
<XTable ref="tbl" :model="model">
|
||||
<a-card title="لیست سفارش های عمده" class="page-card">
|
||||
<XTable ref="tbl" :model="model" mobile-cards>
|
||||
<template #opt="{ record }">
|
||||
<div class="flex">
|
||||
<TooltipBtn
|
||||
@@ -42,7 +42,7 @@
|
||||
</XTable>
|
||||
|
||||
<!-- وضعیت سفارش -->
|
||||
<a-modal v-model:open="visibleSts" title="وضعیت سفارش">
|
||||
<a-modal v-model:open="visibleSts" title="وضعیت سفارش" wrap-class-name="detail-modal">
|
||||
<a-timeline v-if="tempRow">
|
||||
<a-timeline-item
|
||||
v-for="(item, index) in tempRow.activity"
|
||||
@@ -84,7 +84,7 @@
|
||||
</a-modal>
|
||||
|
||||
<!-- مشاهده سفارش -->
|
||||
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%">
|
||||
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%" wrap-class-name="detail-modal">
|
||||
<div v-if="tempRow">
|
||||
<a-descriptions>
|
||||
<a-descriptions-item label="مشتری">
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
inventing a Rial figure — see docs/ADMIN-PORT-PLAN.md.
|
||||
-->
|
||||
<a-spin v-if="hasPermission('order.create')" :spinning="loading">
|
||||
<a-card title="لیست محصولات">
|
||||
<XTable ref="tblProducts" :model="cols">
|
||||
<a-card title="لیست محصولات" class="page-card">
|
||||
<XTable ref="tblProducts" :model="cols" mobile-cards>
|
||||
<template #image="{ record }">
|
||||
<img
|
||||
width="90px"
|
||||
@@ -42,7 +42,15 @@
|
||||
</XTable>
|
||||
|
||||
<a-card v-if="items.length > 0" title="ثبت سفارش" class="mt-5">
|
||||
<a-table :columns="columns" :data-source="items" bordered :pagination="false" row-key="vid">
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="items"
|
||||
bordered
|
||||
:pagination="false"
|
||||
row-key="vid"
|
||||
:size="layout.isMobile ? 'small' : 'middle'"
|
||||
:scroll="layout.isSmallScreen ? { x: 'max-content' } : undefined"
|
||||
>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'delete'">
|
||||
<CloseOutlined class="cursor-pointer" @click="cart.remove(record)" />
|
||||
@@ -170,7 +178,7 @@
|
||||
|
||||
<a-button
|
||||
type="primary"
|
||||
class="mt-4"
|
||||
class="mt-4 form-submit"
|
||||
:disabled="!items || items.length < 1"
|
||||
@click="submitOrder"
|
||||
>
|
||||
@@ -197,9 +205,11 @@ import { buildProductListModel } from '../apps/product/productListModel';
|
||||
import { useCartStore, type CartItem, type CartVariant } from '../../stores/cart';
|
||||
import { useUsersStore } from '../../stores/users';
|
||||
import { useAuthStore } from '../../stores/auth';
|
||||
import { useLayoutStore } from '../../stores/layout';
|
||||
import api from '../../api/client';
|
||||
|
||||
const router = useRouter();
|
||||
const layout = useLayoutStore();
|
||||
const users = useUsersStore();
|
||||
const auth = useAuthStore();
|
||||
const cart = useCartStore();
|
||||
@@ -421,4 +431,24 @@ onMounted(async () => {
|
||||
.totals {
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
@media (max-width: 575px) {
|
||||
.grid-5 {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
column-gap: 12px;
|
||||
row-gap: 0;
|
||||
}
|
||||
.grid-5 > :first-child {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
.mt-5 {
|
||||
margin-top: 12px;
|
||||
}
|
||||
.mt-4 {
|
||||
margin-top: 12px;
|
||||
}
|
||||
.totals {
|
||||
margin: 0 0 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user