update: change the type
This commit is contained in:
@@ -3,9 +3,27 @@
|
||||
<div class="agentDetailsModal">
|
||||
<el-form label-position="top" :model="agent">
|
||||
<el-form-item label="نوع نماینده">
|
||||
<el-input v-if="agent.representation_type === 'both'" disabled value="نماینده هر دو نوع لوازم"/>
|
||||
<el-input v-if="agent.representation_type === 'verity'" disabled value="نماینده لوازم جانبی کامپیوتر و موبایل"/>
|
||||
<el-input v-if="agent.representation_type === 'panatech'" disabled value="نماینده لوازم صوتی تصویری خودرو"/>
|
||||
<div v-if="Array.isArray(agent.representation_type) && agent.representation_type.length > 0">
|
||||
<div>
|
||||
<span v-if="agent.representation_type.includes('mobile_accessories')">محصولات جانبی موبایل</span>
|
||||
<span v-if="agent.representation_type.includes('computer_accessories')">، محصولات جانبی کامپیوتر</span>
|
||||
<span v-if="agent.representation_type.includes('memory_products')">، محصولات حافظه</span>
|
||||
<span v-if="agent.representation_type.includes('car_audio_video')">، محصولات صوتی و تصویری خودرو</span>
|
||||
<span v-if="agent.representation_type.includes('home_products')">، محصولات خانگی</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Handle legacy data -->
|
||||
<el-input v-else-if="agent.representation_type === 'both'" disabled value="نماینده هر دو نوع لوازم" />
|
||||
<el-input
|
||||
v-else-if="agent.representation_type === 'verity'"
|
||||
disabled
|
||||
value="نماینده لوازم جانبی کامپیوتر و موبایل"
|
||||
/>
|
||||
<el-input
|
||||
v-else-if="agent.representation_type === 'panatech'"
|
||||
disabled
|
||||
value="نماینده لوازم صوتی تصویری خودرو"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="نام فروشگاه">
|
||||
|
||||
@@ -20,17 +20,50 @@
|
||||
<div class="formRow selectable full" :class="validation.representation_type && 'err'">
|
||||
<span>نمایندگی:</span>
|
||||
<div class="options">
|
||||
<label for="representation_type2">
|
||||
<span>لوازم جانبی کامپیوتر و موبایل</span>
|
||||
<input id="representation_type2" v-model="formData.representation_type" type="radio" value="verity" />
|
||||
</label>
|
||||
<label for="representation_type1">
|
||||
<span>لوازم صوتی و تصویری خودرو</span>
|
||||
<input id="representation_type1" v-model="formData.representation_type" type="radio" value="panatech" />
|
||||
<span>محصولات جانبی موبایل</span>
|
||||
<input
|
||||
id="representation_type1"
|
||||
v-model="formData.representation_type"
|
||||
type="checkbox"
|
||||
value="mobile_accessories"
|
||||
/>
|
||||
</label>
|
||||
<label for="representation_type2">
|
||||
<span>محصولات جانبی کامپیوتر</span>
|
||||
<input
|
||||
id="representation_type2"
|
||||
v-model="formData.representation_type"
|
||||
type="checkbox"
|
||||
value="computer_accessories"
|
||||
/>
|
||||
</label>
|
||||
<label for="representation_type3">
|
||||
<span>هر دو گزینه</span>
|
||||
<input id="representation_type3" v-model="formData.representation_type" type="radio" value="both" />
|
||||
<span>محصولات حافظه</span>
|
||||
<input
|
||||
id="representation_type3"
|
||||
v-model="formData.representation_type"
|
||||
type="checkbox"
|
||||
value="memory_products"
|
||||
/>
|
||||
</label>
|
||||
<label for="representation_type4">
|
||||
<span>محصولات صوتی و تصویری خودرو</span>
|
||||
<input
|
||||
id="representation_type4"
|
||||
v-model="formData.representation_type"
|
||||
type="checkbox"
|
||||
value="car_audio_video"
|
||||
/>
|
||||
</label>
|
||||
<label for="representation_type5">
|
||||
<span>محصولات خانگی</span>
|
||||
<input
|
||||
id="representation_type5"
|
||||
v-model="formData.representation_type"
|
||||
type="checkbox"
|
||||
value="home_products"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
<p v-if="validation.representation_type">{{ validation.representation_type.msg }}</p>
|
||||
@@ -240,7 +273,7 @@
|
||||
<span>تلفن همراه:</span>
|
||||
<input
|
||||
id="mobile_number"
|
||||
v-model=" formData.mobile_number "
|
||||
v-model="formData.mobile_number"
|
||||
type="text"
|
||||
name="mobile_number"
|
||||
autocomplete="false"
|
||||
@@ -892,9 +925,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initForm(){
|
||||
initForm() {
|
||||
const rawForm = {
|
||||
representation_type: '',
|
||||
representation_type: [],
|
||||
// personal info
|
||||
// full_name: '',
|
||||
birth_date: '',
|
||||
@@ -999,7 +1032,6 @@ export default {
|
||||
data.province_id = this.user.province_id
|
||||
data.city_name = this.user.city_name
|
||||
data.city_id = this.user.city_id
|
||||
|
||||
|
||||
this.$axios
|
||||
.post(`/api/user/representation`, data)
|
||||
|
||||
Reference in New Issue
Block a user