add no.calon for selectednominee
This commit is contained in:
@@ -9,8 +9,9 @@
|
||||
</li>
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item" v-for="nominee_id in selected[0].nominee_id">
|
||||
<b> - {{ getSelectedNomineeName(nominee_id) }}</b>
|
||||
<b> - [{{ getNomineeNo(nominee_id) }}] {{ getSelectedNomineeName(nominee_id) }}</b>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<li class="list-group-item">
|
||||
@@ -43,7 +44,8 @@
|
||||
<tbody>
|
||||
<tr v-for="(nominee, index) in data.nominees" v-if="nominee.position_id == position.id"
|
||||
:key="nominee.id">
|
||||
<td><input type="checkbox" :id="nominee.id" :disabled="disabledCheckboxes[index]" @change="vote(position.id, nominee.id)" />
|
||||
<td><input type="checkbox" :id="nominee.id" :disabled="disabledCheckboxes[index]"
|
||||
@change="vote(position.id, nominee.id)" />
|
||||
</td>
|
||||
<td>{{ nominee.no_calon }}</td>
|
||||
<td><img @click="view(i)" :src="createBase64ImageUrl(nominee.photo)" class="thumbnail"
|
||||
@@ -192,6 +194,12 @@ export default {
|
||||
return this.getNominee(id);
|
||||
},
|
||||
|
||||
getNomineeNo(id) {
|
||||
const nominee = this.data.nominees.find(n => n.id === id);
|
||||
return nominee ? nominee.no_calon : '';
|
||||
},
|
||||
|
||||
|
||||
getName: function (id) {
|
||||
let positions = this.data.positions;
|
||||
let selected = this.selected;
|
||||
@@ -232,17 +240,17 @@ export default {
|
||||
return "data:image/png;base64," + base64ImageData;
|
||||
},
|
||||
|
||||
checkUndi: function(){
|
||||
if(this.selected[0]['nominee_id'].length <= 0){
|
||||
checkUndi: function () {
|
||||
if (this.selected[0]['nominee_id'].length <= 0) {
|
||||
this.util.notify('Sila pastikan anda memilih (1) orang calon.', 'error');
|
||||
}else{
|
||||
} else {
|
||||
this.util.showModal('#vote-modal');
|
||||
}
|
||||
return;
|
||||
},
|
||||
|
||||
checkDisabled: function(){
|
||||
if(this.selected[0]['nominee_id'].length >= this.max){
|
||||
checkDisabled: function () {
|
||||
if (this.selected[0]['nominee_id'].length >= this.max) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user