added kilogram

This commit is contained in:
2026-06-09 11:24:42 +03:30
parent 8bbe90879e
commit 4056b47d59
3 changed files with 20 additions and 8 deletions
@@ -57,9 +57,9 @@
</a-radio-group>
</div>
<div v-if="weightOption === '1'" class="flex items-center">
<span class="ml-4 ">وزن به گرم :</span>
<span class="ml-4 ">{{ weightFieldLabel }} :</span>
<BasicInput v-model:value="form.amount" type="number" />
<div class="mt-1 mr-4" v-if="form.amount && form.amount < 1 && 0 < form.amount">معادل {{ form.amount * 1000 }} سوت</div>
<div class="mt-1 mr-4" v-if="form.amount && form.amount < 1 && 0 < form.amount && !isBourseCuProject">معادل {{ form.amount * 1000 }} سوت</div>
</div>
</div>
@@ -137,6 +137,7 @@ import BaseCollapse from '@/components/BaseCollapse.vue'
import IndexImageUploader from '@/components/ProductUploader/IndexImageUploader.vue'
import { getConfigApp } from '@/utils/config'
import dayjs from 'dayjs'
import { computed } from 'vue'
const props = defineProps<{
form: any
@@ -156,6 +157,13 @@ const props = defineProps<{
editId?: number
}>()
const isBourseCuProject = computed(() => getConfigApp('name') === 'boursecu')
const weightFieldLabel = computed(() =>
isBourseCuProject.value && (props.form.unit === 'کیلوگرم' || !props.form.unit)
? 'وزن به کیلوگرم'
: 'وزن به گرم'
)
function onOrderLimitChange(checked: boolean) {
if (!checked) {
props.form.min_order_cash = undefined
+9 -1
View File
@@ -73,6 +73,7 @@ import {
unwrapApiRecord
} from '@/utils/file'
import { normalizeProductOrderLimitForm, validateProductOrderLimitForm } from '@/utils/productOrderLimit'
import { getConfigApp } from '@/utils/config'
dayjs.extend(customParseFormat)
@@ -103,7 +104,14 @@ const customLocale = ref({
}
})
const unitItems: Array<Item> = [{ value: 'عدد' }, { value: 'گرم' }]
const unitItems = computed<Array<Item>>(() => {
if (getConfigApp('name') === 'boursecu') {
return [{ value: 'کیلوگرم' }, { value: 'عدد' }, { value: 'گرم' }]
}
return [{ value: 'عدد' }, { value: 'گرم' }]
})
const GaroosiCategoryItems: Array<Item> = [
{ value: 'طلا' },
{ value: 'مکعب' },