flat: 123
This commit is contained in:
@@ -1151,62 +1151,6 @@ export default {
|
||||
this.obj.stime = "";
|
||||
this.obj.etime = "";
|
||||
this.drawer = true;
|
||||
let tradeIdState = this.tradeIdAttr.indexOf(this.obj.tradeId);
|
||||
//判断有无此行业
|
||||
if(tradeIdState == -1){
|
||||
this.obj.tradeId = "";
|
||||
setTimeout(()=>{
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "此任务所包含行业已经不存在,请重新选择!",
|
||||
})
|
||||
},1000);
|
||||
}else{
|
||||
this.tradeState = this.obj.tradeNames;
|
||||
//判断有无此工种
|
||||
getWork(this.obj.tradeId).then((res) => {
|
||||
this.workData = res;
|
||||
this.workDataIdAttr = res.map((ele)=>{
|
||||
return ele.id
|
||||
})
|
||||
let workDataIdState = this.workDataIdAttr.indexOf(this.obj.worktypeIds);
|
||||
//判断有无此工种
|
||||
if(workDataIdState == -1){
|
||||
this.obj.worktypeIds = "";
|
||||
setTimeout(()=>{
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "此任务所包含工种已经不存在,请重新选择!",
|
||||
})
|
||||
},1000);
|
||||
}else{
|
||||
this.workTypeState = this.obj.worktypeNames;
|
||||
getSkillList(this.obj.worktypeIds).then((res) => {
|
||||
this.skillIdAttr = res.data.data.records.map((ele)=>{
|
||||
return ele;
|
||||
});
|
||||
let newSelectedSkills = [];
|
||||
this.skillIdAttr.forEach((val) => {
|
||||
let selectedSkillsState = this.obj.selectedSkills.find(v => v.id == val.id);
|
||||
if(selectedSkillsState){
|
||||
newSelectedSkills.push(val);
|
||||
}
|
||||
})
|
||||
// 判断有无此技能
|
||||
if(newSelectedSkills.length == 0){
|
||||
setTimeout(()=>{
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "此任务所包含技能已经不存在,请重新选择!",
|
||||
})
|
||||
},1000);
|
||||
}else{
|
||||
this.selectedSkills = newSelectedSkills;
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
} else if (type === "add") {
|
||||
this.title = "发布任务";
|
||||
@@ -1232,65 +1176,6 @@ export default {
|
||||
this.obj = res;
|
||||
this.drawer = true;
|
||||
let tradeIdState = this.tradeIdAttr.indexOf(this.obj.tradeId);
|
||||
//判断有无此行业
|
||||
if(tradeIdState == -1){
|
||||
this.$message.closeAll();
|
||||
this.obj.tradeId = "";
|
||||
setTimeout(()=>{
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "此任务所包含行业已经不存在,请重新选择!",
|
||||
})
|
||||
},1000);
|
||||
}else{
|
||||
this.tradeState = this.obj.tradeNames;
|
||||
//判断有无此工种
|
||||
getWork(this.obj.tradeId).then((res) => {
|
||||
this.workData = res;
|
||||
this.workDataIdAttr = res.map((ele)=>{
|
||||
return ele.id
|
||||
})
|
||||
console.log(123,res)
|
||||
let workDataIdState = this.workDataIdAttr.indexOf(this.obj.worktypeIds);
|
||||
//判断有无此工种
|
||||
if(workDataIdState == -1){
|
||||
this.$message.closeAll();
|
||||
this.obj.worktypeIds = "";
|
||||
setTimeout(()=>{
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "此任务所包含工种已经不存在,请重新选择!",
|
||||
})
|
||||
},1000);
|
||||
}else{
|
||||
this.workTypeState = this.obj.worktypeNames;
|
||||
getSkillList(this.obj.worktypeIds).then((res) => {
|
||||
this.skillIdAttr = res.data.data.records.map((ele)=>{
|
||||
return ele;
|
||||
});
|
||||
let newSelectedSkills = [];
|
||||
this.skillIdAttr.forEach((val) => {
|
||||
let selectedSkillsState = this.obj.selectedSkills.find(v => v.id == val.id);
|
||||
if(selectedSkillsState){
|
||||
newSelectedSkills.push(val);
|
||||
}
|
||||
})
|
||||
// 判断有无此技能
|
||||
if(newSelectedSkills.length == 0){
|
||||
setTimeout(()=>{
|
||||
this.$message.closeAll();
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "此任务所包含技能已经不存在,请重新选择!",
|
||||
})
|
||||
},1000);
|
||||
}else{
|
||||
this.selectedSkills = newSelectedSkills;
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user