Merge branch 'master' of https://gitee.com/beiwu/cmanager
This commit is contained in:
@@ -148,8 +148,11 @@ const accept = [
|
||||
];
|
||||
|
||||
function getPath(path) {
|
||||
const arr = path.split(",");
|
||||
return arr[arr.length - 1];
|
||||
if(path) {
|
||||
const arr = path.split(",");
|
||||
return arr[arr.length - 1];
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
||||
export default {
|
||||
@@ -829,9 +832,10 @@ export default {
|
||||
this.obj.address = form.address + (form.title || "");
|
||||
this.obj.lat = form.lat;
|
||||
this.obj.lon = form.lng;
|
||||
this.form.companyAddress = form.address + (form.title || "");
|
||||
},
|
||||
addressDel(){
|
||||
this.obj.address = "";
|
||||
this.form.companyAddress = this.obj.address = "";
|
||||
},
|
||||
// uploadBefore(file, done, loading) {
|
||||
// const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
|
||||
@@ -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