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

推荐位编辑fixed

parent b6925bb8
......@@ -67,12 +67,14 @@ export default {
checked: false,
};
},
watch: {},
watch: {
"data.checked"(val) {
this.checked = val===1;
}
},
computed: {},
created() {
if(this.data.checked){
this.checked=true
}
this.checked = this.data.checked===1;
},
mounted() {},
methods: {
......
......@@ -91,6 +91,12 @@ export default {
},
onSubmit(){
var temp_str = ''
if (this.selected_arr.length!==4) {
this.$message.error("推荐位数量只能为4个!");
return;
}
this.selected_arr.forEach((e,idx) => {
if(idx==this.selected_arr.length-1){
temp_str = temp_str + e.id
......@@ -113,7 +119,7 @@ export default {
})
},
change_value(val) {
console.log(val);
// console.log(val);
if(val.check){
this.selected_arr.push(val.data)
}else{
......@@ -127,9 +133,16 @@ export default {
}
},
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
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)
}else if(val.act==1){
var temp = this.selected_arr.splice(index,1)
......@@ -180,7 +193,7 @@ export default {
});
},
getselect(val) {
console.log(val);
// console.log(val);
this.get_select_list(
val.word,
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