feat: one piece per variant and optional admin rial wage
A customer cart line is a single piece, the home reel opens on tap, and a variant can be saved without a rial wage. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
:aria-label="mode === 'create' ? 'افزودن تنوع جدید' : 'ویرایش تنوع'"
|
||||
@keydown="onKeydown"
|
||||
>
|
||||
<!-- required: what every weight variant needs -->
|
||||
<!-- weight and percent wage are required; rial wage may be left empty -->
|
||||
<div class="vre__primary">
|
||||
<a-form-item
|
||||
class="vre__item"
|
||||
@@ -51,7 +51,6 @@
|
||||
<a-form-item
|
||||
class="vre__item"
|
||||
label="اجرت ریالی"
|
||||
required
|
||||
:validate-status="errors.rial_pay ? 'error' : ''"
|
||||
:help="errors.rial_pay"
|
||||
>
|
||||
@@ -61,7 +60,7 @@
|
||||
:min="0"
|
||||
:step="50000"
|
||||
addon-after="ریال"
|
||||
placeholder="نداشت: صفر"
|
||||
placeholder="اختیاری"
|
||||
:formatter="formatThousands"
|
||||
:parser="parseThousands"
|
||||
/>
|
||||
|
||||
@@ -111,7 +111,7 @@ export function validateVariant(v: VariantRow): VariantErrors {
|
||||
else if (Number(v.grams) <= 0) e.grams = 'وزن باید بیشتر از صفر باشد';
|
||||
if (!isBlank(v.qty) && Number(v.qty) < 0) e.qty = 'تعداد منفی نمیشود';
|
||||
if (isBlank(v.percentage_pay)) e.percentage_pay = 'اجرت درصدی را وارد کنید';
|
||||
if (isBlank(v.rial_pay)) e.rial_pay = 'اجرت ریالی را وارد کنید؛ اگر ندارد صفر بزنید';
|
||||
if (!isBlank(v.rial_pay) && Number(v.rial_pay) < 0) e.rial_pay = 'اجرت ریالی منفی نمیشود';
|
||||
return e;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user