update: change the type

This commit is contained in:
mahyargdz
2025-05-27 16:43:26 +03:30
parent a771f7e199
commit d24481b598
8 changed files with 384 additions and 207 deletions
+27 -4
View File
@@ -45,12 +45,28 @@
<el-table-column prop="full_name" label="نام" width=""> </el-table-column>
<el-table-column prop="mobile_number" label="شماره موبایل" width=""> </el-table-column>
<el-table-column label="نوع نماینده" width="300">
<template slot-scope="scope">
<span v-if="scope.row.representation_type === 'both'">نماینده هر دو نوع لوازم</span>
<span v-if="scope.row.representation_type === 'verity'">نماینده لوازم جانبی کامپیوتر و موبایل</span>
<span v-if="scope.row.representation_type === 'panatech'">نماینده لوازم صوتی تصویری خودرو</span>
<!-- Handle new representation_type format (array) -->
<div v-if="Array.isArray(scope.row.representation_type) && scope.row.representation_type.length > 0">
<span v-if="scope.row.representation_type.includes('mobile_accessories')">محصولات جانبی موبایل</span>
<span v-if="scope.row.representation_type.includes('computer_accessories')"
>، محصولات جانبی کامپیوتر</span
>
<span v-if="scope.row.representation_type.includes('memory_products')">، محصولات حافظه</span>
<span v-if="scope.row.representation_type.includes('car_audio_video')"
>، محصولات صوتی و تصویری خودرو</span
>
<span v-if="scope.row.representation_type.includes('home_products')">، محصولات خانگی</span>
<!-- Handle legacy data -->
<span v-else-if="scope.row.representation_type.includes('both')">نماینده هر دو نوع لوازم (قدیمی)</span>
<span v-else-if="scope.row.representation_type.includes('verity')">
نماینده لوازم جانبی کامپیوتر و موبایل (قدیمی)</span
>
<span v-else-if="scope.row.representation_type.includes('panatech')">
نماینده لوازم صوتی تصویری خودرو (قدیمی)</span
>
</div>
</template>
</el-table-column>
@@ -105,6 +121,13 @@
:description="validation.first_name ? validation.first_name.msg : null"
:class="validation.first_name ? 'err' : null"
/>
<CInput
v-model="registerData.representation_code"
label="کد نماینده"
horizontal
:description="validation.representation_code ? validation.representation_code.msg : null"
:class="validation.representation_code ? 'err' : null"
/>
<CInput
v-model="registerData.last_name"
label="نام خانوادگی"