Merge dev into main
Brings main up to date with dev: the issues triage (favourites, ledger debt, making-charge formula and «اجرت» screen, order ban, cities tree, permissions, birth date, unused-code removal, production safety checks) and release/delivery's IAM single sign-on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
---
|
||||
description: اتصال ورود ادمین به سامانه هویت متمرکز (IAM) — مرزها و قواعدی که نباید شکسته شوند
|
||||
globs:
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# اتصال به سامانه هویت متمرکز (Central IAM)
|
||||
|
||||
مستندها:
|
||||
- `docs/iam-connection.md` — **نحوه ارتباط**: سه کانال داده و رفتار در خطا
|
||||
- `docs/iam-sso.md` — پیکربندی، ورود مشترک با همکار، ابطال نشست
|
||||
- مرجع تصویری اندپوینتهای IAM: `<IAM>/docs` (Scalar)
|
||||
|
||||
## اصل غیرقابلمذاکره
|
||||
|
||||
این قابلیت **افزایشی** است. با `IAM_ENABLED=false` (پیشفرض) سامانه باید دقیقاً
|
||||
مثل قبل رفتار کند: یک `bcrypt.compare` محلی و هیچ درخواست شبکهای.
|
||||
|
||||
- فرم ورود عوض نمیشود. پاسخ ورود همان `api_token` قبلی است، بهاضافهٔ
|
||||
`iamBootstrapUrl` فقط وقتی IAM بلیت مرورگر داده باشد.
|
||||
- وقتی IAM روشن است و `IAM_ADMIN_REDIRECT_URI` (یا یکی از
|
||||
`IAM_ADMIN_REDIRECT_URIS`) با آدرس خودِ پنل یکی است، بار اول بدون توکن یک
|
||||
پرش `prompt=none` به `/auth/iam/callback` میرود. اپ کاربر همین کار را با
|
||||
`IAM_REDIRECT_URI` و `IAM_REDIRECT_URIS` میکند. آدرس ناشناس جایگزین آدرس
|
||||
ثبتشده نمیشود و پاسخ `enabled: false` میماند.
|
||||
- IAM خاموش، یا redirect ادمین خالی، یعنی این پرش شروع نمیشود و خروج آدرس
|
||||
مرکزی برنمیگرداند.
|
||||
|
||||
## نقشه فایلها
|
||||
|
||||
| مسیر | نقش |
|
||||
| --- | --- |
|
||||
| `apps/api/src/modules/iam/iam.service.ts` | ارتباط با IAM و نگاشت خطاها |
|
||||
| `apps/api/src/modules/iam/iam.module.ts` | ماژول Global (بیاثر تا زمان روشن شدن) |
|
||||
| `apps/api/src/modules/auth/auth.service.ts` | متد `verifyPassword` — تنها نقطه اتصال ورود |
|
||||
| `apps/api/src/modules/sessions/admin-session.service.ts` | نشستهای قابل ابطال (`jti`) |
|
||||
| `apps/api/src/modules/iam/iam-logout.service.ts` | تأیید توکن خروج سراسری (JWKS، RS256) |
|
||||
| `apps/api/src/modules/iam/iam.controller.ts` | `POST /api/iam/backchannel-logout` |
|
||||
|
||||
## قواعد سخت
|
||||
|
||||
1. **هر نتیجه مبهم باید به `bcrypt` محلی برگردد.** سرویس در دسترس نیست، کاربر
|
||||
آنجا نیست، یا ۴۲۹ گرفتیم ⇒ رمز محلی بررسی شود. فقط `exclusive` اجازه رد
|
||||
کردن دارد. خرابی IAM هرگز نباید ادمینها را بیرون بیندازد.
|
||||
|
||||
2. **حساب قفلشده، «نتیجه قطعی» است نه خطا.** `account_locked` نباید به
|
||||
`bcrypt` محلی برگردد وگرنه قفلِ IAM بیاثر میشود.
|
||||
|
||||
3. **`client_ip` همیشه فرستاده میشود.** بدون آن، محدودیت نرخِ IAM روی IP همین
|
||||
سرور اعمال میشود و بعد از چند ورود کل پنل ادمین ۴۲۹ میگیرد. اگر API پشت
|
||||
پراکسی رفت، `trust proxy` را تنظیم کن وگرنه `@Ip()` همیشه IP پراکسی است.
|
||||
|
||||
4. **هیچ جدول موجودی تغییر نمیکند.** نگاشت کاربر با همان `mobile` انجام میشود و
|
||||
`iamSub`/`iamSessionId` روی جدول **جدید** `AdminSession` مینشینند، نه روی
|
||||
`AdminUser`. اگر روزی چیزی از IAM لازم شد، همین الگو را نگه دار.
|
||||
|
||||
5. **ابطال نشست دو شرط دارد و هر دو لازم است:** توکن باید `jti` داشته باشد و ردیف
|
||||
`AdminSession` باید موجود و باطلنشده باشد. با خاموش بودن ردیابی
|
||||
(`AUTH_SESSION_TRACKING=false` یا IAM خاموش) نه `jti` صادر میشود، نه کوئری
|
||||
اضافهای در مسیر احراز هویت اجرا میشود — یعنی دقیقاً رفتار و هزینه قبلی.
|
||||
توکن بدون `jti` هرگز نباید رد شود، وگرنه روشن کردن این کلید همه را بیرون میاندازد.
|
||||
|
||||
6. **اندپوینت خروج سراسری بدون احراز هویت است و باید بماند.** اعتبارش از امضای
|
||||
`logout_token` میآید: `iss`، `aud`، `events`، نبودن `nonce` و `exp` همه بررسی
|
||||
میشوند. هیچیک از این بررسیها را برای «راحتی تست» حذف نکن. پاسخ همیشه ۲۰۰ است
|
||||
تا IdP بینهایت تلاش مجدد نکند؛ دلیل رد شدن فقط لاگ میشود.
|
||||
|
||||
7. **فرم ورود این پنل مرحله «ورود کد» ندارد**، پس حساب دو مرحلهای در IAM از این
|
||||
مسیر قابل تکمیل نیست و با پیام روشن رد میشود. تا وقتی آن مرحله ساخته نشده،
|
||||
تلاش برای تکمیل 2FA در بکاند بیمعناست.
|
||||
|
||||
8. **ورود اپ کاربر رمز ندارد**، پس از `verifyCredentials` استفاده نمیشود؛ بعد از
|
||||
بررسی موفق کد، `IamService.attestOtpLogin` فراخوانی میشود. قاعده خطا: «کاربر
|
||||
آنجا نیست» و «سرویس در دسترس نیست» ⇒ ورود ادامه مییابد؛ «قفل/غیرفعال/دو
|
||||
مرحلهای» ⇒ ورود رد میشود. کد اضطراری تحویل (`OTP_MASTER_CODE`) هرگز به IAM
|
||||
اعلام نمیشود.
|
||||
|
||||
9. پیکربندی ناقص = خاموش. `IamService.enabled` وجود `issuer`, `client_id` و
|
||||
`client_secret` را هم شرط میکند (با `envOr` که مقدار خالی را unset میشمارد).
|
||||
|
||||
## قبل از تحویل
|
||||
|
||||
```bash
|
||||
cd apps/api && npx jest src/modules/iam src/modules/auth src/modules/sessions
|
||||
# و در استقرار: prisma migrate deploy (جدول AdminSession)
|
||||
```
|
||||
+131
@@ -23,3 +23,134 @@ USER_APP_V2_PORT=5182
|
||||
|
||||
# API Configuration (kept for any tooling that still reads bare PORT)
|
||||
PORT=3000
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Authentication
|
||||
# ---------------------------------------------------------------------------
|
||||
# Admin JWT signing secret. REQUIRED in any real deployment — without it the
|
||||
# API falls back to a well-known development string.
|
||||
JWT_SECRET=
|
||||
# Admin token lifetime (default 12h).
|
||||
JWT_EXPIRES_IN=
|
||||
# Customer JWT signing secret. Deliberately SEPARATE from JWT_SECRET so an
|
||||
# admin token can never validate as a customer token (T1).
|
||||
JWT_CUSTOMER_SECRET=
|
||||
# Customer token lifetime (default 30d).
|
||||
JWT_CUSTOMER_EXPIRES_IN=
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Accounting software integration (Tahesab / Zarrin, D27). Everything else —
|
||||
# which software, address, token, mappings — is set in the admin panel
|
||||
# («پیکر بندی ← اتصال حسابداری»), and the integration is off until then.
|
||||
# ---------------------------------------------------------------------------
|
||||
# Encrypts the accounting token at rest. Set a long random value. Blank falls
|
||||
# back to a key derived from JWT_SECRET (with a boot warning); changing that
|
||||
# key later means re-entering the token in the admin panel.
|
||||
ACCOUNTING_SECRET_KEY=
|
||||
# "off" keeps this API instance out of the background sync (only needed when
|
||||
# several instances run and you want exactly one doing it; a lease already
|
||||
# stops two from running the same job).
|
||||
ACCOUNTING_WORKER=
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Central IAM — delegated admin login (docs/iam-sso.md)
|
||||
# ---------------------------------------------------------------------------
|
||||
# OFF by default. When off, nothing changes: admin login stays a local bcrypt
|
||||
# check and no request ever leaves this server.
|
||||
#
|
||||
# When on, the admin's phone + password are verified against the central
|
||||
# identity service instead. There is NO UI change: no SSO button, no redirect.
|
||||
# If the identity service is unreachable or does not know the account, the
|
||||
# local password check still runs (see IAM_LOGIN_DELEGATION).
|
||||
IAM_ENABLED=false
|
||||
IAM_ISSUER=
|
||||
# The client must be registered there as confidential AND trusted.
|
||||
IAM_CLIENT_ID=
|
||||
IAM_CLIENT_SECRET=
|
||||
# One of the two; tenant_id wins when both are set.
|
||||
IAM_TENANT_ID=
|
||||
IAM_TENANT_SLUG=
|
||||
# off | fallback (default, safest) | exclusive (local password no longer accepted)
|
||||
IAM_LOGIN_DELEGATION=fallback
|
||||
IAM_HTTP_TIMEOUT_MS=8000
|
||||
# صفحه callback اپ کاربر. باید در کلاینت IAM دقیقاً ثبت شود.
|
||||
IAM_REDIRECT_URI=
|
||||
# callbackهای اضافه (دولوپ و دامنه دیگر) با کاما. آدرس ناشناس جایگزین نمیشود.
|
||||
IAM_REDIRECT_URIS=
|
||||
# بعد از ورود محلی، مرورگر برای کوکی نشست مشترک به اینجا برمیگردد.
|
||||
IAM_BROWSER_RETURN_URL=
|
||||
# خروج سراسری فقط اگر این آدرس در post_logout کلاینت ثبت شده باشد برمیگردد.
|
||||
IAM_POST_LOGOUT_REDIRECT_URI=
|
||||
# مقصدهای مجاز خروج اپ کاربر، با کاما. باید عیناً در post_logout کلاینت باشند.
|
||||
IAM_ALLOWED_RETURN_URLS=
|
||||
# پنل ادمین. خالی یعنی بررسی بیصدای ورود در پنل انجام نمیشود.
|
||||
IAM_ADMIN_REDIRECT_URI=
|
||||
IAM_ADMIN_REDIRECT_URIS=
|
||||
IAM_ADMIN_BROWSER_RETURN_URL=
|
||||
IAM_ADMIN_POST_LOGOUT_REDIRECT_URI=
|
||||
IAM_ADMIN_ALLOWED_RETURN_URLS=
|
||||
|
||||
# Revocable admin sessions (AdminSession table).
|
||||
#
|
||||
# An admin token is self-contained and lives for JWT_EXPIRES_IN (12h), so until
|
||||
# this existed nothing could end a session early — not disabling the account, not
|
||||
# a central sign-out. Every issued token now carries a `jti` recorded in the
|
||||
# database, and a revoked row is refused on the next request.
|
||||
#
|
||||
# Unset = follows IAM_ENABLED (on with the IAM, so central revocation reaches
|
||||
# here). `true` turns it on without the IAM; `false` opts out of the per-request
|
||||
# lookup and central revocation then cannot end a session here.
|
||||
AUTH_SESSION_TRACKING=
|
||||
|
||||
# To let the IAM end sessions here, register this path on the client there as its
|
||||
# backchannel_logout_uri:
|
||||
# https://<api-host>/api/iam/backchannel-logout
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# ⚠ DELIVERY ONLY — REMOVE BEFORE THE REAL RELEASE (D20 / ISSUES REL-01)
|
||||
# ---------------------------------------------------------------------------
|
||||
# A fixed OTP that signs in ANY active customer, alongside the real code.
|
||||
# MUST BE EXACTLY 4 DIGITS: the apps' login box has four single-character
|
||||
# inputs and only submits at four (LoginView.vue:43). A longer code still works
|
||||
# over the API but cannot be typed into either app.
|
||||
# Leave it EMPTY or unset to disable it completely — that is the correct state
|
||||
# for production. While it is set, the API prints a warning banner at boot.
|
||||
OTP_MASTER_CODE=
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# SMS gateway. The default "relay" driver works with everything blank (D26).
|
||||
# A failed SMS never stops the server or an operation (D20).
|
||||
# ---------------------------------------------------------------------------
|
||||
# "relay" (default), "trez", or "none" to disable explicitly.
|
||||
SMS_PROVIDER=
|
||||
# relay — the owner's createsms gateway. All four are optional.
|
||||
# URL and secret have built-in defaults.
|
||||
SMS_RELAY_URL=
|
||||
SMS_RELAY_SECRET=
|
||||
# The "host" field. Blank sends this machine's first external IPv4 — inside
|
||||
# Docker that is the container's address.
|
||||
SMS_RELAY_HOST=
|
||||
# "kave" (default, Kavenegar) or "default" to let the gateway pick the line.
|
||||
SMS_RELAY_PLATFORM=
|
||||
# trez — only used with SMS_PROVIDER=trez. Never commit real values.
|
||||
# Override only for staging; defaults to the provider's live endpoint.
|
||||
SMS_TREZ_URL=
|
||||
SMS_TREZ_USERNAME=
|
||||
SMS_TREZ_PASSWORD=
|
||||
SMS_TREZ_SENDER_LINE=
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Uploads
|
||||
# ---------------------------------------------------------------------------
|
||||
# Absolute path for uploaded files; defaults to <api>/storage/uploads.
|
||||
UPLOAD_DIR=
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Profile completion ("تکمیل پروفایل")
|
||||
# ---------------------------------------------------------------------------
|
||||
# Comma-separated admin mobiles told when a customer uploads their documents.
|
||||
# The reference hardcoded four numbers in its source
|
||||
# (henza_server Major/CustomerController::sendSmsToAdmin); they live here
|
||||
# instead so no personal number is committed. Blank means nobody is notified —
|
||||
# the upload and the customer's own SMS still go through (D20).
|
||||
PROFILE_ADMIN_MOBILES=
|
||||
|
||||
@@ -15,3 +15,7 @@ apps/api/storage/uploads/*
|
||||
# apps/api/release/app.js + apps/api/release/vendor/ (Prisma)
|
||||
# apps/admin-panel/dist/
|
||||
# apps/user-app/dist/
|
||||
|
||||
# Live henza data dump (customers' personal data). Never commit.
|
||||
# Only the structure-only oapi-struncture.sql belongs in the repo.
|
||||
/oapi.sql
|
||||
|
||||
+427
@@ -0,0 +1,427 @@
|
||||
# DELIVERY — gold-banking-monorepo
|
||||
|
||||
Branch: **`release/delivery`** · Prepared 2026-09-23
|
||||
|
||||
Contains everything from `parity/security-hotfix` and `parity/phase-1-admin`.
|
||||
Both merged with **no conflicts** (`phase-1-admin` already contained
|
||||
`security-hotfix`, so the merge was a fast-forward). `main` was not touched.
|
||||
|
||||
---
|
||||
|
||||
## 0. Quick start — run these in order
|
||||
|
||||
Copy-paste, top to bottom. Nothing here needs a decision.
|
||||
|
||||
### Step 1 — fill in the environment
|
||||
|
||||
Create `.env` in the repo root. These **must** have a value:
|
||||
|
||||
```dotenv
|
||||
# Database
|
||||
POSTGRES_USER=postgres
|
||||
POSTGRES_PASSWORD=<choose a strong password>
|
||||
POSTGRES_DB=goldbank
|
||||
DATABASE_URL=postgresql://postgres:<the same password>@db:5432/goldbank?schema=public
|
||||
|
||||
# Auth — two DIFFERENT random values. Generate each with:
|
||||
# node -e "console.log(require('crypto').randomBytes(48).toString('base64url'))"
|
||||
JWT_SECRET=<random value 1, 32+ characters>
|
||||
JWT_CUSTOMER_SECRET=<random value 2, 32+ characters, NOT the same as above>
|
||||
# Every origin the panel and the two apps are opened from, comma-separated.
|
||||
CORS_ORIGINS=https://adm.example.ir,https://app.example.ir,https://app2.example.ir
|
||||
```
|
||||
|
||||
The API **refuses to start** in production until all three are right, and
|
||||
prints every problem at once (REL-01, REL-03, SEC-04 —
|
||||
docs/SERVER-SETUP-CHECKLIST.md). A random value:
|
||||
`node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"`.
|
||||
|
||||
Inside Docker the database host is `db`, not `localhost`.
|
||||
|
||||
Everything else is optional and may be left blank. Two you may want now:
|
||||
|
||||
```dotenv
|
||||
# Delivery only — a fixed OTP that signs in ANY active customer.
|
||||
# Exactly 4 digits, or it cannot be typed into the apps. REMOVE before the
|
||||
# real release (see "Before the real release" below). The production image
|
||||
# refuses to start with it unless the server is marked as a test server:
|
||||
OTP_MASTER_CODE=1379
|
||||
TEST_SERVER_ALLOW_MASTER_CODE=yes
|
||||
|
||||
# SMS goes through the "relay" gateway with nothing to set (D26).
|
||||
# SMS_PROVIDER=none turns sending off; the server still starts either way.
|
||||
SMS_PROVIDER=
|
||||
```
|
||||
|
||||
### Step 2 — build
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
pnpm build:release
|
||||
```
|
||||
|
||||
**Do not skip `pnpm build:release`, and never run `docker compose build`
|
||||
without it first.** The API image copies a bundle built here on the machine; it
|
||||
does not build inside the image. Skipping this step produces an image from
|
||||
**old code** and still reports success. This is real — it happened during this
|
||||
delivery's own test run, with a bundle four days stale. (DEPLOY-03)
|
||||
|
||||
### Step 3 — start
|
||||
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
Database migrations and seeding run **automatically inside the API container**
|
||||
at boot. There is no manual migration step. Never run `prisma migrate reset`.
|
||||
|
||||
### Step 4 — check it came up
|
||||
|
||||
```bash
|
||||
docker compose ps # db healthy, api up
|
||||
docker compose logs api | tail -40
|
||||
```
|
||||
|
||||
In the log you should see `Nest application successfully started`, and
|
||||
`Applied migrations: …` (first run) or `No pending migrations` (later runs).
|
||||
|
||||
An `OTP_MASTER_CODE IS ACTIVE` banner is **expected** while that variable is
|
||||
set — it is a reminder, not an error, and it disappears once you remove the
|
||||
variable before the real release.
|
||||
|
||||
A `JWT_CUSTOMER_SECRET IS NOT SET` banner means **Step 1 was not done**. That
|
||||
one is a real security problem, not a warning to ignore — go back and set it.
|
||||
|
||||
### Step 5 — prove the whole flow works
|
||||
|
||||
```bash
|
||||
# Publishes the API on host port 3100 so the test can reach it.
|
||||
docker compose -f docker-compose.yml -f docker-compose.delivery-test.yml up -d api
|
||||
node apps/api/scripts/test-compose-e2e.cjs http://localhost:3100/api <OTP_MASTER_CODE>
|
||||
```
|
||||
|
||||
Expect **32 passed, 0 failed**. It signs a sales expert and an ordinary
|
||||
customer into the app, has both place an order, confirms both orders appear in
|
||||
the admin panel, and re-checks the token boundaries — all against the real
|
||||
container.
|
||||
|
||||
`docker-compose.delivery-test.yml` exists **only** for that check. The normal
|
||||
deployment uses `docker-compose.yml` alone, where the API has no host port and
|
||||
Dokploy/Traefik routes to it by domain.
|
||||
|
||||
---
|
||||
|
||||
## ⚠ Before the real release
|
||||
|
||||
Tonight's build is a **delivery build**. These are the things that must change
|
||||
before it is a production release. The first three are blocking.
|
||||
|
||||
### A. Configuration — blocking
|
||||
|
||||
| # | Do this | Why it matters |
|
||||
|---|---|---|
|
||||
| **1** | **Set `JWT_CUSTOMER_SECRET` to its own random value**, different from `JWT_SECRET`. | Not a cosmetic default. Unset, the API signs customer and sales-expert **app** tokens with `JWT_SECRET` — *the same key admin tokens use* — and the two token realms stop being cryptographically separate. The only remaining barrier is the `typ` check in `jwt.strategy.ts`, and a sales expert's app token carries their **AdminUser id** in `sub`. Two independent defences collapse into one. A loud boot banner fires while it is missing. **REL-03 (Critical).** |
|
||||
| **2** | **Remove `OTP_MASTER_CODE` and `TEST_SERVER_ALLOW_MASTER_CODE` from the environment.** The API now refuses to start with the code set unless that flag says this is a test server. | While set, **any active customer signs in with that one fixed code**. Unset or empty disables it completely; the API prints a banner at boot for as long as it is armed. **REL-01 (Critical).** |
|
||||
| **3** | **Set real `JWT_SECRET` and `CORS_ORIGINS`.** The API refuses to start without them. | Without the key anyone could forge an admin token; without the origin list any website could call the API from a visitor's browser. |
|
||||
| **4** | **Confirm SMS is going out.** The default `relay` gateway needs no credentials (D26); check `docker compose logs api` for `SMS provider: relay` and send yourself a login code. | If the gateway refuses the `host` value (inside Docker it is the container's IP), set `SMS_RELAY_HOST`. A failed send is only a log line — the server still boots (D20). **REL-02.** |
|
||||
|
||||
| **5** | **Accounting integration (D27), only if it will be switched on:** set `ACCOUNTING_SECRET_KEY`; count products with no image (they disappear from the app — query in ISSUES ACC-05) and photograph them first; for Zarrin, run the trial on temporary documents first (ACC-01). | The integration itself is off until an admin turns it on in «اتصال حسابداری»; nothing changes before that except the no-image rule, which applies to every product. |
|
||||
|
||||
After changing any of these: `docker compose up -d --build` and confirm the
|
||||
`OTP_MASTER_CODE` banner is **gone** from `docker compose logs api`.
|
||||
|
||||
### B. Credentials to rotate — the reference leaked them
|
||||
|
||||
These are committed in plaintext in `henza_server` and must be assumed
|
||||
compromised by anyone who has ever had repo access. None were copied into this
|
||||
repository, but they are **the same live accounts**.
|
||||
|
||||
- **SMS panel** username + password + sender line (`app/Models/Sms.php:73-77`) — **SEC-12 (Critical)**
|
||||
- PayPing bearer token, Tahesab bearer token + IP allowlist, wallet hash pepper — **SEC-06**
|
||||
|
||||
### C. Parity work not finished
|
||||
|
||||
Phase 1 stopped after the Persons section when delivery mode began (D19). The
|
||||
**Phase 1 gate still stands** as the next milestone.
|
||||
|
||||
**Admin — not yet audited field-by-field.** Each has had only the breakage scan
|
||||
(`scan-admin-b2b.cjs`, 34 endpoints, 0 broken), not a parity audit:
|
||||
|
||||
- **Financial documents** (اسناد) — the money path; highest priority of the three
|
||||
- **Users & permissions** (کاربران و دسترسیها) — includes **PERM-01**, still
|
||||
open: the database holds **178** distinct permission ids against the UI's
|
||||
**174**. Unresolved because fixing it means **deleting rows**, which needs
|
||||
your approval.
|
||||
- **Reports** (گزارشها)
|
||||
- Also untouched: products/categories/variants, SMS templates, promotions,
|
||||
cities, branches, workshops.
|
||||
|
||||
**Apps — known gaps.**
|
||||
|
||||
| ID | What |
|
||||
|---|---|
|
||||
| **MON-08** | `wagePercent`, `discountPercent` and `flatRialCharge` are taken from the **client** on order creation, so a caller can set their own making charge. `rashWeightGrams` is correctly read from the variant. The reference is *worse* (it trusts client `rash_weight` too), so this is already a partial improvement — but it is still a money path trusting client input. **Fix this first in Phase 2.** |
|
||||
| **STUB-05** | Admin SMS recipients are hardcoded mobile numbers scattered across six places in the reference. Port as `SMS_ADMIN_RECIPIENTS` (comma-separated), the way `PROFILE_ADMIN_MOBILES` already works — not by copying the literals. Staff changes should not need a deploy. |
|
||||
| **STUB-04** | Live gold price is **pull-on-mount only** — no socket, no polling. `quotedAt` renders as a Jalali **date**, so a stale rate looks current. |
|
||||
| **STUB-03** | All list filtering and paging is **client-side** over one flat `GET /catalog/products`; no server `page`/`limit`. |
|
||||
| **Analytics** | The reference PWA calls `useCustomAnalytics` on every route change (`henza_pwa/src/router/index.ts:249`); neither target app has any analytics. Deliberate — it needs a provider decision from you, not a port. |
|
||||
|
||||
**`docs/parity/ISSUES.md`** holds the full list with evidence and file
|
||||
references — currently **40+ entries**, including everything above plus the
|
||||
reference bugs deliberately not ported (SEC-14, SEC-16, APP-03, and the two
|
||||
D21 items). Phase 3 is the pass over that file.
|
||||
|
||||
---
|
||||
|
||||
## 1. Environment variables
|
||||
|
||||
Names only — no values here, and none are committed. The full annotated list is
|
||||
in `.env.example`; `docker-compose.yml` passes each one through to the API
|
||||
container.
|
||||
|
||||
### Required
|
||||
|
||||
| Variable | Purpose |
|
||||
|---|---|
|
||||
| `DATABASE_URL` | PostgreSQL connection string. Inside Docker the host is `db`. |
|
||||
| `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB` | Credentials for the bundled `db` service. |
|
||||
| `JWT_SECRET` | Signs **admin** tokens. Without it the API falls back to a well-known development string — set it. |
|
||||
| `JWT_CUSTOMER_SECRET` | Signs **customer and sales-expert app** tokens. Must be its own value — see the warning at the top of this file. Unset, it falls back to `JWT_SECRET` and the two token realms merge. |
|
||||
|
||||
### Optional
|
||||
|
||||
| Variable | Default | Purpose |
|
||||
|---|---|---|
|
||||
| `PORT` / `API_PORT` | `3000` | API listen port. |
|
||||
| `JWT_EXPIRES_IN` | `12h` | Admin token lifetime. |
|
||||
| `JWT_CUSTOMER_EXPIRES_IN` | `30d` | Customer token lifetime. |
|
||||
| `UPLOAD_DIR` | `<api>/storage/uploads` | Where uploaded files are written. |
|
||||
| `ADMIN_PANEL_PORT`, `USER_APP_PORT`, `USER_APP_V2_PORT` | 5180–5182 | Dev servers only. |
|
||||
| `RUN_MIGRATIONS` | `true` | Set `false` to skip the boot-time migration run. |
|
||||
| `RUN_SEED` | `true` | Set `false` to skip seeding. |
|
||||
| `ACCOUNTING_SECRET_KEY` | *(derived from `JWT_SECRET`)* | Encrypts the accounting-software token the admin enters (D27). Set its own long random value; changing it later means re-entering the token. |
|
||||
| `ACCOUNTING_WORKER` | `on` | `off` keeps this instance out of the accounting background sync. |
|
||||
| `PROFILE_ADMIN_MOBILES` | *(blank)* | Comma-separated admin mobiles told when a customer completes their profile. The reference hardcoded four numbers; blank means nobody is notified and the upload still succeeds. |
|
||||
|
||||
### SMS — all optional
|
||||
|
||||
`SMS_PROVIDER`: `relay` (default), `trez`, or `none` (D26).
|
||||
|
||||
- **relay**: `SMS_RELAY_URL`, `SMS_RELAY_SECRET` (both have built-in
|
||||
defaults), `SMS_RELAY_HOST` (blank = the machine's first external IPv4),
|
||||
`SMS_RELAY_PLATFORM` (`kave` default, or `default` to let the gateway pick).
|
||||
- **trez**: `SMS_TREZ_URL`, `SMS_TREZ_USERNAME`, `SMS_TREZ_PASSWORD`,
|
||||
`SMS_TREZ_SENDER_LINE`.
|
||||
|
||||
The server **always starts**; a misconfigured provider is a warning, and a
|
||||
failed or skipped SMS never blocks an operation, including customer creation.
|
||||
|
||||
### ⚠ `OTP_MASTER_CODE` — delivery only
|
||||
|
||||
A fixed OTP accepted for **any active customer**, alongside the real code.
|
||||
|
||||
- Read only from the environment; never hardcoded.
|
||||
- Unset or empty → completely disabled.
|
||||
- **Must be exactly 4 digits.** Both apps' login box is four single-character
|
||||
inputs and only submits at four, so a longer code works over the API but
|
||||
cannot be typed into either app.
|
||||
- Every login through it is logged with the customer's mobile.
|
||||
- The real OTP keeps working unchanged while it is armed.
|
||||
|
||||
---
|
||||
|
||||
## 2. Running it
|
||||
|
||||
### Development
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
pnpm dev # all apps via turbo
|
||||
```
|
||||
|
||||
Ports come from the repo-root `.env` (single source of truth):
|
||||
API 3000, admin-panel 5180, user-app 5181, user-app-v2 5182.
|
||||
|
||||
### Build
|
||||
|
||||
```bash
|
||||
pnpm build # all workspaces
|
||||
pnpm build:release # the production/Docker build
|
||||
```
|
||||
|
||||
### Deploy (Docker)
|
||||
|
||||
```bash
|
||||
pnpm build:release # ⚠ REQUIRED FIRST — see below
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
> **⚠ `pnpm build:release` must be run before `docker compose build`.**
|
||||
> The API image is `COPY release/ ./` — it ships a bundle built on the
|
||||
> developer machine, not one built inside the image. So `docker compose build`
|
||||
> will happily produce an image from a **stale** `release/app.js` and report
|
||||
> success. During this delivery's compose run that bundle was four days old and
|
||||
> the container was missing every route added since. Tracked as **DEPLOY-03**.
|
||||
|
||||
Services: `db` (Postgres 15), `api` (port 3000), `admin-panel`, `user-app`,
|
||||
`user-app-v2` (each nginx on port 80). The apps expose no host ports —
|
||||
Dokploy/Traefik routes to them by domain. Uploads persist in the `api_uploads`
|
||||
volume; without it every previously uploaded image 404s after a redeploy.
|
||||
|
||||
---
|
||||
|
||||
## 3. How migrations run
|
||||
|
||||
**Automatically, inside the API container, at boot.** No manual step.
|
||||
|
||||
`src/prisma/bootstrap.ts` calls `runMigrations()` before Nest starts. That
|
||||
runner (`src/prisma/migrate.ts`) applies the `.sql` files from
|
||||
`prisma/migrations` and records each one in its own tracking table,
|
||||
**`_goldbank_migrations`**, so every file runs exactly once.
|
||||
|
||||
It exists because **the deploy image is copy-only and ships no Prisma CLI**, so
|
||||
`prisma migrate deploy` is not available there. This is why the database has two
|
||||
migration ledgers — `_prisma_migrations` (written by the Prisma CLI in
|
||||
development) and `_goldbank_migrations` (written by the runtime runner). Both
|
||||
are intentional. `_goldbank_migrations` is declared in `schema.prisma` with
|
||||
`@@ignore` so drift checks do not propose dropping it.
|
||||
|
||||
**Never** run `prisma migrate reset`, and never edit either table by hand.
|
||||
In development, migrations are created with `prisma migrate dev`; in production
|
||||
the container runner applies them.
|
||||
|
||||
Seeding runs once after migrations, gated on a marker row, and is skipped when
|
||||
no seed script is present.
|
||||
|
||||
---
|
||||
|
||||
## 4. What was verified on this branch
|
||||
|
||||
All green on `release/delivery`:
|
||||
|
||||
| Suite | Result |
|
||||
|---|---|
|
||||
| `pnpm build` (5 workspaces) | ✅ all pass |
|
||||
| jest (api unit) | **54/54** |
|
||||
| `smoke-admin.cjs` — admin flows | **43/43** |
|
||||
| `smoke-apps.cjs` — customer flows, both apps | **43/43** |
|
||||
| `scan-admin-b2b.cjs` — every B2B read endpoint | **34 ok, 0 broken** |
|
||||
| `smoke-admin-b2b-writes.cjs` — order + document writes | **25/25** |
|
||||
| `auth-smoke.sh` — permissions/401/403 | **32/32** |
|
||||
| `test-sales-expert-roundtrip.cjs` | **33/33** |
|
||||
| `test-sales-expert-app-login.cjs` — expert app login (D21) | **36/36** |
|
||||
| `test-complete-profile.cjs` — «تکمیل پروفایل» | **38/38** |
|
||||
| `test-report.cjs` — «گزارش» | **40/40** |
|
||||
| `test-compose-e2e.cjs` — **the whole flow inside Docker Compose** | **32/32** |
|
||||
| `test-name-trigger.cjs` | **9/9** |
|
||||
| typecheck (api, admin-panel, user-app, user-app-v2) | ✅ clean |
|
||||
|
||||
### Verified inside Docker Compose, not just locally
|
||||
|
||||
The whole delivery flow was run against the **built container**, which is what
|
||||
actually ships: `test-compose-e2e.cjs` signs a **sales expert** and an
|
||||
**ordinary customer** into the app with the master code, has **both place an
|
||||
order**, and confirms **both orders appear in the admin panel** and open there.
|
||||
It also re-checks the three token boundaries in the deployed image. **32/32.**
|
||||
The three page suites were re-run against the container too — complete-profile
|
||||
38/38, report 40/40, expert login 36/36.
|
||||
|
||||
That run found two deployment problems that no local test could have caught:
|
||||
|
||||
- **DEPLOY-02 (fixed):** admin login returned **500 for every user in Docker**.
|
||||
Compose passes optional variables as `${X:-}`, so an unconfigured one arrives
|
||||
as `""`, not `undefined`; the code used `?? 'default'`, which only falls back
|
||||
on `undefined`, so the empty string reached `jsonwebtoken` and it threw on
|
||||
every sign. Fixed with `src/common/env.ts`, applied to every auth, port,
|
||||
upload and SMS read, and pinned by a test that reproduces the original throw.
|
||||
- **DEPLOY-03 (process):** the API image ships a **pre-built** bundle, so
|
||||
`docker compose build` can silently produce an image from stale code. See the
|
||||
warning in the deploy section above.
|
||||
|
||||
Flows walked end to end: admin login, customer creation, sales-expert
|
||||
create/edit, product and variant create/edit, order list/detail/status change,
|
||||
wholesale order placement from the admin panel, cash document creation +
|
||||
confirm + un-confirm; and in **both** customer apps: OTP login with the master
|
||||
code, product browsing, cart, order placement, order history.
|
||||
|
||||
Money paths were checked against the reference's own formulas, not just for a
|
||||
200: making charge `rash × (1 + (wage − discount)/100)` reproduced exactly, and
|
||||
the cash-document conversion `price / (price_per_gram / 4.331802)` moved the
|
||||
customer's gold debt by the expected amount and restored it exactly on
|
||||
un-confirm.
|
||||
|
||||
Every test script deletes only the rows it created; the write test also asserts
|
||||
the customer's balances end exactly as they started.
|
||||
|
||||
---
|
||||
|
||||
## 5. Known issues — not done tonight
|
||||
|
||||
Nothing here blocks the delivery. Full detail in `docs/parity/ISSUES.md`.
|
||||
|
||||
### Missing app pages
|
||||
|
||||
**None.** Every page the reference PWA has now exists in both apps.
|
||||
|
||||
|
||||
### Delivered tonight
|
||||
|
||||
| Feature | State |
|
||||
|---|---|
|
||||
| **Sales-expert app login (D21)** | ✅ Done. An expert signs into both apps with their AdminUser account and the ordinary OTP flow; the master code works for them too. They get the whole app — browsing, cart, ordering, order history — plus their own two screens. |
|
||||
| **«سفارش مشتریان» (ChildOrder)** | ✅ Done in both apps. Their referred customers' orders at «تحویل مسئول فروش», searchable, infinite-scrolled. |
|
||||
| **«مشتریان من» (customerChoice)** | ✅ Done in both apps. Their referred customers, searchable, with a read-only detail sheet. |
|
||||
| **APP-02 — admin home slider in v2** | ✅ Fixed. v2 now prefers admin-configured slides and keeps its category-derived hero as the fallback. |
|
||||
| **«تکمیل پروفایل» (complete_profile)** | ✅ Done in both apps. Three document uploads (جواز کسب، سردر مغازه، کارت ملی), then the profile is marked verified. Reached from the profile screen, and only while the documents are missing — exactly the reference's condition. |
|
||||
| **«گزارش» (report + report/detail)** | ✅ Done in both apps. Two tabs («کلیات حساب» / «جزئیات حساب»), a running gold and rial balance per document, and a per-document detail sheet. Built on the **internal ledger** (owner's option الف) — no connection to the external accounting system the reference proxied. See D24. |
|
||||
|
||||
An expert's own order lands on their **own trading account**, with the making
|
||||
charge from `AdminUser.wagePercent` and the credit limit from
|
||||
`SalesExpertProfile.gramLevel` — the same two numbers the reference read off
|
||||
the agent's own customer row. See D21.
|
||||
|
||||
**Two reference behaviours were deliberately not ported**, both money/session
|
||||
risks and both recorded in D21:
|
||||
1. `myChild` minted an `api_token` per listed customer so the agent could act
|
||||
**as** them — a session-hijack primitive.
|
||||
2. The child-order edit drawer (`PUT /order/child/{id}`) recalculated an
|
||||
order's weights and prices from client-sent values. The card opens a
|
||||
read-only summary instead.
|
||||
|
||||
### Behavioural gaps
|
||||
|
||||
| ID | What |
|
||||
|---|---|
|
||||
| **APP-02** | `user-app-v2` has no `getHomeSlider`, so slides configured in the admin panel appear in **user-app only**; v2 always derives its hero from categories. Not fixed because v2's home is its own design and rewiring it during a delivery risks the page being demonstrated. |
|
||||
| **PERS-02** | The reference's cities are a province → city **tree** (provinces not selectable); the target flattened this to a `province` string and a flat select on all three Persons forms. The city itself is still captured correctly. |
|
||||
| **PERS-03** | The reference collects a Jalali **birth date** on the customer forms; the target has no column for it. |
|
||||
| **PERS-01** | The reference makes a customer's **mobile immutable on edit**; the target allows editing it. Owner ruled this NOT ported — the target keeps its current behaviour. |
|
||||
| **PERF-01** | `listReagents()` runs one aggregate per row (N+1) for the per-agent sales total. Harmless at the current agent count. |
|
||||
|
||||
### Parity work not reached
|
||||
|
||||
Phase 1 was not completed: the field-by-field audit stopped after the Persons
|
||||
section, and products/categories/variants, financial documents, users and
|
||||
permissions, SMS templates, promotions, cities, branches, workshops and reports
|
||||
have had only the breakage scan above, not a full parity audit. The
|
||||
**Phase 1 gate was lifted for tonight only** (D19) and still stands as the next
|
||||
milestone.
|
||||
|
||||
`PERM-01` (the database holds 178 distinct permission ids against the UI's 174)
|
||||
is still awaiting a decision, because resolving it means deleting rows.
|
||||
|
||||
---
|
||||
|
||||
## 6. Decisions that shaped this build
|
||||
|
||||
Recorded in `docs/parity/DECISIONS.md`:
|
||||
|
||||
- **D13** — the retail storefront (`single*`, wallet, comments, `customer.php`,
|
||||
`site.php`) is **preserved but out of scope**. Nothing there was changed.
|
||||
- **D19** — delivery mode: implement the main gaps, do not stop to ask, choose
|
||||
the lowest-risk option, change nothing protected.
|
||||
- **D20** — SMS can never block a boot or an operation; `OTP_MASTER_CODE` for
|
||||
the delivery.
|
||||
- **D26** — SMS goes through the owner's `relay` gateway by default; Trez is
|
||||
kept as a selectable driver.
|
||||
- **D11 is cancelled** — superseded by D13.
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM docker.arvancloud.ir/nginx:latest
|
||||
FROM nginx:latest
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY dist /usr/share/nginx/html
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{c as O,I as x,d as j,v as B,x as m,o as C,a as A,w as v,f as $,t as E,h as P,i as L,l as u,Z as y,M as b,z as M,r as N}from"./index-CVG99b4v.js";var z={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"};function g(o){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(c){return Object.getOwnPropertyDescriptor(n,c).enumerable}))),r.forEach(function(c){V(o,c,n[c])})}return o}function V(o,t,n){return t in o?Object.defineProperty(o,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):o[t]=n,o}var d=function(t,n){var r=g({},t,n.attrs);return O(x,g({},r,{icon:z}),null)};d.displayName="SyncOutlined";d.inheritAttrs=!1;const I=j({__name:"AccountingSyncButton",props:{endpoint:{}},emits:["done"],setup(o,{emit:t}){const n=o,r=t,c=u(!1),p=u(null),i=u(!1),h={customers:"مشتریان",balances:"ماندهها",products:"کارساختهها و موجودی"},_={scanned:"بررسیشده",inScope:"در گروههای انتخابی",refreshed:"بهروز",linked:"لینکشده",imported:"وارد شده",issues:"مغایرت",updated:"بهروز",items:"کارساخته",stockErrors:"خطای موجودی"},S=e=>e&&typeof e=="object"?Object.entries(e).map(([s,a])=>`${_[s]??s}: ${a}`).join("، "):"";B(async()=>{try{const{data:e}=await m.get("admin/accounting-status");c.value=!!(e!=null&&e.connected),p.value=(e==null?void 0:e.provider)??null}catch{c.value=!1}});async function w(){var e,s;i.value=!0;try{const{data:a}=await m.post(n.endpoint),k=Object.entries(a.results).map(([f,l])=>y("p",{style:l.ok?"":"color:#d4380d"},`${h[f]??f}: ${l.ok?S(l.summary)||"انجام شد":`خطا — ${l.error}`}`));(a.ok?b.success:b.warning)({title:a.ok?"سینک با حسابداری انجام شد":"سینک با حسابداری کامل انجام نشد",content:y("div",k),okText:"باشه"}),r("done")}catch(a){M.error(((s=(e=a==null?void 0:a.response)==null?void 0:e.data)==null?void 0:s.message)||"سینک با حسابداری انجام نشد")}finally{i.value=!1}}return(e,s)=>{const a=N("a-button");return c.value?(C(),A(a,{key:0,loading:i.value,onClick:w},{icon:v(()=>[O(P(d))]),default:v(()=>[$(" سینک با "+E(p.value||"حسابداری"),1)]),_:1},8,["loading"])):L("",!0)}}});export{I as _};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as o}from"./Add.vue_vue_type_script_setup_true_lang-BP3ofJiO.js";import"./index-WFQJAeoE.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-BQ_i_QZe.js";export{o as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as o}from"./Add.vue_vue_type_script_setup_true_lang-Ct9fNasS.js";import"./index-CVG99b4v.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-C8WW9alD.js";export{o as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{_ as o}from"./AddBranches.vue_vue_type_script_setup_true_lang-DZPeg6FI.js";import"./index-CVG99b4v.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";export{o as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as o}from"./AddBranches.vue_vue_type_script_setup_true_lang-BTBcvf9O.js";import"./index-WFQJAeoE.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";export{o as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as q,v as G,x as c,a as v,w as l,h as R,j as H,l as S,y as j,r as i,o as p,n as C,c as n,b as O,e as $,F as z,f as g,A as I,z as M,k as J,t as N}from"./index-WFQJAeoE.js";import{_ as K}from"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";const P={class:"grid-2"},Q={class:"grid-2"},Y=q({__name:"AddBranches",props:{open:{type:Boolean},id:{}},emits:["update:open","success"],setup(h,{emit:V}){const y=h,w=V,f=y.open!==void 0,A=H(),E=J(),d=f?y.id:A.params.id,m=S(!1),_=S([]),t=j({name:"",phone:"",address:"",user_id:void 0}),r=j({});function k(s,e){var o,u;return String(((u=(o=e==null?void 0:e.children)==null?void 0:o[0])==null?void 0:u.children)??"").includes(s)}async function b(){var s,e;if(Object.keys(r).forEach(o=>delete r[o]),!t.name){r.name="لطفا مقدار را وارد کنید";return}try{m.value=!0,d?await c.put(`branch/${d}`,t):await c.post("branch",t),M.info("اطلاعات با موفقیت به ثبت رسید."),d||Object.assign(t,{name:"",phone:"",address:"",user_id:void 0}),f?(w("success"),w("update:open",!1)):E.push("/branch/list")}catch(o){M.error(((e=(s=o==null?void 0:o.response)==null?void 0:s.data)==null?void 0:e.message)??"خطا در ثبت اطلاعات.")}finally{m.value=!1}}return G(async()=>{try{const{data:s}=await c.get("user/list");_.value=s}catch(s){console.log(s)}if(d)try{const{data:s}=await c.get(`branch/${d}`);Object.assign(t,{name:s.name??"",phone:s.phone??"",address:s.address??"",user_id:s.user_id??void 0})}catch(s){console.log(s)}}),(s,e)=>{const o=i("a-input"),u=i("a-form-item"),U=i("a-select-option"),x=i("a-select"),B=i("a-textarea"),F=i("a-button"),D=i("a-card"),L=i("a-form"),T=i("a-spin");return f?(p(),v(K,{key:0,open:!!h.open,id:R(d),"add-title":"افزودن شعبه","edit-title":"ویرایش شعبه",loading:m.value,submitting:m.value,"onUpdate:open":e[4]||(e[4]=a=>s.$emit("update:open",a)),onSubmit:b},{default:l(()=>[C("div",P,[n(u,{label:"نام شعبه","validate-status":r.name?"error":"",help:r.name},{default:l(()=>[n(o,{value:t.name,"onUpdate:value":e[0]||(e[0]=a=>t.name=a)},null,8,["value"])]),_:1},8,["validate-status","help"]),n(u,{label:"تلفن شعبه"},{default:l(()=>[n(o,{value:t.phone,"onUpdate:value":e[1]||(e[1]=a=>t.phone=a)},null,8,["value"])]),_:1}),n(u,{label:"مدیر"},{default:l(()=>[n(x,{value:t.user_id,"onUpdate:value":e[2]||(e[2]=a=>t.user_id=a),"show-search":"","allow-clear":"",placeholder:"انتخاب کنید","filter-option":k},{default:l(()=>[(p(!0),O(z,null,$(_.value,a=>(p(),v(U,{key:a.id,value:a.id},{default:l(()=>[g(N(a.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1})]),n(u,{label:"آدرس"},{default:l(()=>[n(B,{value:t.address,"onUpdate:value":e[3]||(e[3]=a=>t.address=a),"auto-size":{minRows:2,maxRows:5}},null,8,["value"])]),_:1})]),_:1},8,["open","id","loading","submitting"])):(p(),v(T,{key:1,spinning:m.value},{default:l(()=>[n(L,{layout:"vertical",onSubmit:I(b,["prevent"])},{default:l(()=>[n(D,{title:R(d)?"ویرایش شعبه":"افزودن شعبه",class:"mb-base"},{default:l(()=>[C("div",Q,[n(u,{label:"نام شعبه","validate-status":r.name?"error":"",help:r.name},{default:l(()=>[n(o,{value:t.name,"onUpdate:value":e[5]||(e[5]=a=>t.name=a)},null,8,["value"])]),_:1},8,["validate-status","help"]),n(u,{label:"تلفن شعبه"},{default:l(()=>[n(o,{value:t.phone,"onUpdate:value":e[6]||(e[6]=a=>t.phone=a)},null,8,["value"])]),_:1}),n(u,{label:"مدیر"},{default:l(()=>[n(x,{value:t.user_id,"onUpdate:value":e[7]||(e[7]=a=>t.user_id=a),"show-search":"","allow-clear":"",placeholder:"انتخاب کنید","filter-option":k},{default:l(()=>[(p(!0),O(z,null,$(_.value,a=>(p(),v(U,{key:a.id,value:a.id},{default:l(()=>[g(N(a.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1})]),n(u,{label:"آدرس"},{default:l(()=>[n(B,{value:t.address,"onUpdate:value":e[8]||(e[8]=a=>t.address=a),"auto-size":{minRows:2,maxRows:5}},null,8,["value"])]),_:1}),n(F,{type:"primary",onClick:b},{default:l(()=>[...e[9]||(e[9]=[g("ثبت اطلاعات",-1)])]),_:1})]),_:1},8,["title"])]),_:1})]),_:1},8,["spinning"]))}}});export{Y as _};
|
||||
import{d as q,v as G,x as c,a as v,w as l,h as R,j as H,l as S,y as j,r as i,o as p,n as C,c as n,b as O,e as $,F as z,f as g,A as I,z as M,k as J,t as N}from"./index-CVG99b4v.js";import{_ as K}from"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";const P={class:"grid-2"},Q={class:"grid-2"},Y=q({__name:"AddBranches",props:{open:{type:Boolean},id:{}},emits:["update:open","success"],setup(h,{emit:V}){const y=h,w=V,f=y.open!==void 0,A=H(),E=J(),d=f?y.id:A.params.id,m=S(!1),_=S([]),t=j({name:"",phone:"",address:"",user_id:void 0}),r=j({});function k(s,e){var o,u;return String(((u=(o=e==null?void 0:e.children)==null?void 0:o[0])==null?void 0:u.children)??"").includes(s)}async function b(){var s,e;if(Object.keys(r).forEach(o=>delete r[o]),!t.name){r.name="لطفا مقدار را وارد کنید";return}try{m.value=!0,d?await c.put(`branch/${d}`,t):await c.post("branch",t),M.info("اطلاعات با موفقیت به ثبت رسید."),d||Object.assign(t,{name:"",phone:"",address:"",user_id:void 0}),f?(w("success"),w("update:open",!1)):E.push("/branch/list")}catch(o){M.error(((e=(s=o==null?void 0:o.response)==null?void 0:s.data)==null?void 0:e.message)??"خطا در ثبت اطلاعات.")}finally{m.value=!1}}return G(async()=>{try{const{data:s}=await c.get("user/list");_.value=s}catch(s){console.log(s)}if(d)try{const{data:s}=await c.get(`branch/${d}`);Object.assign(t,{name:s.name??"",phone:s.phone??"",address:s.address??"",user_id:s.user_id??void 0})}catch(s){console.log(s)}}),(s,e)=>{const o=i("a-input"),u=i("a-form-item"),U=i("a-select-option"),x=i("a-select"),B=i("a-textarea"),F=i("a-button"),D=i("a-card"),L=i("a-form"),T=i("a-spin");return f?(p(),v(K,{key:0,open:!!h.open,id:R(d),"add-title":"افزودن شعبه","edit-title":"ویرایش شعبه",loading:m.value,submitting:m.value,"onUpdate:open":e[4]||(e[4]=a=>s.$emit("update:open",a)),onSubmit:b},{default:l(()=>[C("div",P,[n(u,{label:"نام شعبه","validate-status":r.name?"error":"",help:r.name},{default:l(()=>[n(o,{value:t.name,"onUpdate:value":e[0]||(e[0]=a=>t.name=a)},null,8,["value"])]),_:1},8,["validate-status","help"]),n(u,{label:"تلفن شعبه"},{default:l(()=>[n(o,{value:t.phone,"onUpdate:value":e[1]||(e[1]=a=>t.phone=a)},null,8,["value"])]),_:1}),n(u,{label:"مدیر"},{default:l(()=>[n(x,{value:t.user_id,"onUpdate:value":e[2]||(e[2]=a=>t.user_id=a),"show-search":"","allow-clear":"",placeholder:"انتخاب کنید","filter-option":k},{default:l(()=>[(p(!0),O(z,null,$(_.value,a=>(p(),v(U,{key:a.id,value:a.id},{default:l(()=>[g(N(a.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1})]),n(u,{label:"آدرس"},{default:l(()=>[n(B,{value:t.address,"onUpdate:value":e[3]||(e[3]=a=>t.address=a),"auto-size":{minRows:2,maxRows:5}},null,8,["value"])]),_:1})]),_:1},8,["open","id","loading","submitting"])):(p(),v(T,{key:1,spinning:m.value},{default:l(()=>[n(L,{layout:"vertical",onSubmit:I(b,["prevent"])},{default:l(()=>[n(D,{title:R(d)?"ویرایش شعبه":"افزودن شعبه",class:"mb-base"},{default:l(()=>[C("div",Q,[n(u,{label:"نام شعبه","validate-status":r.name?"error":"",help:r.name},{default:l(()=>[n(o,{value:t.name,"onUpdate:value":e[5]||(e[5]=a=>t.name=a)},null,8,["value"])]),_:1},8,["validate-status","help"]),n(u,{label:"تلفن شعبه"},{default:l(()=>[n(o,{value:t.phone,"onUpdate:value":e[6]||(e[6]=a=>t.phone=a)},null,8,["value"])]),_:1}),n(u,{label:"مدیر"},{default:l(()=>[n(x,{value:t.user_id,"onUpdate:value":e[7]||(e[7]=a=>t.user_id=a),"show-search":"","allow-clear":"",placeholder:"انتخاب کنید","filter-option":k},{default:l(()=>[(p(!0),O(z,null,$(_.value,a=>(p(),v(U,{key:a.id,value:a.id},{default:l(()=>[g(N(a.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1})]),n(u,{label:"آدرس"},{default:l(()=>[n(B,{value:t.address,"onUpdate:value":e[8]||(e[8]=a=>t.address=a),"auto-size":{minRows:2,maxRows:5}},null,8,["value"])]),_:1}),n(F,{type:"primary",onClick:b},{default:l(()=>[...e[9]||(e[9]=[g("ثبت اطلاعات",-1)])]),_:1})]),_:1},8,["title"])]),_:1})]),_:1},8,["spinning"]))}}});export{Y as _};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as p}from"./bulkCustomer.vue_vue_type_script_setup_true_lang-zBMtv664.js";import{R as u}from"./ReagentCustomer-BUrwCRTH.js";import{_ as l}from"./singleCustomer.vue_vue_type_script_setup_true_lang-6EgeQ9yM.js";import{d as f,u as b,b as k,n as h,c as e,w as a,r,o as t,a as n,i as c}from"./index-WFQJAeoE.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-BQ_i_QZe.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const C={id:"page-user-view"},B={id:"user-data"},$=f({__name:"AddCustomer",setup(v){const m=b(),s=_=>!!m.hasPermission(_);return(_,y)=>{const o=r("a-tab-pane"),i=r("a-tabs"),d=r("a-card");return t(),k("div",C,[h("div",B,[e(d,{class:"mb-base"},{default:a(()=>[s("persons.create")?(t(),n(i,{key:0},{default:a(()=>[s("persons.create.client")?(t(),n(o,{key:"omde",tab:"مشتری عمده"},{default:a(()=>[e(p)]),_:1})):c("",!0),s("persons.create.seller")?(t(),n(o,{key:"reagent",tab:"کارشناس فروش"},{default:a(()=>[e(u)]),_:1})):c("",!0),e(o,{key:"tak",tab:"مشتری تک"},{default:a(()=>[e(l)]),_:1})]),_:1})):c("",!0)]),_:1})])])}}});export{$ as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as d}from"./bulkCustomer.vue_vue_type_script_setup_true_lang-BLZHRH0s.js";import{R as u}from"./ReagentCustomer-DcWF6RQp.js";import{_ as l}from"./singleCustomer.vue_vue_type_script_setup_true_lang-BCru8Kun.js";import{d as f,u as b,b as k,n as h,c as e,w as t,r,o as a,a as n,i as c}from"./index-CVG99b4v.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-C8WW9alD.js";import"./CityTreeSelect.vue_vue_type_script_setup_true_lang-Ctf4a2EQ.js";import"./DateInput-P3xqxLM7.js";import"./index-pLFqZCCf.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const C={id:"page-user-view"},B={id:"user-data"},S=f({__name:"AddCustomer",setup(v){const m=b(),s=_=>!!m.hasPermission(_);return(_,y)=>{const o=r("a-tab-pane"),i=r("a-tabs"),p=r("a-card");return a(),k("div",C,[h("div",B,[e(p,{class:"mb-base"},{default:t(()=>[s("persons.create")?(a(),n(i,{key:0},{default:t(()=>[s("persons.create.client")?(a(),n(o,{key:"omde",tab:"مشتری عمده"},{default:t(()=>[e(d)]),_:1})):c("",!0),s("persons.create.seller")?(a(),n(o,{key:"reagent",tab:"کارشناس فروش"},{default:t(()=>[e(u)]),_:1})):c("",!0),e(o,{key:"tak",tab:"مشتری تک"},{default:t(()=>[e(l)]),_:1})]),_:1})):c("",!0)]),_:1})])])}}});export{S as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
.grid-1[data-v-b0cf24f2]{display:grid;grid-template-columns:1fr}.image-grid[data-v-b0cf24f2]{display:flex;flex-wrap:wrap;gap:8px}.variant-thumb[data-v-b0cf24f2]{width:40px;height:40px;object-fit:cover;border-radius:4px;display:inline-block}.variant-thumb--empty[data-v-b0cf24f2]{display:inline-flex;align-items:center;justify-content:center;border:1px dashed #d9d9d9;color:#bfbfbf}.variant-picker[data-v-b0cf24f2]{display:flex;flex-wrap:wrap;gap:8px}.variant-picker__item[data-v-b0cf24f2]{width:64px;height:64px;padding:2px;border:2px solid #d9d9d9;border-radius:6px;background:#fff;cursor:pointer;overflow:hidden}.variant-picker__item img[data-v-b0cf24f2]{width:100%;height:100%;object-fit:cover;border-radius:4px;display:block}.variant-picker__item.is-on[data-v-b0cf24f2]{border-color:#1890ff}.variant-picker__none[data-v-b0cf24f2]{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:11px;color:#8c8c8c;line-height:1.3}.flex-1[data-v-b0cf24f2]{flex:1}.mb-8[data-v-b0cf24f2]{margin-bottom:2rem}.overflow-auto[data-v-b0cf24f2]{overflow:auto}
|
||||
@@ -1 +0,0 @@
|
||||
.grid-1[data-v-d501144a]{display:grid;grid-template-columns:1fr}.image-grid[data-v-d501144a]{display:flex;flex-wrap:wrap;gap:8px}.variant-thumb[data-v-d501144a]{width:40px;height:40px;object-fit:cover;border-radius:4px;display:inline-block}.variant-thumb--empty[data-v-d501144a]{display:inline-flex;align-items:center;justify-content:center;border:1px dashed #d9d9d9;color:#bfbfbf}.variant-picker[data-v-d501144a]{display:flex;flex-wrap:wrap;gap:8px}.variant-picker__item[data-v-d501144a]{width:64px;height:64px;padding:2px;border:2px solid #d9d9d9;border-radius:6px;background:#fff;cursor:pointer;overflow:hidden}.variant-picker__item img[data-v-d501144a]{width:100%;height:100%;object-fit:cover;border-radius:4px;display:block}.variant-picker__item.is-on[data-v-d501144a]{border-color:#1890ff}.variant-picker__none[data-v-d501144a]{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:11px;color:#8c8c8c;line-height:1.3}.flex-1[data-v-d501144a]{flex:1}.mb-8[data-v-d501144a]{margin-bottom:2rem}.overflow-auto[data-v-d501144a]{overflow:auto}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{_ as o}from"./AddWorkshop.vue_vue_type_script_setup_true_lang-BXy9e7qX.js";import"./index-WFQJAeoE.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";export{o as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as o}from"./AddWorkshop.vue_vue_type_script_setup_true_lang-DM0hJwHH.js";import"./index-CVG99b4v.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";export{o as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as N,v as O,x as v,a as b,w as n,h as g,j as S,l as V,y,r as p,o as U,n as x,c as o,f as A,A as E,z as c,k as T}from"./index-WFQJAeoE.js";import{_ as W}from"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";const q={class:"grid-3"},D={class:"grid-3"},H=N({__name:"AddWorkshop",props:{open:{type:Boolean},id:{}},emits:["update:open","success"],setup(f,{emit:R}){const h=f,w=R,_=h.open!==void 0,B=S(),j=T(),d=_?h.id:B.params.id,i=V(!1),e=y({workshop_name:"",workshop_phone:"",workshop_address:"",user_fname:"",user_lname:"",user_phone:""}),u=y({});async function m(){var t,a;if(Object.keys(u).forEach(l=>delete u[l]),e.workshop_name||(u.workshop_name="لطفا مقدار را وارد کنید"),(e.user_fname||e.user_lname)&&!e.user_phone&&(u.user_phone="موبایل سرپرست کارگاه الزامی است"),!Object.keys(u).length)try{i.value=!0,d?await v.put(`workshop/${d}`,e):await v.post("workshop",e),c.info("اطلاعات با موفقیت به ثبت رسید."),_?(w("success"),w("update:open",!1)):j.push("/workshop/list")}catch(l){c.error(((a=(t=l==null?void 0:l.response)==null?void 0:t.data)==null?void 0:a.message)??"خطا در ثبت اطلاعات.")}finally{i.value=!1}}return O(async()=>{if(d)try{const{data:t}=await v.get(`workshop/${d}`);Object.assign(e,{workshop_name:t.workshop_name??t.name??"",workshop_phone:t.workshop_phone??t.phone??"",workshop_address:t.workshop_address??t.address??"",user_fname:t.user_fname??"",user_lname:t.user_lname??"",user_phone:t.user_phone??""})}catch(t){console.log(t)}}),(t,a)=>{const l=p("a-input"),r=p("a-form-item"),k=p("a-textarea"),C=p("a-button"),$=p("a-card"),z=p("a-form"),M=p("a-spin");return _?(U(),b(W,{key:0,open:!!f.open,id:g(d),"add-title":"افزودن کارگاه","edit-title":"ویرایش کارگاه",loading:i.value,submitting:i.value,width:"lg","onUpdate:open":a[6]||(a[6]=s=>t.$emit("update:open",s)),onSubmit:m},{default:n(()=>[x("div",q,[o(r,{label:"نام کارگاه","validate-status":u.workshop_name?"error":"",help:u.workshop_name},{default:n(()=>[o(l,{value:e.workshop_name,"onUpdate:value":a[0]||(a[0]=s=>e.workshop_name=s)},null,8,["value"])]),_:1},8,["validate-status","help"]),o(r,{label:"تلفن کارگاه"},{default:n(()=>[o(l,{value:e.workshop_phone,"onUpdate:value":a[1]||(a[1]=s=>e.workshop_phone=s)},null,8,["value"])]),_:1}),o(r,{label:"نام سرپرست کارگاه"},{default:n(()=>[o(l,{value:e.user_fname,"onUpdate:value":a[2]||(a[2]=s=>e.user_fname=s)},null,8,["value"])]),_:1}),o(r,{label:"نام خانوادگی سرپرست کارگاه"},{default:n(()=>[o(l,{value:e.user_lname,"onUpdate:value":a[3]||(a[3]=s=>e.user_lname=s)},null,8,["value"])]),_:1}),o(r,{label:"موبایل سرپرست کارگاه","validate-status":u.user_phone?"error":"",help:u.user_phone},{default:n(()=>[o(l,{value:e.user_phone,"onUpdate:value":a[4]||(a[4]=s=>e.user_phone=s)},null,8,["value"])]),_:1},8,["validate-status","help"])]),o(r,{label:"آدرس"},{default:n(()=>[o(k,{value:e.workshop_address,"onUpdate:value":a[5]||(a[5]=s=>e.workshop_address=s),"auto-size":{minRows:2,maxRows:5}},null,8,["value"])]),_:1})]),_:1},8,["open","id","loading","submitting"])):(U(),b(M,{key:1,spinning:i.value},{default:n(()=>[o(z,{layout:"vertical",onSubmit:E(m,["prevent"])},{default:n(()=>[o($,{title:g(d)?"ویرایش کارگاه":"افزودن کارگاه",class:"mb-base"},{default:n(()=>[x("div",D,[o(r,{label:"نام کارگاه","validate-status":u.workshop_name?"error":"",help:u.workshop_name},{default:n(()=>[o(l,{value:e.workshop_name,"onUpdate:value":a[7]||(a[7]=s=>e.workshop_name=s)},null,8,["value"])]),_:1},8,["validate-status","help"]),o(r,{label:"تلفن کارگاه"},{default:n(()=>[o(l,{value:e.workshop_phone,"onUpdate:value":a[8]||(a[8]=s=>e.workshop_phone=s)},null,8,["value"])]),_:1}),o(r,{label:"نام سرپرست کارگاه"},{default:n(()=>[o(l,{value:e.user_fname,"onUpdate:value":a[9]||(a[9]=s=>e.user_fname=s)},null,8,["value"])]),_:1}),o(r,{label:"نام خانوادگی سرپرست کارگاه"},{default:n(()=>[o(l,{value:e.user_lname,"onUpdate:value":a[10]||(a[10]=s=>e.user_lname=s)},null,8,["value"])]),_:1}),o(r,{label:"موبایل سرپرست کارگاه","validate-status":u.user_phone?"error":"",help:u.user_phone},{default:n(()=>[o(l,{value:e.user_phone,"onUpdate:value":a[11]||(a[11]=s=>e.user_phone=s)},null,8,["value"])]),_:1},8,["validate-status","help"])]),o(r,{label:"آدرس"},{default:n(()=>[o(k,{value:e.workshop_address,"onUpdate:value":a[12]||(a[12]=s=>e.workshop_address=s),"auto-size":{minRows:2,maxRows:5}},null,8,["value"])]),_:1}),o(C,{type:"primary",onClick:m},{default:n(()=>[...a[13]||(a[13]=[A("ثبت اطلاعات",-1)])]),_:1})]),_:1},8,["title"])]),_:1})]),_:1},8,["spinning"]))}}});export{H as _};
|
||||
import{d as N,v as O,x as v,a as b,w as n,h as g,j as S,l as V,y,r as p,o as U,n as x,c as o,f as A,A as E,z as c,k as T}from"./index-CVG99b4v.js";import{_ as W}from"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";const q={class:"grid-3"},D={class:"grid-3"},H=N({__name:"AddWorkshop",props:{open:{type:Boolean},id:{}},emits:["update:open","success"],setup(f,{emit:R}){const h=f,w=R,_=h.open!==void 0,B=S(),j=T(),d=_?h.id:B.params.id,i=V(!1),e=y({workshop_name:"",workshop_phone:"",workshop_address:"",user_fname:"",user_lname:"",user_phone:""}),u=y({});async function m(){var t,a;if(Object.keys(u).forEach(l=>delete u[l]),e.workshop_name||(u.workshop_name="لطفا مقدار را وارد کنید"),(e.user_fname||e.user_lname)&&!e.user_phone&&(u.user_phone="موبایل سرپرست کارگاه الزامی است"),!Object.keys(u).length)try{i.value=!0,d?await v.put(`workshop/${d}`,e):await v.post("workshop",e),c.info("اطلاعات با موفقیت به ثبت رسید."),_?(w("success"),w("update:open",!1)):j.push("/workshop/list")}catch(l){c.error(((a=(t=l==null?void 0:l.response)==null?void 0:t.data)==null?void 0:a.message)??"خطا در ثبت اطلاعات.")}finally{i.value=!1}}return O(async()=>{if(d)try{const{data:t}=await v.get(`workshop/${d}`);Object.assign(e,{workshop_name:t.workshop_name??t.name??"",workshop_phone:t.workshop_phone??t.phone??"",workshop_address:t.workshop_address??t.address??"",user_fname:t.user_fname??"",user_lname:t.user_lname??"",user_phone:t.user_phone??""})}catch(t){console.log(t)}}),(t,a)=>{const l=p("a-input"),r=p("a-form-item"),k=p("a-textarea"),C=p("a-button"),$=p("a-card"),z=p("a-form"),M=p("a-spin");return _?(U(),b(W,{key:0,open:!!f.open,id:g(d),"add-title":"افزودن کارگاه","edit-title":"ویرایش کارگاه",loading:i.value,submitting:i.value,width:"lg","onUpdate:open":a[6]||(a[6]=s=>t.$emit("update:open",s)),onSubmit:m},{default:n(()=>[x("div",q,[o(r,{label:"نام کارگاه","validate-status":u.workshop_name?"error":"",help:u.workshop_name},{default:n(()=>[o(l,{value:e.workshop_name,"onUpdate:value":a[0]||(a[0]=s=>e.workshop_name=s)},null,8,["value"])]),_:1},8,["validate-status","help"]),o(r,{label:"تلفن کارگاه"},{default:n(()=>[o(l,{value:e.workshop_phone,"onUpdate:value":a[1]||(a[1]=s=>e.workshop_phone=s)},null,8,["value"])]),_:1}),o(r,{label:"نام سرپرست کارگاه"},{default:n(()=>[o(l,{value:e.user_fname,"onUpdate:value":a[2]||(a[2]=s=>e.user_fname=s)},null,8,["value"])]),_:1}),o(r,{label:"نام خانوادگی سرپرست کارگاه"},{default:n(()=>[o(l,{value:e.user_lname,"onUpdate:value":a[3]||(a[3]=s=>e.user_lname=s)},null,8,["value"])]),_:1}),o(r,{label:"موبایل سرپرست کارگاه","validate-status":u.user_phone?"error":"",help:u.user_phone},{default:n(()=>[o(l,{value:e.user_phone,"onUpdate:value":a[4]||(a[4]=s=>e.user_phone=s)},null,8,["value"])]),_:1},8,["validate-status","help"])]),o(r,{label:"آدرس"},{default:n(()=>[o(k,{value:e.workshop_address,"onUpdate:value":a[5]||(a[5]=s=>e.workshop_address=s),"auto-size":{minRows:2,maxRows:5}},null,8,["value"])]),_:1})]),_:1},8,["open","id","loading","submitting"])):(U(),b(M,{key:1,spinning:i.value},{default:n(()=>[o(z,{layout:"vertical",onSubmit:E(m,["prevent"])},{default:n(()=>[o($,{title:g(d)?"ویرایش کارگاه":"افزودن کارگاه",class:"mb-base"},{default:n(()=>[x("div",D,[o(r,{label:"نام کارگاه","validate-status":u.workshop_name?"error":"",help:u.workshop_name},{default:n(()=>[o(l,{value:e.workshop_name,"onUpdate:value":a[7]||(a[7]=s=>e.workshop_name=s)},null,8,["value"])]),_:1},8,["validate-status","help"]),o(r,{label:"تلفن کارگاه"},{default:n(()=>[o(l,{value:e.workshop_phone,"onUpdate:value":a[8]||(a[8]=s=>e.workshop_phone=s)},null,8,["value"])]),_:1}),o(r,{label:"نام سرپرست کارگاه"},{default:n(()=>[o(l,{value:e.user_fname,"onUpdate:value":a[9]||(a[9]=s=>e.user_fname=s)},null,8,["value"])]),_:1}),o(r,{label:"نام خانوادگی سرپرست کارگاه"},{default:n(()=>[o(l,{value:e.user_lname,"onUpdate:value":a[10]||(a[10]=s=>e.user_lname=s)},null,8,["value"])]),_:1}),o(r,{label:"موبایل سرپرست کارگاه","validate-status":u.user_phone?"error":"",help:u.user_phone},{default:n(()=>[o(l,{value:e.user_phone,"onUpdate:value":a[11]||(a[11]=s=>e.user_phone=s)},null,8,["value"])]),_:1},8,["validate-status","help"])]),o(r,{label:"آدرس"},{default:n(()=>[o(k,{value:e.workshop_address,"onUpdate:value":a[12]||(a[12]=s=>e.workshop_address=s),"auto-size":{minRows:2,maxRows:5}},null,8,["value"])]),_:1}),o(C,{type:"primary",onClick:m},{default:n(()=>[...a[13]||(a[13]=[A("ثبت اطلاعات",-1)])]),_:1})]),_:1},8,["title"])]),_:1})]),_:1},8,["spinning"]))}}});export{H as _};
|
||||
@@ -0,0 +1 @@
|
||||
.stats[data-v-726ef090]{display:flex;gap:.5rem}.mt-4[data-v-726ef090]{margin-top:1rem}
|
||||
@@ -1 +0,0 @@
|
||||
.stats[data-v-0c792cd8]{display:flex;gap:.5rem}.mt-4[data-v-0c792cd8]{margin-top:1rem}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as D,v as S,x as A,a as x,w as a,j as F,l as y,r as d,o as i,c as o,f as l,t as s,n as E,b as p,F as f,h as I,i as k}from"./index-WFQJAeoE.js";import{j}from"./filters-C1cWKkpl.js";import{_ as M}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./index-1e_FodC0.js";const R={class:"stats mt-4"},T=D({__name:"AgentDetail",setup($){const h=F().params.id,m=y(!1),n=y(void 0),C=[{title:"نام",dataIndex:"name"},{title:"موبایل",dataIndex:"mobile"},{title:"شهر",dataIndex:"city"},{title:"نوع",dataIndex:"type_str"},{title:"وضعیت",dataIndex:"active"},{title:"تاریخ ثبت",dataIndex:"caj"}],w=[{title:"شماره سفارش",dataIndex:"name"},{title:"مشتری",dataIndex:"customer"},{title:"وزن",dataIndex:"w"},{title:"وضعیت",dataIndex:"status"},{title:"تاریخ",dataIndex:"caj"}];return S(async()=>{try{m.value=!0;const{data:_}=await A.get(`admin/customers-omde/reagent/${h}`);n.value=_}catch(_){console.log(_)}finally{m.value=!1}}),(_,G)=>{const c=d("a-descriptions-item"),u=d("a-tag"),z=d("a-descriptions"),B=d("a-card"),v=d("a-table"),g=d("a-tab-pane"),N=d("a-tabs"),V=d("a-spin");return i(),x(V,{spinning:m.value},{default:a(()=>[o(B,{title:"مشاهده اطلاعات کارشناس فروش"},{default:a(()=>[o(z,{bordered:"",size:"small",column:3},{default:a(()=>[o(c,{label:"نام"},{default:a(()=>{var e;return[l(s(((e=n.value)==null?void 0:e.name)??"-"),1)]}),_:1}),o(c,{label:"موبایل"},{default:a(()=>{var e;return[l(s(((e=n.value)==null?void 0:e.mobile)??"-"),1)]}),_:1}),o(c,{label:"شعبه"},{default:a(()=>{var e,t;return[l(s(((t=(e=n.value)==null?void 0:e.branch)==null?void 0:t.name)??"-"),1)]}),_:1}),o(c,{label:"درصد کمیسیون"},{default:a(()=>{var e;return[l(s(((e=n.value)==null?void 0:e.percent)??"-"),1)]}),_:1}),o(c,{label:"وضعیت"},{default:a(()=>{var e;return[o(u,{color:((e=n.value)==null?void 0:e.active)===1?"green":"red"},{default:a(()=>{var t;return[l(s(((t=n.value)==null?void 0:t.active)===1?"فعال":"غیر فعال"),1)]}),_:1},8,["color"])]}),_:1}),o(c,{label:"میزان فروش (گرم)"},{default:a(()=>{var e;return[l(s(((e=n.value)==null?void 0:e.grams_sell)??0),1)]}),_:1})]),_:1}),E("div",R,[o(u,{color:"blue"},{default:a(()=>{var e,t;return[l("مشتریان معرفیشده: "+s(((t=(e=n.value)==null?void 0:e.referred_customers)==null?void 0:t.length)??0),1)]}),_:1}),o(u,{color:"green"},{default:a(()=>{var e,t;return[l("سفارشهای ثبتشده: "+s(((t=(e=n.value)==null?void 0:e.orders)==null?void 0:t.length)??0),1)]}),_:1})])]),_:1}),o(N,{class:"mt-4","default-active-key":"referred"},{default:a(()=>[o(g,{key:"referred",tab:"مشتریان معرفیشده"},{default:a(()=>{var e;return[o(v,{size:"small","data-source":(e=n.value)==null?void 0:e.referred_customers,columns:C,pagination:{pageSize:10},"row-key":"id"},{bodyCell:a(({column:t,record:r})=>{var b;return[t.dataIndex==="active"?(i(),x(u,{key:0,color:r.active===1?"green":"red"},{default:a(()=>[l(s(r.active===1?"فعال":"غیر فعال"),1)]),_:2},1032,["color"])):t.dataIndex==="city"?(i(),p(f,{key:1},[l(s(((b=r.city)==null?void 0:b.title)??"-"),1)],64)):t.dataIndex==="caj"?(i(),p(f,{key:2},[l(s(I(j)(r.caj)),1)],64)):k("",!0)]}),_:1},8,["data-source"])]}),_:1}),o(g,{key:"orders",tab:"سفارشهای مشتریان"},{default:a(()=>{var e;return[o(v,{size:"small","data-source":(e=n.value)==null?void 0:e.orders,columns:w,pagination:{pageSize:10},"row-key":"id"},{bodyCell:a(({column:t,record:r})=>[t.dataIndex==="caj"?(i(),p(f,{key:0},[l(s(I(j)(r.caj)),1)],64)):k("",!0)]),_:1},8,["data-source"])]}),_:1})]),_:1})]),_:1},8,["spinning"])}}}),O=M(T,[["__scopeId","data-v-0c792cd8"]]);export{O as default};
|
||||
import{d as D,v as S,x as A,a as x,w as a,j as F,l as y,r as d,o as i,c as o,f as l,t as s,n as E,b as p,F as f,h as I,i as k}from"./index-CVG99b4v.js";import{j}from"./filters-UavLT20t.js";import{_ as M}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./index-pLFqZCCf.js";const R={class:"stats mt-4"},T=D({__name:"AgentDetail",setup($){const h=F().params.id,m=y(!1),n=y(void 0),C=[{title:"نام",dataIndex:"name"},{title:"موبایل",dataIndex:"mobile"},{title:"شهر",dataIndex:"city"},{title:"نوع",dataIndex:"type_str"},{title:"وضعیت",dataIndex:"active"},{title:"تاریخ ثبت",dataIndex:"caj"}],w=[{title:"شماره سفارش",dataIndex:"name"},{title:"مشتری",dataIndex:"customer"},{title:"وزن",dataIndex:"w"},{title:"وضعیت",dataIndex:"status"},{title:"تاریخ",dataIndex:"caj"}];return S(async()=>{try{m.value=!0;const{data:_}=await A.get(`admin/customers-omde/reagent/${h}`);n.value=_}catch(_){console.log(_)}finally{m.value=!1}}),(_,G)=>{const c=d("a-descriptions-item"),u=d("a-tag"),z=d("a-descriptions"),B=d("a-card"),v=d("a-table"),g=d("a-tab-pane"),N=d("a-tabs"),V=d("a-spin");return i(),x(V,{spinning:m.value},{default:a(()=>[o(B,{title:"مشاهده اطلاعات کارشناس فروش"},{default:a(()=>[o(z,{bordered:"",size:"small",column:3},{default:a(()=>[o(c,{label:"نام"},{default:a(()=>{var e;return[l(s(((e=n.value)==null?void 0:e.name)??"-"),1)]}),_:1}),o(c,{label:"موبایل"},{default:a(()=>{var e;return[l(s(((e=n.value)==null?void 0:e.mobile)??"-"),1)]}),_:1}),o(c,{label:"شعبه"},{default:a(()=>{var e,t;return[l(s(((t=(e=n.value)==null?void 0:e.branch)==null?void 0:t.name)??"-"),1)]}),_:1}),o(c,{label:"درصد کمیسیون"},{default:a(()=>{var e;return[l(s(((e=n.value)==null?void 0:e.percent)??"-"),1)]}),_:1}),o(c,{label:"وضعیت"},{default:a(()=>{var e;return[o(u,{color:((e=n.value)==null?void 0:e.active)===1?"green":"red"},{default:a(()=>{var t;return[l(s(((t=n.value)==null?void 0:t.active)===1?"فعال":"غیر فعال"),1)]}),_:1},8,["color"])]}),_:1}),o(c,{label:"میزان فروش (گرم)"},{default:a(()=>{var e;return[l(s(((e=n.value)==null?void 0:e.grams_sell)??0),1)]}),_:1})]),_:1}),E("div",R,[o(u,{color:"blue"},{default:a(()=>{var e,t;return[l("مشتریان معرفیشده: "+s(((t=(e=n.value)==null?void 0:e.referred_customers)==null?void 0:t.length)??0),1)]}),_:1}),o(u,{color:"green"},{default:a(()=>{var e,t;return[l("سفارشهای ثبتشده: "+s(((t=(e=n.value)==null?void 0:e.orders)==null?void 0:t.length)??0),1)]}),_:1})])]),_:1}),o(N,{class:"mt-4","default-active-key":"referred"},{default:a(()=>[o(g,{key:"referred",tab:"مشتریان معرفیشده"},{default:a(()=>{var e;return[o(v,{size:"small","data-source":(e=n.value)==null?void 0:e.referred_customers,columns:C,pagination:{pageSize:10},"row-key":"id"},{bodyCell:a(({column:t,record:r})=>{var b;return[t.dataIndex==="active"?(i(),x(u,{key:0,color:r.active===1?"green":"red"},{default:a(()=>[l(s(r.active===1?"فعال":"غیر فعال"),1)]),_:2},1032,["color"])):t.dataIndex==="city"?(i(),p(f,{key:1},[l(s(((b=r.city)==null?void 0:b.title)??"-"),1)],64)):t.dataIndex==="caj"?(i(),p(f,{key:2},[l(s(I(j)(r.caj)),1)],64)):k("",!0)]}),_:1},8,["data-source"])]}),_:1}),o(g,{key:"orders",tab:"سفارشهای مشتریان"},{default:a(()=>{var e;return[o(v,{size:"small","data-source":(e=n.value)==null?void 0:e.orders,columns:w,pagination:{pageSize:10},"row-key":"id"},{bodyCell:a(({column:t,record:r})=>[t.dataIndex==="caj"?(i(),p(f,{key:0},[l(s(I(j)(r.caj)),1)],64)):k("",!0)]),_:1},8,["data-source"])]}),_:1})]),_:1})]),_:1},8,["spinning"])}}}),O=M(T,[["__scopeId","data-v-726ef090"]]);export{O as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{b as r,O as i,_ as m}from"./omdeListModel-B-zNFWRI.js";import{d as a,a as n,h as t,o as s}from"./index-WFQJAeoE.js";import"./model-Di_BQPv1.js";import"./SettingOutlined-DZJd42S-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListPageHeader.vue_vue_type_script_setup_true_lang-BmENA4yH.js";import"./bulkCustomer.vue_vue_type_script_setup_true_lang-zBMtv664.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-BQ_i_QZe.js";import"./UnorderedListOutlined-CvD227Uu.js";const C=a({__name:"BankerList",setup(p){const o=i.banker.title,e=r("banker");return(l,_)=>(s(),n(m,{title:t(o),model:t(e)},null,8,["title","model"]))}});export{C as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{b as e,O as i,_ as m}from"./omdeListModel-C6pAmqnF.js";import{d as p,a,h as t,o as n}from"./index-CVG99b4v.js";import"./model-CvqTGmy8.js";import"./filters-UavLT20t.js";import"./index-pLFqZCCf.js";import"./SettingOutlined-D7--Xtqg.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListPageHeader.vue_vue_type_script_setup_true_lang-CetMN4WH.js";import"./AccountingSyncButton.vue_vue_type_script_setup_true_lang-DYPt-3CU.js";import"./bulkCustomer.vue_vue_type_script_setup_true_lang-BLZHRH0s.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-C8WW9alD.js";import"./CityTreeSelect.vue_vue_type_script_setup_true_lang-Ctf4a2EQ.js";import"./DateInput-P3xqxLM7.js";import"./UnorderedListOutlined-CKa6XzC7.js";const D=p({__name:"BankerList",setup(s){const o=i.banker.title,r=e("banker");return(l,_)=>(n(),a(m,{title:t(o),model:t(r)},null,8,["title","model"]))}});export{D as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as r,a as g,w as o,r as a,o as k,c as l,V as x}from"./index-WFQJAeoE.js";const B=r({__name:"BaseFormModal",props:{open:{type:Boolean},id:{default:void 0},addTitle:{},editTitle:{},loading:{type:Boolean,default:!1},submitting:{type:Boolean,default:!1},width:{default:"md"},okText:{default:"ثبت اطلاعات"}},emits:["update:open","submit","cancel"],setup(e,{emit:d}){const n=d,s={sm:520,md:720,lg:900,xl:1140};function m(t){n("update:open",t)}function c(){n("update:open",!1),n("cancel")}return(t,i)=>{const f=a("a-form"),u=a("a-spin"),p=a("a-modal");return k(),g(p,{open:e.open,title:e.id?e.editTitle:e.addTitle,width:s[e.width],"confirm-loading":e.submitting,"ok-text":e.okText,"cancel-text":"انصراف","mask-closable":!1,"onUpdate:open":m,onOk:i[0]||(i[0]=T=>t.$emit("submit")),onCancel:c},{default:o(()=>[l(u,{spinning:e.loading},{default:o(()=>[l(f,{layout:"vertical"},{default:o(()=>[x(t.$slots,"default")]),_:3})]),_:3},8,["spinning"])]),_:3},8,["open","title","width","confirm-loading","ok-text"])}}});export{B as _};
|
||||
import{d as r,a as g,w as o,r as a,o as k,c as l,Y as x}from"./index-CVG99b4v.js";const B=r({__name:"BaseFormModal",props:{open:{type:Boolean},id:{default:void 0},addTitle:{},editTitle:{},loading:{type:Boolean,default:!1},submitting:{type:Boolean,default:!1},width:{default:"md"},okText:{default:"ثبت اطلاعات"}},emits:["update:open","submit","cancel"],setup(e,{emit:d}){const n=d,s={sm:520,md:720,lg:900,xl:1140};function m(t){n("update:open",t)}function c(){n("update:open",!1),n("cancel")}return(t,i)=>{const f=a("a-form"),u=a("a-spin"),p=a("a-modal");return k(),g(p,{open:e.open,title:e.id?e.editTitle:e.addTitle,width:s[e.width],"confirm-loading":e.submitting,"ok-text":e.okText,"cancel-text":"انصراف","mask-closable":!1,"onUpdate:open":m,onOk:i[0]||(i[0]=T=>t.$emit("submit")),onCancel:c},{default:o(()=>[l(u,{spinning:e.loading},{default:o(()=>[l(f,{layout:"vertical"},{default:o(()=>[x(t.$slots,"default")]),_:3})]),_:3},8,["spinning"])]),_:3},8,["open","title","width","confirm-loading","ok-text"])}}});export{B as _};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as P,v as S,x as u,b as m,c as o,w as l,l as _,r as c,y as T,o as d,n as $,F as w,e as C,f as g,z,M as k,a as x,t as B}from"./index-WFQJAeoE.js";const D={id:"page-user-list"},E={class:"grid-3"},A=P({__name:"ChangePercent",setup(j){const y=_([]),b=_([]),p=_("-"),f=_(!1),a=T({category_id:void 0,brand_id:void 0,percent:void 0});function h(t,e){var r,s;return String(((s=(r=e==null?void 0:e.children)==null?void 0:r[0])==null?void 0:s.children)??"").toLowerCase().indexOf(t.toLowerCase())>=0}async function v(){try{const{data:t}=await u.post("change/percent/count",{category_id:a.category_id,brand_id:a.brand_id});p.value=t.count}catch(t){console.log("e ==> ",t)}}async function L(){if(a.percent===void 0||a.percent===null){z.error("لطفا اجرت درصدی را وارد کنید");return}try{f.value=!0;const{data:t}=await u.post("change/all",{percent:a.percent,category_id:a.category_id,brand_id:a.brand_id});k.success({title:"تغییرات با موفقیت اعمال شد",okText:"بستن"}),p.value=t.updated}catch(t){k.success({title:"خطا در اعمال تغییرات"}),console.log(t)}finally{f.value=!1}}return S(async()=>{try{const[t,e]=await Promise.all([u.get("brand"),u.post("category")]);y.value=t.data,b.value=(e.data.rows??e.data).map(r=>({id:r.id,title:r.type_str?`${r.title} (${r.type_str}) `:r.title}))}catch(t){console.log(t)}v()}),(t,e)=>{const r=c("a-select-option"),s=c("a-select"),i=c("a-form-item"),M=c("a-input"),N=c("a-input-number"),U=c("a-button"),V=c("a-popconfirm"),F=c("a-form"),O=c("a-card");return d(),m("div",D,[o(O,{title:"تغییر درصد محصولات"},{default:l(()=>[o(F,{layout:"vertical"},{default:l(()=>[$("div",E,[o(i,{label:"دسته بندی"},{default:l(()=>[o(s,{value:a.category_id,"onUpdate:value":e[0]||(e[0]=n=>a.category_id=n),"allow-clear":"","show-search":"",placeholder:"انتخاب کنید","filter-option":h,onChange:v},{default:l(()=>[(d(!0),m(w,null,C(b.value,n=>(d(),x(r,{key:n.id,value:n.id},{default:l(()=>[g(B(n.title),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1}),o(i,{label:"برند"},{default:l(()=>[o(s,{value:a.brand_id,"onUpdate:value":e[1]||(e[1]=n=>a.brand_id=n),"allow-clear":"","show-search":"",placeholder:"انتخاب کنید","filter-option":h,onChange:v},{default:l(()=>[(d(!0),m(w,null,C(y.value,n=>(d(),x(r,{key:n.id,value:n.id},{default:l(()=>[g(B(n.title),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1}),o(i,{label:"تعداد یافت شده"},{default:l(()=>[o(M,{value:p.value,disabled:""},null,8,["value"])]),_:1}),o(i,{label:"اجرت درصدی"},{default:l(()=>[o(N,{value:a.percent,"onUpdate:value":e[2]||(e[2]=n=>a.percent=n),class:"w-full",step:.1},null,8,["value"])]),_:1})]),o(V,{title:"آیا از اعمال تغییرات مطمئن هستید؟","ok-text":"بله","cancel-text":"خیر",onConfirm:L},{default:l(()=>[o(U,{type:"primary",loading:f.value},{default:l(()=>[...e[3]||(e[3]=[g("اعمال تغییرات",-1)])]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1})])}}});export{A as default};
|
||||
import{d as P,v as S,x as u,b as m,c as o,w as l,l as _,r as c,y as T,o as d,n as $,F as w,e as C,f as g,z,M as k,a as x,t as B}from"./index-CVG99b4v.js";const D={id:"page-user-list"},E={class:"grid-3"},A=P({__name:"ChangePercent",setup(j){const y=_([]),b=_([]),p=_("-"),f=_(!1),a=T({category_id:void 0,brand_id:void 0,percent:void 0});function h(t,e){var r,s;return String(((s=(r=e==null?void 0:e.children)==null?void 0:r[0])==null?void 0:s.children)??"").toLowerCase().indexOf(t.toLowerCase())>=0}async function v(){try{const{data:t}=await u.post("change/percent/count",{category_id:a.category_id,brand_id:a.brand_id});p.value=t.count}catch(t){console.log("e ==> ",t)}}async function L(){if(a.percent===void 0||a.percent===null){z.error("لطفا اجرت درصدی را وارد کنید");return}try{f.value=!0;const{data:t}=await u.post("change/all",{percent:a.percent,category_id:a.category_id,brand_id:a.brand_id});k.success({title:"تغییرات با موفقیت اعمال شد",okText:"بستن"}),p.value=t.updated}catch(t){k.success({title:"خطا در اعمال تغییرات"}),console.log(t)}finally{f.value=!1}}return S(async()=>{try{const[t,e]=await Promise.all([u.get("brand"),u.post("category")]);y.value=t.data,b.value=(e.data.rows??e.data).map(r=>({id:r.id,title:r.type_str?`${r.title} (${r.type_str}) `:r.title}))}catch(t){console.log(t)}v()}),(t,e)=>{const r=c("a-select-option"),s=c("a-select"),i=c("a-form-item"),M=c("a-input"),N=c("a-input-number"),U=c("a-button"),V=c("a-popconfirm"),F=c("a-form"),O=c("a-card");return d(),m("div",D,[o(O,{title:"تغییر درصد محصولات"},{default:l(()=>[o(F,{layout:"vertical"},{default:l(()=>[$("div",E,[o(i,{label:"دسته بندی"},{default:l(()=>[o(s,{value:a.category_id,"onUpdate:value":e[0]||(e[0]=n=>a.category_id=n),"allow-clear":"","show-search":"",placeholder:"انتخاب کنید","filter-option":h,onChange:v},{default:l(()=>[(d(!0),m(w,null,C(b.value,n=>(d(),x(r,{key:n.id,value:n.id},{default:l(()=>[g(B(n.title),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1}),o(i,{label:"برند"},{default:l(()=>[o(s,{value:a.brand_id,"onUpdate:value":e[1]||(e[1]=n=>a.brand_id=n),"allow-clear":"","show-search":"",placeholder:"انتخاب کنید","filter-option":h,onChange:v},{default:l(()=>[(d(!0),m(w,null,C(y.value,n=>(d(),x(r,{key:n.id,value:n.id},{default:l(()=>[g(B(n.title),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1}),o(i,{label:"تعداد یافت شده"},{default:l(()=>[o(M,{value:p.value,disabled:""},null,8,["value"])]),_:1}),o(i,{label:"اجرت درصدی"},{default:l(()=>[o(N,{value:a.percent,"onUpdate:value":e[2]||(e[2]=n=>a.percent=n),class:"w-full",step:.1},null,8,["value"])]),_:1})]),o(V,{title:"آیا از اعمال تغییرات مطمئن هستید؟","ok-text":"بله","cancel-text":"خیر",onConfirm:L},{default:l(()=>[o(U,{type:"primary",loading:f.value},{default:l(()=>[...e[3]||(e[3]=[g("اعمال تغییرات",-1)])]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1})])}}});export{A as default};
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{d as m,o as v,a as g,p as w,r as k}from"./index-CVG99b4v.js";const _=m({__name:"CityTreeSelect",props:{value:{},cities:{},parentPicker:{type:Boolean},excludeId:{},placeholder:{}},emits:["update:value","change"],setup(i,{emit:u}){const n=i,d=u,h=w(()=>{const l=new Set(n.cities.map(e=>e.id)),o=new Map;for(const e of n.cities){const a=e.parent&&l.has(e.parent)&&e.parent!==e.id?e.parent:null;o.has(a)||o.set(a,[]),o.get(a).push(e)}const r=new Set,p=(e,a)=>(o.get(e)??[]).filter(t=>!r.has(t.id)&&!(n.parentPicker&&t.id===n.excludeId)).map(t=>{r.add(t.id);const s=p(t.id,a+1),c={value:t.id,key:t.id,title:t.title};return s.length&&(c.children=s),!n.parentPicker&&a===0&&s.length&&(c.disabled=!0),c});return p(null,0)});function f(l){d("update:value",l??void 0),d("change",l??void 0)}return(l,o)=>{const r=k("a-tree-select");return v(),g(r,{value:i.value??void 0,"tree-data":h.value,"show-search":"","allow-clear":"","tree-default-expand-all":"","tree-node-filter-prop":"title","dropdown-style":{maxHeight:"400px",overflow:"auto"},placeholder:i.placeholder??"شهر را انتخاب کنید",class:"w-full","onUpdate:value":f},null,8,["value","tree-data","placeholder"])}}});export{_};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{c as u,I as l}from"./index-WFQJAeoE.js";var d={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-792 72h752v120H136V232zm752 560H136V440h752v352zm-237-64h165c4.4 0 8-3.6 8-8v-72c0-4.4-3.6-8-8-8H651c-4.4 0-8 3.6-8 8v72c0 4.4 3.6 8 8 8z"}}]},name:"credit-card",theme:"outlined"};function c(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.forEach(function(a){o(r,a,e[a])})}return r}function o(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var i=function(t,e){var n=c({},t,e.attrs);return u(l,c({},n,{icon:d}),null)};i.displayName="CreditCardOutlined";i.inheritAttrs=!1;export{i as C};
|
||||
import{c as u,I as l}from"./index-CVG99b4v.js";var d={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-792 72h752v120H136V232zm752 560H136V440h752v352zm-237-64h165c4.4 0 8-3.6 8-8v-72c0-4.4-3.6-8-8-8H651c-4.4 0-8 3.6-8 8v72c0 4.4 3.6 8 8 8z"}}]},name:"credit-card",theme:"outlined"};function c(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.forEach(function(a){o(r,a,e[a])})}return r}function o(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}var i=function(t,e){var n=c({},t,e.attrs);return u(l,c({},n,{icon:d}),null)};i.displayName="CreditCardOutlined";i.inheritAttrs=!1;export{i as C};
|
||||
@@ -0,0 +1 @@
|
||||
.mt-4[data-v-c1985092]{margin-top:1rem}.mt-2[data-v-c1985092]{margin-top:.5rem}.ms-2[data-v-c1985092]{margin-inline-start:.5rem}.muted[data-v-c1985092]{color:#888}.small[data-v-c1985092]{font-size:12px}.warn[data-v-c1985092]{color:#d4380d}.debt[data-v-c1985092]{color:#cf1322}.credit[data-v-c1985092]{color:#389e0d}.stats[data-v-6d44e777]{display:flex;gap:.5rem}.mt-4[data-v-6d44e777]{margin-top:1rem}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.stats[data-v-9dee124b]{display:flex;gap:.5rem}.mt-4[data-v-9dee124b]{margin-top:1rem}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
.stat-card[data-v-2ccaa937]{height:100%}.stat-row[data-v-2ccaa937]{display:flex;align-items:center;gap:1rem}.stat-icon[data-v-2ccaa937]{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;font-size:22px;flex-shrink:0}.icon-primary[data-v-2ccaa937]{background:#1c2d561a;color:#1c2d56}.icon-warning[data-v-2ccaa937]{background:#ff9f431f;color:#ff9f43}.icon-success[data-v-2ccaa937]{background:#28c76f1f;color:#28c76f}.icon-danger[data-v-2ccaa937]{background:#ea54551f;color:#ea5455}.stat-value[data-v-2ccaa937]{margin:0;font-size:20px;color:#1c2d56}.stat-title[data-v-2ccaa937]{font-size:12px;color:#888}.mt-4[data-v-585a18f1]{margin-top:1rem}.mt-3[data-v-585a18f1]{margin-top:.75rem}
|
||||
@@ -1 +0,0 @@
|
||||
.stat-card[data-v-ebefdc7b]{height:100%}.stat-row[data-v-ebefdc7b]{display:flex;align-items:center;gap:1rem}.stat-icon[data-v-ebefdc7b]{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:50%;font-size:22px;flex-shrink:0}.icon-primary[data-v-ebefdc7b]{background:#1c2d561a;color:#1c2d56}.icon-warning[data-v-ebefdc7b]{background:#ff9f431f;color:#ff9f43}.icon-success[data-v-ebefdc7b]{background:#28c76f1f;color:#28c76f}.icon-danger[data-v-ebefdc7b]{background:#ea54551f;color:#ea5455}.stat-value[data-v-ebefdc7b]{margin:0;font-size:20px;color:#1c2d56}.stat-title[data-v-ebefdc7b]{font-size:12px;color:#888}.mt-4[data-v-92a6e636]{margin-top:1rem}.mt-3[data-v-92a6e636]{margin-top:.75rem}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
.hint[data-v-3863c3bc]{color:#ea5455;font-size:11px}
|
||||
@@ -1 +0,0 @@
|
||||
.hint[data-v-42b77d70]{color:#ea5455;font-size:11px}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{m}from"./index-1e_FodC0.js";import{d as _,m as V,o as r,a as Y,w as h,c as D,b,t as j,i as M,l as i,p as x,r as d}from"./index-WFQJAeoE.js";import{_ as y}from"./_plugin-vue_export-helper-DlAUqK2U.js";const k={key:0,class:"hint"},C=_({__name:"DateInput",props:{label:{},modelValue:{},placeholder:{default:"مثال: ۱۴۰۳/۰۵/۱۲"}},emits:["update:modelValue"],setup(o,{emit:p}){const n=o,u=p,t=i(void 0),a=i(""),f=x(()=>{if(t.value!==void 0)return t.value;if(!n.modelValue)return"";const e=m(n.modelValue);return e.isValid()?e.format("jYYYY/jMM/jDD"):""});V(()=>n.modelValue,()=>{t.value=void 0});function v(e){if(t.value=e,!e){a.value="",u("update:modelValue",void 0);return}const c=e.replace(/[۰-۹]/g,s=>String("۰۱۲۳۴۵۶۷۸۹".indexOf(s))),l=m(c,"jYYYY/jMM/jDD");l.isValid()?(a.value="",u("update:modelValue",l.format("YYYY-MM-DD"))):a.value="تاریخ معتبر نیست"}return(e,c)=>{const l=d("a-input"),s=d("a-form-item");return r(),Y(s,{label:o.label},{default:h(()=>[D(l,{value:f.value,placeholder:o.placeholder,"allow-clear":"","onUpdate:value":v},null,8,["value","placeholder"]),a.value?(r(),b("small",k,j(a.value),1)):M("",!0)]),_:1},8,["label"])}}}),w=y(C,[["__scopeId","data-v-42b77d70"]]);export{w as D};
|
||||
import{m}from"./index-pLFqZCCf.js";import{d as _,m as V,o as r,a as Y,w as h,c as D,b,t as j,i as M,l as i,p as x,r as d}from"./index-CVG99b4v.js";import{_ as y}from"./_plugin-vue_export-helper-DlAUqK2U.js";const k={key:0,class:"hint"},C=_({__name:"DateInput",props:{label:{},modelValue:{},placeholder:{default:"مثال: ۱۴۰۳/۰۵/۱۲"}},emits:["update:modelValue"],setup(o,{emit:p}){const n=o,c=p,t=i(void 0),a=i(""),f=x(()=>{if(t.value!==void 0)return t.value;if(!n.modelValue)return"";const e=m(n.modelValue);return e.isValid()?e.format("jYYYY/jMM/jDD"):""});V(()=>n.modelValue,()=>{t.value=void 0});function v(e){if(t.value=e,!e){a.value="",c("update:modelValue",void 0);return}const u=e.replace(/[۰-۹]/g,s=>String("۰۱۲۳۴۵۶۷۸۹".indexOf(s))),l=m(u,"jYYYY/jMM/jDD");l.isValid()?(a.value="",c("update:modelValue",l.format("YYYY-MM-DD"))):a.value="تاریخ معتبر نیست"}return(e,u)=>{const l=d("a-input"),s=d("a-form-item");return r(),Y(s,{label:o.label},{default:h(()=>[D(l,{value:f.value,placeholder:o.placeholder,"allow-clear":"","onUpdate:value":v},null,8,["value","placeholder"]),a.value?(r(),b("small",k,j(a.value),1)):M("",!0)]),_:1},8,["label"])}}}),w=y(C,[["__scopeId","data-v-3863c3bc"]]);export{w as D};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as o}from"./Add.vue_vue_type_script_setup_true_lang-BP3ofJiO.js";import{d as t,a as e,o as r}from"./index-WFQJAeoE.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-BQ_i_QZe.js";const i=t({__name:"Edit",setup(a){return(_,m)=>(r(),e(o))}});export{i as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as o}from"./Add.vue_vue_type_script_setup_true_lang-Ct9fNasS.js";import{d as t,a as e,o as r}from"./index-CVG99b4v.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-C8WW9alD.js";const i=t({__name:"Edit",setup(a){return(_,m)=>(r(),e(o))}});export{i as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e}from"./AddBranches.vue_vue_type_script_setup_true_lang-DZPeg6FI.js";import{d as o,a,o as r}from"./index-CVG99b4v.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";const p=o({__name:"EditBranches",setup(t){return(n,s)=>(r(),a(e))}});export{p as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e}from"./AddBranches.vue_vue_type_script_setup_true_lang-BTBcvf9O.js";import{d as o,a,o as r}from"./index-WFQJAeoE.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";const p=o({__name:"EditBranches",setup(t){return(n,s)=>(r(),a(e))}});export{p as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as o}from"./bulkCustomer.vue_vue_type_script_setup_true_lang-BLZHRH0s.js";import{d as t,a as r,o as m}from"./index-CVG99b4v.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-C8WW9alD.js";import"./CityTreeSelect.vue_vue_type_script_setup_true_lang-Ctf4a2EQ.js";import"./DateInput-P3xqxLM7.js";import"./index-pLFqZCCf.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const l=t({__name:"EditBulkCustomer",setup(e){return(p,a)=>(m(),r(o))}});export{l as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as o}from"./bulkCustomer.vue_vue_type_script_setup_true_lang-zBMtv664.js";import{d as t,a as e,o as r}from"./index-WFQJAeoE.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-BQ_i_QZe.js";const i=t({__name:"EditBulkCustomer",setup(a){return(m,s)=>(r(),e(o))}});export{i as default};
|
||||
@@ -1 +0,0 @@
|
||||
import o from"./AddInvoice-BO7d-BCP.js";import{d as t,a as e,o as r}from"./index-WFQJAeoE.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";import"./model-Di_BQPv1.js";import"./SettingOutlined-DZJd42S-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const f=t({__name:"EditInvoice",setup(p){return(i,m)=>(r(),e(o))}});export{f as default};
|
||||
@@ -0,0 +1 @@
|
||||
import o from"./AddInvoice-ErZYOCpz.js";import{d as t,a as r,o as e}from"./index-CVG99b4v.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";import"./model-CvqTGmy8.js";import"./filters-UavLT20t.js";import"./index-pLFqZCCf.js";import"./SettingOutlined-D7--Xtqg.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const l=t({__name:"EditInvoice",setup(p){return(i,m)=>(e(),r(o))}});export{l as default};
|
||||
@@ -0,0 +1 @@
|
||||
import e from"./AddProduct-DYRcWcLI.js";import{d as o,b as t,c as r,o as c}from"./index-CVG99b4v.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-C8WW9alD.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const _=o({__name:"EditProduct",setup(a){return(n,d)=>(c(),t("div",null,[r(e)]))}});export{_ as default};
|
||||
@@ -1 +0,0 @@
|
||||
import e from"./AddProduct-tKobI_Dp.js";import{d as o,b as t,c as r,o as c}from"./index-WFQJAeoE.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-BQ_i_QZe.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const _=o({__name:"EditProduct",setup(a){return(n,d)=>(c(),t("div",null,[r(e)]))}});export{_ as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{R as e}from"./ReagentCustomer-DcWF6RQp.js";import{d as t,a as o,o as r}from"./index-CVG99b4v.js";import"./CityTreeSelect.vue_vue_type_script_setup_true_lang-Ctf4a2EQ.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-C8WW9alD.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const f=t({__name:"EditReagent",setup(a){return(m,n)=>(r(),o(e))}});export{f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{R as e}from"./ReagentCustomer-BUrwCRTH.js";import{d as t,a as o,o as r}from"./index-WFQJAeoE.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-BQ_i_QZe.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const i=t({__name:"EditReagent",setup(a){return(n,m)=>(r(),o(e))}});export{i as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as o}from"./singleCustomer.vue_vue_type_script_setup_true_lang-BCru8Kun.js";import{d as t,a as r,o as e}from"./index-CVG99b4v.js";import"./CityTreeSelect.vue_vue_type_script_setup_true_lang-Ctf4a2EQ.js";import"./DateInput-P3xqxLM7.js";import"./index-pLFqZCCf.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const u=t({__name:"EditSingleCustomer",setup(m){return(a,p)=>(e(),r(o))}});export{u as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e}from"./singleCustomer.vue_vue_type_script_setup_true_lang-6EgeQ9yM.js";import{d as o,a as t,o as a}from"./index-WFQJAeoE.js";const m=o({__name:"EditSingleCustomer",setup(r){return(n,s)=>(a(),t(e))}});export{m as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as o}from"./AddWorkshop.vue_vue_type_script_setup_true_lang-DM0hJwHH.js";import{d as e,a as r,o as t}from"./index-CVG99b4v.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";const m=e({__name:"EditWorkshop",setup(a){return(s,_)=>(t(),r(o))}});export{m as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as o}from"./AddWorkshop.vue_vue_type_script_setup_true_lang-BXy9e7qX.js";import{d as e,a as r,o as t}from"./index-WFQJAeoE.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";const m=e({__name:"EditWorkshop",setup(a){return(s,_)=>(t(),r(o))}});export{m as default};
|
||||
@@ -1 +0,0 @@
|
||||
.full-page-msg[data-v-4851d61e]{min-height:100vh;display:flex;align-items:center;justify-content:center}
|
||||
@@ -0,0 +1 @@
|
||||
.full-page-msg[data-v-82a95474]{min-height:100vh;display:flex;align-items:center;justify-content:center}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{_}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{b as c,c as e,w as o,f as l,r as s,o as p}from"./index-WFQJAeoE.js";const u={},d={class:"full-page-msg"};function i(r,t){const n=s("a-button"),a=s("a-result");return p(),c("div",d,[e(a,{status:"404",title:"صفحه مورد نظر یافت نشد","sub-title":"آدرسی که وارد کردهاید وجود ندارد."},{extra:o(()=>[e(n,{type:"primary",onClick:t[0]||(t[0]=m=>r.$router.push("/"))},{default:o(()=>[...t[1]||(t[1]=[l("بازگشت به خانه",-1)])]),_:1})]),_:1})])}const b=_(u,[["render",i],["__scopeId","data-v-4851d61e"]]);export{b as default};
|
||||
import{_}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{b as c,c as e,w as o,f as l,r as s,o as p}from"./index-CVG99b4v.js";const u={},i={class:"full-page-msg"};function m(r,t){const a=s("a-button"),n=s("a-result");return p(),c("div",i,[e(n,{status:"404",title:"صفحه مورد نظر یافت نشد","sub-title":"آدرسی که وارد کردهاید وجود ندارد."},{extra:o(()=>[e(a,{type:"primary",onClick:t[0]||(t[0]=d=>r.$router.push("/"))},{default:o(()=>[...t[1]||(t[1]=[l("بازگشت به خانه",-1)])]),_:1})]),_:1})])}const b=_(u,[["render",m],["__scopeId","data-v-82a95474"]]);export{b as default};
|
||||
@@ -1 +0,0 @@
|
||||
.full-page-msg[data-v-abbac884]{min-height:100vh;display:flex;align-items:center;justify-content:center}
|
||||
@@ -0,0 +1 @@
|
||||
.full-page-msg[data-v-1080291a]{min-height:100vh;display:flex;align-items:center;justify-content:center}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{_}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{b as c,c as e,w as o,f as l,r as s,o as p}from"./index-WFQJAeoE.js";const u={},i={class:"full-page-msg"};function m(r,t){const a=s("a-button"),n=s("a-result");return p(),c("div",i,[e(n,{status:"500",title:"خطای سرور","sub-title":"مشکلی در سرور رخ داده است. لطفاً بعداً تلاش کنید."},{extra:o(()=>[e(a,{type:"primary",onClick:t[0]||(t[0]=d=>r.$router.push("/"))},{default:o(()=>[...t[1]||(t[1]=[l("بازگشت به خانه",-1)])]),_:1})]),_:1})])}const x=_(u,[["render",m],["__scopeId","data-v-abbac884"]]);export{x as default};
|
||||
import{_}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{b as c,c as e,w as o,f as l,r as s,o as p}from"./index-CVG99b4v.js";const u={},i={class:"full-page-msg"};function m(r,t){const a=s("a-button"),n=s("a-result");return p(),c("div",i,[e(n,{status:"500",title:"خطای سرور","sub-title":"مشکلی در سرور رخ داده است. لطفاً بعداً تلاش کنید."},{extra:o(()=>[e(a,{type:"primary",onClick:t[0]||(t[0]=d=>r.$router.push("/"))},{default:o(()=>[...t[1]||(t[1]=[l("بازگشت به خانه",-1)])]),_:1})]),_:1})])}const b=_(u,[["render",m],["__scopeId","data-v-1080291a"]]);export{b as default};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{d as E,a as i,w as l,r as C,o as s,c as d,W as P,n as w,h as r,E as h,K as B,J as L,V as S,l as p,x as V,z as y,k as A}from"./index-WFQJAeoE.js";import{X as I}from"./model-Di_BQPv1.js";import{_ as N}from"./ListPageHeader.vue_vue_type_script_setup_true_lang-BmENA4yH.js";const X={class:"flex gap-2"},K=E({__name:"FacilityList",props:{title:{},model:{},editPath:{},activePath:{},addRid:{},addLabel:{}},setup(a){const k=a,$=A(),f=p(null),c=p(!1),m=p(void 0);function _(){m.value=void 0,c.value=!0}function b(e){m.value=e,c.value=!0}function g(e){c.value=e}function O(){var e;(e=f.value)==null||e.fetch()}function R(e){$.push(`${k.editPath}/${e}`)}async function x(e){var o,n,u;try{await V.get(`${k.activePath}/${e}`),y.success("تغییرات ثبت شد"),(o=f.value)==null||o.fetch()}catch(t){y.error(((u=(n=t==null?void 0:t.response)==null?void 0:n.data)==null?void 0:u.message)??"خطا در تغییر وضعیت")}}return(e,o)=>{const n=C("a-tooltip"),u=C("a-card");return s(),i(u,{title:a.title},{default:l(()=>[d(I,{ref_key:"tbl",ref:f,model:a.model},P({actions:l(({record:t})=>[w("div",X,[a.addRid?(s(),i(n,{key:0,title:"ویرایش"},{default:l(()=>[d(r(h),{class:"cursor-pointer mx-1 text-primary",onClick:v=>b(t.id)},null,8,["onClick"])]),_:2},1024)):(s(),i(n,{key:1,title:"ویرایش"},{default:l(()=>[d(r(h),{class:"cursor-pointer mx-1 text-primary",onClick:v=>R(t.id)},null,8,["onClick"])]),_:2},1024)),d(n,{title:"وضعیت"},{default:l(()=>[t.is_active?(s(),i(r(B),{key:0,class:"cursor-pointer mx-1 text-success",onClick:v=>x(t.id)},null,8,["onClick"])):(s(),i(r(L),{key:1,class:"cursor-pointer mx-1 text-danger",onClick:v=>x(t.id)},null,8,["onClick"]))]),_:2},1024)])]),_:2},[a.addRid?{name:"add",fn:l(()=>[d(N,{rid:a.addRid,"add-label":a.addLabel,onAdd:o[0]||(o[0]=t=>_())},null,8,["rid","add-label"])]),key:"0"}:void 0]),1032,["model"]),S(e.$slots,"form",{open:c.value,editingId:m.value,onUpdateOpen:g,onSuccess:O})]),_:3},8,["title"])}}});export{K as _};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{d as E,a as i,w as l,r as C,o as s,c as d,_ as L,n as P,h as r,E as h,N as w,L as B,Y as N,l as p,x as S,z as y,k as A}from"./index-CVG99b4v.js";import{X as I}from"./model-CvqTGmy8.js";import{_ as V}from"./ListPageHeader.vue_vue_type_script_setup_true_lang-CetMN4WH.js";const X={class:"flex gap-2"},U=E({__name:"FacilityList",props:{title:{},model:{},editPath:{},activePath:{},addRid:{},addLabel:{}},setup(a){const k=a,_=A(),f=p(null),c=p(!1),m=p(void 0);function $(){m.value=void 0,c.value=!0}function b(e){m.value=e,c.value=!0}function g(e){c.value=e}function O(){var e;(e=f.value)==null||e.fetch()}function R(e){_.push(`${k.editPath}/${e}`)}async function x(e){var o,n,u;try{await S.get(`${k.activePath}/${e}`),y.success("تغییرات ثبت شد"),(o=f.value)==null||o.fetch()}catch(t){y.error(((u=(n=t==null?void 0:t.response)==null?void 0:n.data)==null?void 0:u.message)??"خطا در تغییر وضعیت")}}return(e,o)=>{const n=C("a-tooltip"),u=C("a-card");return s(),i(u,{title:a.title},{default:l(()=>[d(I,{ref_key:"tbl",ref:f,model:a.model},L({actions:l(({record:t})=>[P("div",X,[a.addRid?(s(),i(n,{key:0,title:"ویرایش"},{default:l(()=>[d(r(h),{class:"cursor-pointer mx-1 text-primary",onClick:v=>b(t.id)},null,8,["onClick"])]),_:2},1024)):(s(),i(n,{key:1,title:"ویرایش"},{default:l(()=>[d(r(h),{class:"cursor-pointer mx-1 text-primary",onClick:v=>R(t.id)},null,8,["onClick"])]),_:2},1024)),d(n,{title:"وضعیت"},{default:l(()=>[t.is_active?(s(),i(r(w),{key:0,class:"cursor-pointer mx-1 text-success",onClick:v=>x(t.id)},null,8,["onClick"])):(s(),i(r(B),{key:1,class:"cursor-pointer mx-1 text-danger",onClick:v=>x(t.id)},null,8,["onClick"]))]),_:2},1024)])]),_:2},[a.addRid?{name:"add",fn:l(()=>[d(V,{rid:a.addRid,"add-label":a.addLabel,onAdd:o[0]||(o[0]=t=>$())},null,8,["rid","add-label"])]),key:"0"}:void 0]),1032,["model"]),N(e.$slots,"form",{open:c.value,editingId:m.value,onUpdateOpen:g,onSuccess:O})]),_:3},8,["title"])}}});export{U as _};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{_ as o}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{b as t,c as r,r as c,o as s}from"./index-WFQJAeoE.js";const n={},a={class:"layout--full-page"};function _(l,f){const e=c("router-view");return s(),t("div",a,[r(e)])}const p=o(n,[["render",_]]);export{p as default};
|
||||
import{_ as o}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{b as t,c as r,r as c,o as s}from"./index-CVG99b4v.js";const n={},a={class:"layout--full-page"};function _(l,f){const e=c("router-view");return s(),t("div",a,[r(e)])}const p=o(n,[["render",_]]);export{p as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as c,v as r,x as n,b as i,k as d,o as l}from"./index-CVG99b4v.js";import{u as m}from"./auth-Cu4qHRNu.js";const u={style:{"min-height":"100vh",display:"grid","place-items":"center"}},g=c({__name:"IamCallback",setup(p){const t=d(),o=m();return r(async()=>{const e=new URLSearchParams(window.location.search);if(sessionStorage.setItem("gb_admin_iam_sso_checked","1"),e.get("error")||!e.get("code")||!e.get("state")){await t.replace("/auth/login");return}try{const{data:s}=await n.post("admin/auth/sso/callback",{code:e.get("code"),state:e.get("state")}),a={...s};delete a.roles,delete a.ut,o.inject(a),await t.replace("/dashboard/ecommerce")}catch{await t.replace("/auth/login")}}),(e,s)=>(l(),i("div",u,"در حال ورود..."))}});export{g as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as B,m as P,o as u,b as r,c as m,w as h,a as N,h as b,P as z,n as g,t as D,i as I,l as i,p as R,x as S,z as U,r as f}from"./index-WFQJAeoE.js";const q={class:"image-upload"},E={key:0},F={key:1},L={style:{"margin-top":"8px"}},O=["src"],j=B({__name:"ImageUploadInput",props:{modelValue:{default:null},purpose:{default:void 0},placeholder:{default:"بارگذاری"}},emits:["update:modelValue","ok"],setup(w,{emit:y}){const l=w,p=y,c=i(!1),d=i(!1),v=i(""),o=i([]);P(()=>l.modelValue,e=>{var a;e?((a=o.value[0])==null?void 0:a.url)!==e&&(o.value=[{uid:e,name:e.split("/").pop()??"file",status:"done",url:e}]):o.value=[]},{immediate:!0});const V=R(()=>l.placeholder);async function k({file:e}){var s,n;const a=new FormData;a.append("file",e),l.purpose&&a.append("purpose",l.purpose),c.value=!0;try{const{data:t}=await S.post("file/create",a);p("update:modelValue",t.url),p("ok",t)}catch(t){const _=((n=(s=t==null?void 0:t.response)==null?void 0:s.data)==null?void 0:n.message)??"بارگذاری فایل ناموفق بود";U.error(_)}finally{c.value=!1}}function x(){return p("update:modelValue",null),!0}function C(e){v.value=e.url,d.value=!0}return(e,a)=>{const s=f("a-spin"),n=f("a-upload"),t=f("a-modal");return u(),r("div",q,[m(n,{"file-list":o.value,"list-type":"picture-card","max-count":1,accept:"image/*","custom-request":k,onRemove:x,onPreview:C},{default:h(()=>[o.value.length===0?(u(),r("div",E,[c.value?(u(),N(s,{key:0,size:"small"})):(u(),r("div",F,[m(b(z)),g("div",L,D(V.value),1)]))])):I("",!0)]),_:1},8,["file-list"]),m(t,{open:d.value,footer:null,onCancel:a[0]||(a[0]=_=>d.value=!1)},{default:h(()=>[g("img",{src:v.value,style:{width:"100%"},alt:""},null,8,O)]),_:1},8,["open"])])}}});export{j as _};
|
||||
import{d as B,m as N,o as u,b as r,c as m,w as h,a as P,h as S,S as b,n as g,t as z,i as D,l as i,p as I,x as R,z as U,r as f}from"./index-CVG99b4v.js";const q={class:"image-upload"},E={key:0},F={key:1},L={style:{"margin-top":"8px"}},O=["src"],j=B({__name:"ImageUploadInput",props:{modelValue:{default:null},purpose:{default:void 0},placeholder:{default:"بارگذاری"}},emits:["update:modelValue","ok"],setup(w,{emit:y}){const l=w,p=y,c=i(!1),d=i(!1),v=i(""),o=i([]);N(()=>l.modelValue,e=>{var a;e?((a=o.value[0])==null?void 0:a.url)!==e&&(o.value=[{uid:e,name:e.split("/").pop()??"file",status:"done",url:e}]):o.value=[]},{immediate:!0});const V=I(()=>l.placeholder);async function k({file:e}){var s,n;const a=new FormData;a.append("file",e),l.purpose&&a.append("purpose",l.purpose),c.value=!0;try{const{data:t}=await R.post("file/create",a);p("update:modelValue",t.url),p("ok",t)}catch(t){const _=((n=(s=t==null?void 0:t.response)==null?void 0:s.data)==null?void 0:n.message)??"بارگذاری فایل ناموفق بود";U.error(_)}finally{c.value=!1}}function x(){return p("update:modelValue",null),!0}function C(e){v.value=e.url,d.value=!0}return(e,a)=>{const s=f("a-spin"),n=f("a-upload"),t=f("a-modal");return u(),r("div",q,[m(n,{"file-list":o.value,"list-type":"picture-card","max-count":1,accept:"image/*","custom-request":k,onRemove:x,onPreview:C},{default:h(()=>[o.value.length===0?(u(),r("div",E,[c.value?(u(),P(s,{key:0,size:"small"})):(u(),r("div",F,[m(S(b)),g("div",L,z(V.value),1)]))])):D("",!0)]),_:1},8,["file-list"]),m(t,{open:d.value,footer:null,onCancel:a[0]||(a[0]=_=>d.value=!1)},{default:h(()=>[g("img",{src:v.value,style:{width:"100%"},alt:""},null,8,O)]),_:1},8,["open"])])}}});export{j as _};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.flex-col[data-v-7e21cbc2]{flex-direction:column}.flex-1[data-v-7e21cbc2]{flex:1}.justify-between[data-v-7e21cbc2]{justify-content:space-between}.mr-3[data-v-7e21cbc2]{margin-left:.75rem}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{a as $,b as s,X as B}from"./model-CvqTGmy8.js";import{_ as E}from"./ListPageHeader.vue_vue_type_script_setup_true_lang-CetMN4WH.js";import{_ as D}from"./Add.vue_vue_type_script_setup_true_lang-Ct9fNasS.js";import{d as X,u as M,b as O,c as i,w as o,r as u,o as c,h as m,a as f,E as T,i as b,D as V,n as w,l as _}from"./index-CVG99b4v.js";import{u as A}from"./useDeleteHandler-D7PJ3wUb.js";import"./filters-UavLT20t.js";import"./index-pLFqZCCf.js";import"./SettingOutlined-D7--Xtqg.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-C8WW9alD.js";function I(){const t=new $("admin/categories/list","لیست دسته بندی");return t.add(new s("id","شماره").filterNumber()),t.add(new s("image","تصویر").noSort().renderSlot("image")),t.add(new s("type_str","نوع نمایش")),t.add(new s("title","عنوان دسته").filterNumber()),t.add(new s("parent.title","پدر دسته").filterNumber()),t.add(new s("opt","عملیات").noSort().renderSlot("opt")),t}const P={id:"page-user-list"},U=["src"],j="/img/no-items.png",Y=X({__name:"List",setup(t){const k=M(),v=n=>!!k.hasPermission(n),y=I(),p=_(null),r=_(!1),l=_(void 0),{remove:x}=A({onSuccess:()=>{var n;return(n=p.value)==null?void 0:n.fetch()},successMessage:"دسته حذف شد",successType:"info",fallbackErrorMessage:"خطا در حذف دسته"});function C(){l.value=void 0,r.value=!0}function S(n){l.value=n,r.value=!0}return(n,a)=>{const g=u("a-tooltip"),h=u("a-popconfirm"),N=u("a-card");return c(),O("div",P,[i(N,{title:"لیست دسته بندی ها"},{default:o(()=>[i(B,{ref_key:"tbl",ref:p,model:m(y)},{add:o(()=>[i(E,{rid:"collection.create","add-label":"افزودن دسته",onAdd:C})]),image:o(({text:e})=>[w("img",{width:"90px",height:"90px",style:{"object-fit":"scale-down"},src:e&&e.image?e.image:j},null,8,U)]),opt:o(({record:e})=>[v("collection.list.edit")?(c(),f(g,{key:0,title:"ویرایش"},{default:o(()=>[i(m(T),{class:"cursor-pointer mx-1 text-primary",onClick:d=>S(e.id)},null,8,["onClick"])]),_:2},1024)):b("",!0),v("collection.list.remove")?(c(),f(g,{key:1,title:"حذف"},{default:o(()=>[i(h,{placement:"top","ok-text":"بله","cancel-text":"خیر",onConfirm:d=>m(x)(`category/${e.id}`)},{title:o(()=>[...a[2]||(a[2]=[w("p",null,"آیا مطمئن به حذف دسته مورد نظر هستید ؟",-1)])]),default:o(()=>[i(m(V),{class:"cursor-pointer mx-1 text-danger"})]),_:1},8,["onConfirm"])]),_:2},1024)):b("",!0)]),_:1},8,["model"]),(c(),f(D,{key:l.value??"new",open:r.value,id:l.value,"onUpdate:open":a[0]||(a[0]=e=>r.value=e),onSuccess:a[1]||(a[1]=e=>{var d;return(d=p.value)==null?void 0:d.fetch()})},null,8,["open","id"]))]),_:1})])}}});export{Y as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{a as $,b as s,X as B}from"./model-Di_BQPv1.js";import{_ as E}from"./ListPageHeader.vue_vue_type_script_setup_true_lang-BmENA4yH.js";import{_ as D}from"./Add.vue_vue_type_script_setup_true_lang-BP3ofJiO.js";import{d as X,u as M,b as O,c as i,w as o,r as p,o as c,h as m,a as f,E as T,i as b,D as V,n as w,l as _}from"./index-WFQJAeoE.js";import{u as A}from"./useDeleteHandler-AErXCFBG.js";import"./SettingOutlined-DZJd42S-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-BQ_i_QZe.js";function I(){const t=new $("admin/categories/list","لیست دسته بندی");return t.add(new s("id","شماره").filterNumber()),t.add(new s("image","تصویر").noSort().renderSlot("image")),t.add(new s("type_str","نوع نمایش")),t.add(new s("title","عنوان دسته").filterNumber()),t.add(new s("parent.title","پدر دسته").filterNumber()),t.add(new s("opt","عملیات").noSort().renderSlot("opt")),t}const P={id:"page-user-list"},U=["src"],j="/img/no-items.png",R=X({__name:"List",setup(t){const k=M(),v=n=>!!k.hasPermission(n),y=I(),u=_(null),l=_(!1),r=_(void 0),{remove:x}=A({onSuccess:()=>{var n;return(n=u.value)==null?void 0:n.fetch()},successMessage:"دسته حذف شد",successType:"info",fallbackErrorMessage:"خطا در حذف دسته"});function C(){r.value=void 0,l.value=!0}function S(n){r.value=n,l.value=!0}return(n,a)=>{const g=p("a-tooltip"),h=p("a-popconfirm"),N=p("a-card");return c(),O("div",P,[i(N,{title:"لیست دسته بندی ها"},{default:o(()=>[i(B,{ref_key:"tbl",ref:u,model:m(y)},{add:o(()=>[i(E,{rid:"collection.create","add-label":"افزودن دسته",onAdd:C})]),image:o(({text:e})=>[w("img",{width:"90px",height:"90px",style:{"object-fit":"scale-down"},src:e&&e.image?e.image:j},null,8,U)]),opt:o(({record:e})=>[v("collection.list.edit")?(c(),f(g,{key:0,title:"ویرایش"},{default:o(()=>[i(m(T),{class:"cursor-pointer mx-1 text-primary",onClick:d=>S(e.id)},null,8,["onClick"])]),_:2},1024)):b("",!0),v("collection.list.remove")?(c(),f(g,{key:1,title:"حذف"},{default:o(()=>[i(h,{placement:"top","ok-text":"بله","cancel-text":"خیر",onConfirm:d=>m(x)(`category/${e.id}`)},{title:o(()=>[...a[2]||(a[2]=[w("p",null,"آیا مطمئن به حذف دسته مورد نظر هستید ؟",-1)])]),default:o(()=>[i(m(V),{class:"cursor-pointer mx-1 text-danger"})]),_:1},8,["onConfirm"])]),_:2},1024)):b("",!0)]),_:1},8,["model"]),(c(),f(D,{key:r.value??"new",open:l.value,id:r.value,"onUpdate:open":a[0]||(a[0]=e=>l.value=e),onSuccess:a[1]||(a[1]=e=>{var d;return(d=u.value)==null?void 0:d.fetch()})},null,8,["open","id"]))]),_:1})])}}});export{R as default};
|
||||
@@ -0,0 +1 @@
|
||||
.flex-col[data-v-a0837a14]{flex-direction:column}.flex-1[data-v-a0837a14]{flex:1}.justify-between[data-v-a0837a14]{justify-content:space-between}.mr-3[data-v-a0837a14]{margin-left:.75rem}
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as m}from"./FacilityList.vue_vue_type_script_setup_true_lang-CcehyYuf.js";import{_ as c}from"./AddBranches.vue_vue_type_script_setup_true_lang-DZPeg6FI.js";import{a as p,b as t}from"./model-CvqTGmy8.js";import{d as l,a as o,w as f,h as _,o as r}from"./index-CVG99b4v.js";import"./ListPageHeader.vue_vue_type_script_setup_true_lang-CetMN4WH.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";import"./filters-UavLT20t.js";import"./index-pLFqZCCf.js";import"./SettingOutlined-D7--Xtqg.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";function u(){const e=new p("admin/branches/list","لیست شعب");return e.add(new t("name","نام").filterText()),e.add(new t("address","آدرس").filterText()),e.add(new t("phone","شماره تلفن").filterNumber()),e.add(new t("user.name","مدیر شعبه").filterNumber().noSort()),e.add(new t("op","عملیات").noSort().renderSlot("actions")),e}const U=l({__name:"ListBranches",setup(e){const n=u();return(h,b)=>(r(),o(m,{title:"لیست شعب",model:_(n),"edit-path":"/branch/edit","active-path":"branch/active","add-rid":"branch.create","add-label":"افزودن شعبه"},{form:f(({open:i,editingId:a,onUpdateOpen:d,onSuccess:s})=>[(r(),o(c,{key:a??"new",open:i,id:a,"onUpdate:open":d,onSuccess:s},null,8,["open","id","onUpdate:open","onSuccess"]))]),_:1},8,["model"]))}});export{U as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as c}from"./FacilityList.vue_vue_type_script_setup_true_lang-C5xeMC8b.js";import{_ as m}from"./AddBranches.vue_vue_type_script_setup_true_lang-BTBcvf9O.js";import{a as p,b as t}from"./model-Di_BQPv1.js";import{d as l,a as n,w as f,h as _,o}from"./index-WFQJAeoE.js";import"./ListPageHeader.vue_vue_type_script_setup_true_lang-BmENA4yH.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";import"./SettingOutlined-DZJd42S-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";function u(){const e=new p("admin/branches/list","لیست شعب");return e.add(new t("name","نام").filterText()),e.add(new t("address","آدرس").filterText()),e.add(new t("phone","شماره تلفن").filterNumber()),e.add(new t("user.name","مدیر شعبه").filterNumber().noSort()),e.add(new t("op","عملیات").noSort().renderSlot("actions")),e}const L=l({__name:"ListBranches",setup(e){const r=u();return(h,b)=>(o(),n(c,{title:"لیست شعب",model:_(r),"edit-path":"/branch/edit","active-path":"branch/active","add-rid":"branch.create","add-label":"افزودن شعبه"},{form:f(({open:d,editingId:a,onUpdateOpen:i,onSuccess:s})=>[(o(),n(m,{key:a??"new",open:d,id:a,"onUpdate:open":i,onSuccess:s},null,8,["open","id","onUpdate:open","onSuccess"]))]),_:1},8,["model"]))}});export{L as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{a as M,b as d,X as V}from"./model-Di_BQPv1.js";import{_ as h}from"./ListPageHeader.vue_vue_type_script_setup_true_lang-BmENA4yH.js";import z from"./AddInvoice-BO7d-BCP.js";import{j as K}from"./filters-C1cWKkpl.js";import{u as U}from"./useDeleteHandler-AErXCFBG.js";import{d as H,b as y,c as e,w as t,r as s,o as x,h as p,n as g,Q,E as R,D as q,f as r,t as u,a as C,l as _,x as F}from"./index-WFQJAeoE.js";import{_ as G}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./SettingOutlined-DZJd42S-.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";import"./index-1e_FodC0.js";function J(){const n=new M("admin/invoices/list","لیست فاکتورها");return n.add(new d("id","ردیف").filterNumber()),n.add(new d("name","نام مشتری").filterKey("branch.name").filterText()),n.add(new d("sum_weight","جمع کل سفارش").filterNumber().noSort()),n.add(new d("count_item","تعداد آیتم ها").filterNumber().noSort()),n.add(new d("caj","تاریخ ثبت").filterKey("createdAt").filterDate().noSort()),n.add(new d("allocator_user.name","ثبت کننده").renderSlot("user").noSort()),n.add(new d("note","توضیحات").filterText().noSort()),n.add(new d("op","عملیات").noSort().renderSlot("actions")),n}const P={id:"page-user-list"},W={class:"flex gap-2"},Y={key:0},Z=H({__name:"ListInvoice",setup(n){const S=J(),w=_(null),f=_(!1),l=_(void 0),v=_(!1),b=_(void 0);function I(){b.value=void 0,v.value=!0}function $(c){b.value=c,v.value=!0}const D=[{title:"کد محصول",dataIndex:"product_code"},{title:"نام محصول",dataIndex:"title"},{title:"وزن",dataIndex:"grams"}];async function E(c){const{data:o}=await F.get(`branch/product/${c.id}`);l.value=o,f.value=!0}const{remove:N}=U({onSuccess:()=>{var c;return(c=w.value)==null?void 0:c.fetch()},successMessage:"فاکتور حذف شد",fallbackErrorMessage:"خطا در حذف فاکتور"});return(c,o)=>{const k=s("a-tooltip"),T=s("a-popconfirm"),m=s("a-descriptions-item"),j=s("a-descriptions"),A=s("a-table"),B=s("a-empty"),O=s("a-button"),X=s("a-modal"),L=s("a-card");return x(),y("div",P,[e(L,{title:"لیست فاکتورها"},{default:t(()=>[e(V,{ref_key:"tbl",ref:w,model:p(S)},{add:t(()=>[e(h,{rid:"invoice.create","add-label":"افزودن فاکتور",onAdd:I})]),user:t(({record:a})=>{var i;return[r(u(((i=a.allocator_user)==null?void 0:i.name)??"-"),1)]}),actions:t(({record:a})=>[g("div",W,[e(k,{title:"مشاهده"},{default:t(()=>[e(p(Q),{class:"cursor-pointer mx-1 text-success",onClick:i=>E(a)},null,8,["onClick"])]),_:2},1024),e(k,{title:"ویرایش"},{default:t(()=>[e(p(R),{class:"cursor-pointer mx-1 text-primary",onClick:i=>$(a.id)},null,8,["onClick"])]),_:2},1024),e(k,{title:"حذف"},{default:t(()=>[e(T,{placement:"top","ok-text":"بله","cancel-text":"خیر",onConfirm:i=>p(N)(`branch/product/${a.id}`)},{title:t(()=>[...o[4]||(o[4]=[g("p",null,"آیا مطمئن به حذف فاکتور مورد نظر هستید ؟",-1)])]),default:t(()=>[e(p(q),{class:"cursor-pointer mx-1 text-danger"})]),_:1},8,["onConfirm"])]),_:2},1024)])]),_:1},8,["model"]),e(X,{open:f.value,"onUpdate:open":o[1]||(o[1]=a=>f.value=a),title:"مشاهده فاکتور",width:"70%"},{footer:t(()=>[e(O,{onClick:o[0]||(o[0]=a=>f.value=!1)},{default:t(()=>[...o[5]||(o[5]=[r("بستن",-1)])]),_:1})]),default:t(()=>[l.value?(x(),y("div",Y,[e(j,{bordered:"",size:"small",column:2},{default:t(()=>[e(m,{label:"شعبه"},{default:t(()=>[r(u(l.value.name),1)]),_:1}),e(m,{label:"ثبت کننده"},{default:t(()=>{var a;return[r(u(((a=l.value.allocator_user)==null?void 0:a.name)??"-"),1)]}),_:1}),e(m,{label:"تاریخ ثبت"},{default:t(()=>[r(u(p(K)(l.value.caj)),1)]),_:1}),e(m,{label:"تعداد آیتم"},{default:t(()=>[r(u(l.value.count_item),1)]),_:1}),e(m,{label:"جمع وزن"},{default:t(()=>[r(u(l.value.sum_weight),1)]),_:1}),e(m,{label:"توضیحات"},{default:t(()=>[r(u(l.value.note??"-"),1)]),_:1})]),_:1}),e(A,{class:"mt-4",size:"small","data-source":l.value.products,columns:D,pagination:!1,"row-key":"id"},null,8,["data-source"])])):(x(),C(B,{key:1}))]),_:1},8,["open"]),(x(),C(z,{key:b.value??"new",open:v.value,id:b.value,"onUpdate:open":o[2]||(o[2]=a=>v.value=a),onSuccess:o[3]||(o[3]=a=>{var i;return(i=w.value)==null?void 0:i.fetch()})},null,8,["open","id"]))]),_:1})])}}}),ce=G(Z,[["__scopeId","data-v-6cda7919"]]);export{ce as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{a as M,b as d,X as V}from"./model-CvqTGmy8.js";import{_ as h}from"./ListPageHeader.vue_vue_type_script_setup_true_lang-CetMN4WH.js";import z from"./AddInvoice-ErZYOCpz.js";import{j as K}from"./filters-UavLT20t.js";import{u as U}from"./useDeleteHandler-D7PJ3wUb.js";import{d as H,b as y,c as e,w as t,r as s,o as x,h as p,n as g,T as R,E as q,D as F,f as r,t as u,a as C,l as _,x as G}from"./index-CVG99b4v.js";import{_ as J}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./SettingOutlined-D7--Xtqg.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";import"./index-pLFqZCCf.js";function P(){const n=new M("admin/invoices/list","لیست فاکتورها");return n.add(new d("id","ردیف").filterNumber()),n.add(new d("name","نام مشتری").filterKey("branch.name").filterText()),n.add(new d("sum_weight","جمع کل سفارش").filterNumber().noSort()),n.add(new d("count_item","تعداد آیتم ها").filterNumber().noSort()),n.add(new d("caj","تاریخ ثبت").filterKey("createdAt").filterDate().noSort()),n.add(new d("allocator_user.name","ثبت کننده").renderSlot("user").noSort()),n.add(new d("note","توضیحات").filterText().noSort()),n.add(new d("op","عملیات").noSort().renderSlot("actions")),n}const Q={id:"page-user-list"},W={class:"flex gap-2"},Y={key:0},Z=H({__name:"ListInvoice",setup(n){const S=P(),w=_(null),f=_(!1),l=_(void 0),v=_(!1),b=_(void 0);function I(){b.value=void 0,v.value=!0}function $(c){b.value=c,v.value=!0}const D=[{title:"کد محصول",dataIndex:"product_code"},{title:"نام محصول",dataIndex:"title"},{title:"وزن",dataIndex:"grams"}];async function E(c){const{data:o}=await G.get(`branch/product/${c.id}`);l.value=o,f.value=!0}const{remove:N}=U({onSuccess:()=>{var c;return(c=w.value)==null?void 0:c.fetch()},successMessage:"فاکتور حذف شد",fallbackErrorMessage:"خطا در حذف فاکتور"});return(c,o)=>{const k=s("a-tooltip"),T=s("a-popconfirm"),m=s("a-descriptions-item"),j=s("a-descriptions"),A=s("a-table"),B=s("a-empty"),O=s("a-button"),X=s("a-modal"),L=s("a-card");return x(),y("div",Q,[e(L,{title:"لیست فاکتورها"},{default:t(()=>[e(V,{ref_key:"tbl",ref:w,model:p(S)},{add:t(()=>[e(h,{rid:"invoice.create","add-label":"افزودن فاکتور",onAdd:I})]),user:t(({record:a})=>{var i;return[r(u(((i=a.allocator_user)==null?void 0:i.name)??"-"),1)]}),actions:t(({record:a})=>[g("div",W,[e(k,{title:"مشاهده"},{default:t(()=>[e(p(R),{class:"cursor-pointer mx-1 text-success",onClick:i=>E(a)},null,8,["onClick"])]),_:2},1024),e(k,{title:"ویرایش"},{default:t(()=>[e(p(q),{class:"cursor-pointer mx-1 text-primary",onClick:i=>$(a.id)},null,8,["onClick"])]),_:2},1024),e(k,{title:"حذف"},{default:t(()=>[e(T,{placement:"top","ok-text":"بله","cancel-text":"خیر",onConfirm:i=>p(N)(`branch/product/${a.id}`)},{title:t(()=>[...o[4]||(o[4]=[g("p",null,"آیا مطمئن به حذف فاکتور مورد نظر هستید ؟",-1)])]),default:t(()=>[e(p(F),{class:"cursor-pointer mx-1 text-danger"})]),_:1},8,["onConfirm"])]),_:2},1024)])]),_:1},8,["model"]),e(X,{open:f.value,"onUpdate:open":o[1]||(o[1]=a=>f.value=a),title:"مشاهده فاکتور",width:"70%"},{footer:t(()=>[e(O,{onClick:o[0]||(o[0]=a=>f.value=!1)},{default:t(()=>[...o[5]||(o[5]=[r("بستن",-1)])]),_:1})]),default:t(()=>[l.value?(x(),y("div",Y,[e(j,{bordered:"",size:"small",column:2},{default:t(()=>[e(m,{label:"شعبه"},{default:t(()=>[r(u(l.value.name),1)]),_:1}),e(m,{label:"ثبت کننده"},{default:t(()=>{var a;return[r(u(((a=l.value.allocator_user)==null?void 0:a.name)??"-"),1)]}),_:1}),e(m,{label:"تاریخ ثبت"},{default:t(()=>[r(u(p(K)(l.value.caj)),1)]),_:1}),e(m,{label:"تعداد آیتم"},{default:t(()=>[r(u(l.value.count_item),1)]),_:1}),e(m,{label:"جمع وزن"},{default:t(()=>[r(u(l.value.sum_weight),1)]),_:1}),e(m,{label:"توضیحات"},{default:t(()=>[r(u(l.value.note??"-"),1)]),_:1})]),_:1}),e(A,{class:"mt-4",size:"small","data-source":l.value.products,columns:D,pagination:!1,"row-key":"id"},null,8,["data-source"])])):(x(),C(B,{key:1}))]),_:1},8,["open"]),(x(),C(z,{key:b.value??"new",open:v.value,id:b.value,"onUpdate:open":o[2]||(o[2]=a=>v.value=a),onSuccess:o[3]||(o[3]=a=>{var i;return(i=w.value)==null?void 0:i.fetch()})},null,8,["open","id"]))]),_:1})])}}}),ce=J(Z,[["__scopeId","data-v-6cda7919"]]);export{ce as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d,u as i,o as u,a as m,w as s,f as c,t as l,c as f,h as p,P as C,i as P,r as b}from"./index-WFQJAeoE.js";const _=d({__name:"ListPageHeader",props:{rid:{default:void 0},addLabel:{default:"افزودن"}},emits:["add"],setup(e){const o=i(),n=t=>!!o.hasPermission(t);return(t,a)=>{const r=b("a-button");return!e.rid||n(e.rid)?(u(),m(r,{key:0,type:"primary",onClick:a[0]||(a[0]=k=>t.$emit("add"))},{icon:s(()=>[f(p(C))]),default:s(()=>[c(" "+l(e.addLabel),1)]),_:1})):P("",!0)}}});export{_};
|
||||
import{d,u as i,o as u,a as m,w as s,f as c,t as l,c as f,h as p,S as C,i as b,r as k}from"./index-CVG99b4v.js";const _=d({__name:"ListPageHeader",props:{rid:{default:void 0},addLabel:{default:"افزودن"}},emits:["add"],setup(e){const o=i(),n=t=>!!o.hasPermission(t);return(t,a)=>{const r=k("a-button");return!e.rid||n(e.rid)?(u(),m(r,{key:0,type:"primary",onClick:a[0]||(a[0]=y=>t.$emit("add"))},{icon:s(()=>[f(p(C))]),default:s(()=>[c(" "+l(e.addLabel),1)]),_:1})):b("",!0)}}});export{_};
|
||||
@@ -0,0 +1 @@
|
||||
import{a as D,b as a,X as E}from"./model-CvqTGmy8.js";import{_ as U}from"./ListPageHeader.vue_vue_type_script_setup_true_lang-CetMN4WH.js";import $ from"./UserCreate-B8VEprZ-.js";import{d as M,u as V,v as X,x as h,b as O,c as r,w as n,l as c,r as _,o as m,h as p,a as v,E as A,i as y,D as K,n as L,f as P,t as H}from"./index-CVG99b4v.js";import{u as I}from"./useDeleteHandler-D7PJ3wUb.js";import"./filters-UavLT20t.js";import"./index-pLFqZCCf.js";import"./SettingOutlined-D7--Xtqg.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";function j(){const o=new D("admin/users/list","لیست مدیران");return o.add(new a("id","کد مدیر")),o.add(new a("fname","نام").filterKey("fullName").filterText()),o.add(new a("lname","نام خانوادگی").filterKey("fullName").filterText()),o.add(new a("mobile","موبایل").filterText()),o.add(new a("ut","نوع کاربر").filterNumber().renderSlot("ut")),o.add(new a("op","عملیات").noSort().renderSlot("op")),o}const q={id:"page-user-list"},te=M({__name:"ListUser",setup(o){const k=V(),x=e=>!!k.hasPermission(e),w=j(),f=c(null),b=c([]),l=c(!1),i=c(void 0);function g(e){var t;return e==null?"-":((t=b.value.find(d=>d.id===Number(e)))==null?void 0:t.title)??String(e)}function C(){i.value=void 0,l.value=!0}function T(e){i.value=e.id,l.value=!0}const{remove:N}=I({onSuccess:()=>{var e;return(e=f.value)==null?void 0:e.fetch()},successMessage:"کاربر حذف شد",fallbackErrorMessage:"خطا در حذف کاربر"});return X(async()=>{try{const{data:e}=await h.get("const/__list__ut");b.value=e}catch(e){console.log(e)}}),(e,t)=>{const d=_("a-tooltip"),S=_("a-popconfirm"),B=_("a-card");return m(),O("div",q,[r(B,{title:"لیست مدیران"},{default:n(()=>[r(E,{ref_key:"tbl",ref:f,model:p(w)},{add:n(()=>[r(U,{rid:"user.list.create","add-label":"افزودن کاربر",onAdd:C})]),ut:n(({text:s})=>[P(H(g(s)),1)]),op:n(({record:s})=>[x("user.list.edit")?(m(),v(d,{key:0,title:"ویرایش"},{default:n(()=>[r(p(A),{class:"cursor-pointer mx-1 text-primary",onClick:u=>T(s)},null,8,["onClick"])]),_:2},1024)):y("",!0),x("user.list.remove")?(m(),v(d,{key:1,title:"حذف"},{default:n(()=>[r(S,{placement:"top","ok-text":"بله","cancel-text":"خیر",onConfirm:u=>p(N)(`users/${s.id}`)},{title:n(()=>[...t[2]||(t[2]=[L("p",null,"آیا مطمئن به حذف کاربر مورد نظر هستید ؟",-1)])]),default:n(()=>[r(p(K),{class:"cursor-pointer mx-1 text-danger"})]),_:1},8,["onConfirm"])]),_:2},1024)):y("",!0)]),_:1},8,["model"]),(m(),v($,{key:i.value??"new",open:l.value,id:i.value,"onUpdate:open":t[0]||(t[0]=s=>l.value=s),onSuccess:t[1]||(t[1]=s=>{var u;return(u=f.value)==null?void 0:u.fetch()})},null,8,["open","id"]))]),_:1})])}}});export{te as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{a as D,b as a,X as E}from"./model-Di_BQPv1.js";import{_ as U}from"./ListPageHeader.vue_vue_type_script_setup_true_lang-BmENA4yH.js";import $ from"./UserCreate-DUjELXD2.js";import{d as M,u as V,v as X,x as h,b as O,c as r,w as n,l as c,r as _,o as m,h as p,a as v,E as A,i as y,D as K,n as L,f as P,t as H}from"./index-WFQJAeoE.js";import{u as I}from"./useDeleteHandler-AErXCFBG.js";import"./SettingOutlined-DZJd42S-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";function j(){const o=new D("admin/users/list","لیست مدیران");return o.add(new a("id","کد مدیر")),o.add(new a("fname","نام").filterKey("fullName").filterText()),o.add(new a("lname","نام خانوادگی").filterKey("fullName").filterText()),o.add(new a("mobile","موبایل").filterText()),o.add(new a("ut","نوع کاربر").filterNumber().renderSlot("ut")),o.add(new a("op","عملیات").noSort().renderSlot("op")),o}const q={id:"page-user-list"},Z=M({__name:"ListUser",setup(o){const k=V(),x=e=>!!k.hasPermission(e),w=j(),f=c(null),b=c([]),l=c(!1),i=c(void 0);function g(e){var t;return e==null?"-":((t=b.value.find(d=>d.id===Number(e)))==null?void 0:t.title)??String(e)}function C(){i.value=void 0,l.value=!0}function T(e){i.value=e.id,l.value=!0}const{remove:N}=I({onSuccess:()=>{var e;return(e=f.value)==null?void 0:e.fetch()},successMessage:"کاربر حذف شد",fallbackErrorMessage:"خطا در حذف کاربر"});return X(async()=>{try{const{data:e}=await h.get("const/__list__ut");b.value=e}catch(e){console.log(e)}}),(e,t)=>{const d=_("a-tooltip"),S=_("a-popconfirm"),B=_("a-card");return m(),O("div",q,[r(B,{title:"لیست مدیران"},{default:n(()=>[r(E,{ref_key:"tbl",ref:f,model:p(w)},{add:n(()=>[r(U,{rid:"user.list.create","add-label":"افزودن کاربر",onAdd:C})]),ut:n(({text:s})=>[P(H(g(s)),1)]),op:n(({record:s})=>[x("user.list.edit")?(m(),v(d,{key:0,title:"ویرایش"},{default:n(()=>[r(p(A),{class:"cursor-pointer mx-1 text-primary",onClick:u=>T(s)},null,8,["onClick"])]),_:2},1024)):y("",!0),x("user.list.remove")?(m(),v(d,{key:1,title:"حذف"},{default:n(()=>[r(S,{placement:"top","ok-text":"بله","cancel-text":"خیر",onConfirm:u=>p(N)(`users/${s.id}`)},{title:n(()=>[...t[2]||(t[2]=[L("p",null,"آیا مطمئن به حذف کاربر مورد نظر هستید ؟",-1)])]),default:n(()=>[r(p(K),{class:"cursor-pointer mx-1 text-danger"})]),_:1},8,["onConfirm"])]),_:2},1024)):y("",!0)]),_:1},8,["model"]),(m(),v($,{key:i.value??"new",open:l.value,id:i.value,"onUpdate:open":t[0]||(t[0]=s=>l.value=s),onSuccess:t[1]||(t[1]=s=>{var u;return(u=f.value)==null?void 0:u.fetch()})},null,8,["open","id"]))]),_:1})])}}});export{Z as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as p}from"./FacilityList.vue_vue_type_script_setup_true_lang-C5xeMC8b.js";import{_ as m}from"./AddWorkshop.vue_vue_type_script_setup_true_lang-BXy9e7qX.js";import{a as c,b as e}from"./model-Di_BQPv1.js";import{d as l,a as r,w as f,h as _,o as a}from"./index-WFQJAeoE.js";import"./ListPageHeader.vue_vue_type_script_setup_true_lang-BmENA4yH.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";import"./SettingOutlined-DZJd42S-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";function h(){const o=new c("admin/workshops/list","لیست کارگاه ها");return o.add(new e("name","نام").filterText()),o.add(new e("address","آدرس").filterText()),o.add(new e("phone","شماره تلفن").filterNumber()),o.add(new e("op","عملیات").noSort().renderSlot("actions")),o}const L=l({__name:"ListWorkshop",setup(o){const n=h();return(w,u)=>(a(),r(p,{title:"لیست کارگاه ها",model:_(n),"edit-path":"/workshop/edit","active-path":"workshop/active","add-rid":"workshop.create","add-label":"افزودن کارگاه"},{form:f(({open:s,editingId:t,onUpdateOpen:d,onSuccess:i})=>[(a(),r(m,{key:t??"new",open:s,id:t,"onUpdate:open":d,onSuccess:i},null,8,["open","id","onUpdate:open","onSuccess"]))]),_:1},8,["model"]))}});export{L as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as d}from"./FacilityList.vue_vue_type_script_setup_true_lang-CcehyYuf.js";import{_ as m}from"./AddWorkshop.vue_vue_type_script_setup_true_lang-DM0hJwHH.js";import{a as c,b as e}from"./model-CvqTGmy8.js";import{d as l,a as r,w as f,h as _,o as a}from"./index-CVG99b4v.js";import"./ListPageHeader.vue_vue_type_script_setup_true_lang-CetMN4WH.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-CWur6xTz.js";import"./filters-UavLT20t.js";import"./index-pLFqZCCf.js";import"./SettingOutlined-D7--Xtqg.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";function h(){const o=new c("admin/workshops/list","لیست کارگاه ها");return o.add(new e("name","نام").filterText()),o.add(new e("address","آدرس").filterText()),o.add(new e("phone","شماره تلفن").filterNumber()),o.add(new e("op","عملیات").noSort().renderSlot("actions")),o}const W=l({__name:"ListWorkshop",setup(o){const n=h();return(w,u)=>(a(),r(d,{title:"لیست کارگاه ها",model:_(n),"edit-path":"/workshop/edit","active-path":"workshop/active","add-rid":"workshop.create","add-label":"افزودن کارگاه"},{form:f(({open:s,editingId:t,onUpdateOpen:i,onSuccess:p})=>[(a(),r(m,{key:t??"new",open:s,id:t,"onUpdate:open":i,onSuccess:p},null,8,["open","id","onUpdate:open","onSuccess"]))]),_:1},8,["model"]))}});export{W as default};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{d as C,b as E,c as a,w as n,r as s,o as M,n as t,A as N,f as V,l as u,p as m,z as A,k as L}from"./index-WFQJAeoE.js";import{_ as P}from"./montzar-icon-B0wdL36O.js";import{u as S}from"./auth-Cz9vAefU.js";import{_ as T}from"./_plugin-vue_export-helper-DlAUqK2U.js";const U={id:"page-login"},$={class:"login-grid"},F={class:"login-form"},I=C({__name:"Login",setup(J){const w=L(),h=S(),o=u(""),l=u(""),i=u(!1),c=u(!1),f=u(!1),d=m(()=>c.value?o.value?o.value.length<8?"مقدار ورودی صحیح نیست":"":"وارد کردن موبایل الزامی است":""),v=m(()=>f.value?l.value?l.value.length<5?"مقدار ورودی صحیح نیست":"":"وارد کردن رمز عبور الزامی است":""),_=m(()=>!d.value&&!v.value&&o.value!==""&&l.value!=="");async function p(){if(!(!_.value||i.value)){i.value=!0;try{await h.login({phone:o.value,password:l.value}),await w.push("/dashboard/ecommerce")}catch(g){console.log(g),A.error("خطا در ورود")}finally{i.value=!1}}}return(g,e)=>{const x=s("a-input"),b=s("a-form-item"),y=s("a-input-password"),z=s("a-button"),B=s("a-form"),k=s("a-card");return M(),E("div",U,[a(k,{class:"login-card",bordered:!1},{default:n(()=>[t("div",$,[t("div",F,[e[5]||(e[5]=t("div",{class:"vx-card__title"},[t("h4",null,"ورود به محیط مدیریت"),t("p",null,"لطفا شماره تلفن همراه خود به همراه رمز عبور وارد کنید.")],-1)),a(B,{layout:"vertical",class:"mt-8",onSubmit:N(p,["prevent"])},{default:n(()=>[a(b,{label:"موبایل","validate-status":d.value?"error":"",help:d.value},{default:n(()=>[a(x,{value:o.value,"onUpdate:value":e[0]||(e[0]=r=>o.value=r),autocomplete:"off",size:"large",onBlur:e[1]||(e[1]=r=>c.value=!0)},null,8,["value"])]),_:1},8,["validate-status","help"]),a(b,{label:"رمز عبور","validate-status":v.value?"error":"",help:v.value},{default:n(()=>[a(y,{value:l.value,"onUpdate:value":e[2]||(e[2]=r=>l.value=r),size:"large",onBlur:e[3]||(e[3]=r=>f.value=!0),onPressEnter:p},null,8,["value"])]),_:1},8,["validate-status","help"]),a(z,{type:"primary",size:"large",disabled:!_.value,loading:i.value,onClick:p},{default:n(()=>[...e[4]||(e[4]=[V(" ورود ",-1)])]),_:1},8,["disabled","loading"])]),_:1})]),e[6]||(e[6]=t("div",{class:"login-art"},[t("img",{src:P,alt:"Montzar"})],-1))])]),_:1})])}}}),D=T(I,[["__scopeId","data-v-4be9c188"]]);export{D as default};
|
||||
import{d as C,b as E,c as a,w as n,r as s,o as M,n as t,A as N,f as V,l as u,p as m,z as A,k as L}from"./index-CVG99b4v.js";import{_ as P}from"./montzar-icon-B0wdL36O.js";import{u as S}from"./auth-Cu4qHRNu.js";import{_ as T}from"./_plugin-vue_export-helper-DlAUqK2U.js";const U={id:"page-login"},$={class:"login-grid"},F={class:"login-form"},I=C({__name:"Login",setup(J){const w=L(),h=S(),o=u(""),l=u(""),i=u(!1),c=u(!1),f=u(!1),d=m(()=>c.value?o.value?o.value.length<8?"مقدار ورودی صحیح نیست":"":"وارد کردن موبایل الزامی است":""),v=m(()=>f.value?l.value?l.value.length<5?"مقدار ورودی صحیح نیست":"":"وارد کردن رمز عبور الزامی است":""),_=m(()=>!d.value&&!v.value&&o.value!==""&&l.value!=="");async function p(){if(!(!_.value||i.value)){i.value=!0;try{await h.login({phone:o.value,password:l.value}),await w.push("/dashboard/ecommerce")}catch(g){console.log(g),A.error("خطا در ورود")}finally{i.value=!1}}}return(g,e)=>{const x=s("a-input"),b=s("a-form-item"),y=s("a-input-password"),z=s("a-button"),B=s("a-form"),k=s("a-card");return M(),E("div",U,[a(k,{class:"login-card",bordered:!1},{default:n(()=>[t("div",$,[t("div",F,[e[5]||(e[5]=t("div",{class:"vx-card__title"},[t("h4",null,"ورود به محیط مدیریت"),t("p",null,"لطفا شماره تلفن همراه خود به همراه رمز عبور وارد کنید.")],-1)),a(B,{layout:"vertical",class:"mt-8",onSubmit:N(p,["prevent"])},{default:n(()=>[a(b,{label:"موبایل","validate-status":d.value?"error":"",help:d.value},{default:n(()=>[a(x,{value:o.value,"onUpdate:value":e[0]||(e[0]=r=>o.value=r),autocomplete:"off",size:"large",onBlur:e[1]||(e[1]=r=>c.value=!0)},null,8,["value"])]),_:1},8,["validate-status","help"]),a(b,{label:"رمز عبور","validate-status":v.value?"error":"",help:v.value},{default:n(()=>[a(y,{value:l.value,"onUpdate:value":e[2]||(e[2]=r=>l.value=r),size:"large",onBlur:e[3]||(e[3]=r=>f.value=!0),onPressEnter:p},null,8,["value"])]),_:1},8,["validate-status","help"]),a(z,{type:"primary",size:"large",disabled:!_.value,loading:i.value,onClick:p},{default:n(()=>[...e[4]||(e[4]=[V(" ورود ",-1)])]),_:1},8,["disabled","loading"])]),_:1})]),e[6]||(e[6]=t("div",{class:"login-art"},[t("img",{src:P,alt:"Montzar"})],-1))])]),_:1})])}}}),D=T(I,[["__scopeId","data-v-4be9c188"]]);export{D as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.vertical-nav-menu[data-v-2d7bd33c]{height:100vh;overflow-y:auto;border-left:1px solid #f0f0f0}.nav-header[data-v-2d7bd33c]{height:61px;display:flex;align-items:center;justify-content:center}.nav-title[data-v-2d7bd33c]{font-size:18px;color:#1c2d56}.the-navbar[data-v-e8615504]{height:61px;background:#fff;padding:0 16px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #f0f0f0}.nav-left[data-v-e8615504],.nav-right[data-v-e8615504]{display:flex;align-items:center;gap:12px}.page-title[data-v-e8615504]{font-size:16px;color:#1c2d56}.breadcrumb[data-v-e8615504]{font-size:13px}.user-chip[data-v-e8615504]{display:inline-flex;align-items:center;gap:8px;cursor:pointer}.user-dropdown-overlay .ant-dropdown-menu{padding:0;box-shadow:none}.user-dropdown-overlay .user-card{width:220px;padding:12px;background:#fff;border-radius:10px;box-shadow:0 8px 28px -8px #1c2d5647}.user-dropdown-overlay .user-card__head{display:flex;align-items:center;gap:10px;padding:2px 4px 8px}.user-dropdown-overlay .user-card__id{display:flex;flex-direction:column;min-width:0}.user-dropdown-overlay .user-card__name{font-size:14px;font-weight:600;color:#1c2d56;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-dropdown-overlay .user-card__mobile{font-size:12px;color:#8a909c;direction:ltr;text-align:right}.user-dropdown-overlay .user-card__divider{margin:4px 0}.user-dropdown-overlay .user-card__menu.ant-menu{border-inline-end:none;background:transparent}.user-dropdown-overlay .user-card__menu .ant-menu-item{display:flex;align-items:center;gap:8px;height:34px;line-height:34px;margin:0;padding-inline:6px!important;border-radius:6px;width:100%}.user-dropdown-overlay .user-card__menu .ant-menu-item:hover{background:#f4f5f6;color:#1c2d56}.user-dropdown-overlay .user-card__menu .anticon{font-size:15px;color:#8a909c}.layout--main[data-v-1ff241ff]{height:100vh;overflow:hidden}.layout--main[data-v-1ff241ff]>.ant-layout{height:100%}#content-area[data-v-1ff241ff]{padding:16px;background:#f8f8f8;display:flex;height:calc(100vh - 61px);overflow-y:auto}.content-wrapper[data-v-1ff241ff],.content-area__content[data-v-1ff241ff]{display:flex;flex-direction:column;flex:1;min-height:0}
|
||||
.vertical-nav-menu[data-v-dd3fff10]{height:100vh;overflow-y:auto;border-left:1px solid #f0f0f0}.nav-header[data-v-dd3fff10]{height:61px;display:flex;align-items:center;justify-content:center}.nav-title[data-v-dd3fff10]{font-size:18px;color:#1c2d56}.the-navbar[data-v-cd8d0532]{height:61px;background:#fff;padding:0 16px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #f0f0f0}.nav-left[data-v-cd8d0532],.nav-right[data-v-cd8d0532]{display:flex;align-items:center;gap:12px}.page-title[data-v-cd8d0532]{font-size:16px;color:#1c2d56}.breadcrumb[data-v-cd8d0532]{font-size:13px}.user-chip[data-v-cd8d0532]{display:inline-flex;align-items:center;gap:8px;cursor:pointer}.user-dropdown-overlay .ant-dropdown-menu{padding:0;box-shadow:none}.user-dropdown-overlay .user-card{width:220px;padding:12px;background:#fff;border-radius:10px;box-shadow:0 8px 28px -8px #1c2d5647}.user-dropdown-overlay .user-card__head{display:flex;align-items:center;gap:10px;padding:2px 4px 8px}.user-dropdown-overlay .user-card__id{display:flex;flex-direction:column;min-width:0}.user-dropdown-overlay .user-card__name{font-size:14px;font-weight:600;color:#1c2d56;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-dropdown-overlay .user-card__mobile{font-size:12px;color:#8a909c;direction:ltr;text-align:right}.user-dropdown-overlay .user-card__divider{margin:4px 0}.user-dropdown-overlay .user-card__menu.ant-menu{border-inline-end:none;background:transparent}.user-dropdown-overlay .user-card__menu .ant-menu-item{display:flex;align-items:center;gap:8px;height:34px;line-height:34px;margin:0;padding-inline:6px!important;border-radius:6px;width:100%}.user-dropdown-overlay .user-card__menu .ant-menu-item:hover{background:#f4f5f6;color:#1c2d56}.user-dropdown-overlay .user-card__menu .anticon{font-size:15px;color:#8a909c}.layout--main[data-v-1ff241ff]{height:100vh;overflow:hidden}.layout--main[data-v-1ff241ff]>.ant-layout{height:100%}#content-area[data-v-1ff241ff]{padding:16px;background:#f8f8f8;display:flex;height:calc(100vh - 61px);overflow-y:auto}.content-wrapper[data-v-1ff241ff],.content-area__content[data-v-1ff241ff]{display:flex;flex-direction:column;flex:1;min-height:0}
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as c}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{b as _,c as e,w as o,f as l,r as s,o as i}from"./index-CVG99b4v.js";const p={},u={class:"full-page-msg"};function f(n,t){const a=s("a-button"),r=s("a-result");return i(),_("div",u,[e(r,{status:"info",title:"در دست تعمیر","sub-title":"این بخش موقتاً در دسترس نیست."},{extra:o(()=>[e(a,{type:"primary",onClick:t[0]||(t[0]=m=>n.$router.push("/"))},{default:o(()=>[...t[1]||(t[1]=[l("بازگشت به خانه",-1)])]),_:1})]),_:1})])}const b=c(p,[["render",f],["__scopeId","data-v-4e6c833c"]]);export{b as default};
|
||||
@@ -0,0 +1 @@
|
||||
.full-page-msg[data-v-4e6c833c]{min-height:100vh;display:flex;align-items:center;justify-content:center}
|
||||
@@ -1 +0,0 @@
|
||||
import{_}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{b as c,c as e,w as o,f as l,r as s,o as i}from"./index-WFQJAeoE.js";const p={},u={class:"full-page-msg"};function f(n,t){const a=s("a-button"),r=s("a-result");return i(),c("div",u,[e(r,{status:"info",title:"در دست تعمیر","sub-title":"این بخش موقتاً در دسترس نیست."},{extra:o(()=>[e(a,{type:"primary",onClick:t[0]||(t[0]=m=>n.$router.push("/"))},{default:o(()=>[...t[1]||(t[1]=[l("بازگشت به خانه",-1)])]),_:1})]),_:1})])}const x=_(p,[["render",f],["__scopeId","data-v-1eb8f55a"]]);export{x as default};
|
||||
@@ -1 +0,0 @@
|
||||
.full-page-msg[data-v-1eb8f55a]{min-height:100vh;display:flex;align-items:center;justify-content:center}
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
.full-page-msg[data-v-8b21c139]{min-height:100vh;display:flex;align-items:center;justify-content:center}
|
||||
@@ -1 +0,0 @@
|
||||
.full-page-msg[data-v-30826204]{min-height:100vh;display:flex;align-items:center;justify-content:center}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{_}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{b as c,c as e,w as o,f as l,r as s,o as u}from"./index-WFQJAeoE.js";const p={},i={class:"full-page-msg"};function d(r,t){const n=s("a-button"),a=s("a-result");return u(),c("div",i,[e(a,{status:"403",title:"دسترسی غیرمجاز","sub-title":"شما دسترسی لازم برای مشاهده این صفحه را ندارید."},{extra:o(()=>[e(n,{type:"primary",onClick:t[0]||(t[0]=m=>r.$router.push("/"))},{default:o(()=>[...t[1]||(t[1]=[l("بازگشت به خانه",-1)])]),_:1})]),_:1})])}const b=_(p,[["render",d],["__scopeId","data-v-30826204"]]);export{b as default};
|
||||
import{_}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{b as c,c as e,w as o,f as l,r as s,o as u}from"./index-CVG99b4v.js";const p={},i={class:"full-page-msg"};function d(r,t){const n=s("a-button"),a=s("a-result");return u(),c("div",i,[e(a,{status:"403",title:"دسترسی غیرمجاز","sub-title":"شما دسترسی لازم برای مشاهده این صفحه را ندارید."},{extra:o(()=>[e(n,{type:"primary",onClick:t[0]||(t[0]=m=>r.$router.push("/"))},{default:o(()=>[...t[1]||(t[1]=[l("بازگشت به خانه",-1)])]),_:1})]),_:1})])}const x=_(p,[["render",d],["__scopeId","data-v-8b21c139"]]);export{x as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{b as i,O as r,_ as m}from"./omdeListModel-B-zNFWRI.js";import{d as a,a as s,h as t,o as p}from"./index-WFQJAeoE.js";import"./model-Di_BQPv1.js";import"./SettingOutlined-DZJd42S-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ListPageHeader.vue_vue_type_script_setup_true_lang-BmENA4yH.js";import"./bulkCustomer.vue_vue_type_script_setup_true_lang-zBMtv664.js";import"./BaseFormModal.vue_vue_type_script_setup_true_lang-Dwad_3k9.js";import"./ImageUploadInput.vue_vue_type_script_setup_true_lang-BQ_i_QZe.js";import"./UnorderedListOutlined-CvD227Uu.js";const B=a({__name:"OmdeArchivedList",setup(c){const e=r.archived.title,o=i("archived");return(l,n)=>(p(),s(m,{title:t(e),model:t(o)},null,8,["title","model"]))}});export{B as default};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user