Commit a6475a4b authored by 徐一鸣's avatar 徐一鸣

推荐位编辑fixed

parent b6925bb8
...@@ -67,12 +67,14 @@ export default { ...@@ -67,12 +67,14 @@ export default {
checked: false, checked: false,
}; };
}, },
watch: {}, watch: {
"data.checked"(val) {
this.checked = val===1;
}
},
computed: {}, computed: {},
created() { created() {
if(this.data.checked){ this.checked = this.data.checked===1;
this.checked=true
}
}, },
mounted() {}, mounted() {},
methods: { methods: {
......
...@@ -91,6 +91,12 @@ export default { ...@@ -91,6 +91,12 @@ export default {
}, },
onSubmit(){ onSubmit(){
var temp_str = '' var temp_str = ''
if (this.selected_arr.length!==4) {
this.$message.error("推荐位数量只能为4个!");
return;
}
this.selected_arr.forEach((e,idx) => { this.selected_arr.forEach((e,idx) => {
if(idx==this.selected_arr.length-1){ if(idx==this.selected_arr.length-1){
temp_str = temp_str + e.id temp_str = temp_str + e.id
...@@ -113,7 +119,7 @@ export default { ...@@ -113,7 +119,7 @@ export default {
}) })
}, },
change_value(val) { change_value(val) {
console.log(val); // console.log(val);
if(val.check){ if(val.check){
this.selected_arr.push(val.data) this.selected_arr.push(val.data)
}else{ }else{
...@@ -127,9 +133,16 @@ export default { ...@@ -127,9 +133,16 @@ export default {
} }
}, },
rank_value(val) { rank_value(val) {
console.log(val); // console.log(val);
var index = val.position=='start'?0:val.position=='end'?this.selected_arr.length-1:val.position var index = val.position=='start'?0:val.position=='end'?this.selected_arr.length-1:val.position
if(val.act==2){ if(val.act==2){
for (let i = 0; i < this.select_able_arr.length; i++) {
let item = this.select_able_arr[i];
if (item.id===val.id) {
this.$set(item, "checked", 0);
break;
}
}
this.selected_arr.splice(index,1) this.selected_arr.splice(index,1)
}else if(val.act==1){ }else if(val.act==1){
var temp = this.selected_arr.splice(index,1) var temp = this.selected_arr.splice(index,1)
...@@ -180,7 +193,7 @@ export default { ...@@ -180,7 +193,7 @@ export default {
}); });
}, },
getselect(val) { getselect(val) {
console.log(val); // console.log(val);
this.get_select_list( this.get_select_list(
val.word, val.word,
val.serviceTypeInfo.join(), val.serviceTypeInfo.join(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment