界面优化
This commit is contained in:
@@ -298,7 +298,6 @@ export default {
|
||||
|
||||
cateOneList: [],
|
||||
cateTwoList: [],
|
||||
formR: {},
|
||||
|
||||
areasList: [],
|
||||
assemAreaList: [],
|
||||
@@ -318,13 +317,15 @@ export default {
|
||||
methods: {
|
||||
executorPersonConvert(executorPerson){
|
||||
let executorPersonName = "";
|
||||
executorPerson.forEach(person => {
|
||||
this.cpUserList.forEach( user => {
|
||||
if (person == user.id) {
|
||||
executorPersonName += user.name + "\n";
|
||||
}
|
||||
if (executorPerson != null) {
|
||||
executorPerson.forEach(person => {
|
||||
this.cpUserList.forEach( user => {
|
||||
if (person == user.id) {
|
||||
executorPersonName += user.name + "\n";
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
return executorPersonName;
|
||||
},
|
||||
areaConvert(area){
|
||||
@@ -339,7 +340,6 @@ export default {
|
||||
})
|
||||
return areaMsg;
|
||||
}
|
||||
|
||||
},
|
||||
resouceConvert(resources){
|
||||
let resouceMsg = "";
|
||||
@@ -442,16 +442,6 @@ export default {
|
||||
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
||||
// 执行查询
|
||||
getTaskPage(params).then(response => {
|
||||
//1 循环list
|
||||
response.data.list.forEach(element => {
|
||||
if (element.images != null) {
|
||||
//有图片转json
|
||||
element.images = JSON.parse(element.images);
|
||||
} else {
|
||||
//无图片给个空
|
||||
element.images = [];
|
||||
}
|
||||
});
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
@@ -468,13 +458,6 @@ export default {
|
||||
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
||||
// 执行查询
|
||||
getTaskSearchPage(params).then(response => {
|
||||
response.data.list.forEach(element => {
|
||||
if (element.images != null) {
|
||||
element.images = JSON.parse(element.images);
|
||||
} else {
|
||||
element.images = [];
|
||||
}
|
||||
});
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
@@ -535,10 +518,6 @@ export default {
|
||||
const id = row.id;
|
||||
getTask(id).then(response => {
|
||||
this.form = response.data;
|
||||
if (response.data.images != null) {
|
||||
let imagesArr = JSON.parse(response.data.images);
|
||||
this.form.images = imagesArr;
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "修改农场任务";
|
||||
});
|
||||
@@ -550,15 +529,8 @@ export default {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
//图片转json
|
||||
let im = this.form.images;
|
||||
this.form.images = JSON.stringify("");
|
||||
if (im) {
|
||||
//不为空
|
||||
let imgArr = im.split(",")
|
||||
this.form.images = JSON.stringify(imgArr);
|
||||
}
|
||||
|
||||
this.judgePictureExists();
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateTask(this.form).then(response => {
|
||||
@@ -576,6 +548,24 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
/*判断图片是否存在*/
|
||||
judgePictureExists(){
|
||||
if (this.form.id != null) {
|
||||
if (this.form.images == "") {
|
||||
this.form.images = [];
|
||||
}else{
|
||||
let imagesType = typeof(this.form.images);
|
||||
if (imagesType == "string") {
|
||||
let imgArr = this.form.images.split(",")
|
||||
this.form.images = imgArr;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this.form.images == undefined || this.form.images =="") {
|
||||
this.form.images = [];
|
||||
}
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
@@ -643,7 +633,7 @@ export default {
|
||||
changeProject(row) {
|
||||
this.form.areas = null;
|
||||
this.assemArea();
|
||||
let projectArea = JSON.parse(this.projectList.filter(project => project.id == row)[0].areas);
|
||||
let projectArea = this.projectList.filter(project => project.id == row)[0].areas;
|
||||
let filterArr = [];
|
||||
this.assemAreaList.forEach(t => {
|
||||
projectArea.forEach(a => {
|
||||
|
||||
Reference in New Issue
Block a user