界面优化
This commit is contained in:
@@ -66,7 +66,7 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="" prop="name">
|
<el-form-item label="区域名" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入" />
|
<el-input v-model="form.name" placeholder="请输入" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
@@ -36,9 +36,8 @@
|
|||||||
<el-table-column label="物料图片" align="center" prop="images" >
|
<el-table-column label="物料图片" align="center" prop="images" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-image
|
<el-image
|
||||||
style=""
|
v-if="scope.row.images[0] != null"
|
||||||
:src="scope.row.images.split(',')[0]"
|
:src="scope.row.images[0]" :preview-src-list="scope.row.images">
|
||||||
:preview-src-list="scope.row.images.split(',')">
|
|
||||||
</el-image>
|
</el-image>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -192,6 +191,7 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.judgePictureExists();
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateCrop(this.form).then(response => {
|
updateCrop(this.form).then(response => {
|
||||||
@@ -209,6 +209,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) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
|
|||||||
@@ -40,8 +40,9 @@
|
|||||||
<el-table-column label="讨论内容" align="center" prop="content" />
|
<el-table-column label="讨论内容" align="center" prop="content" />
|
||||||
<el-table-column label="事件图片" align="center" prop="images">
|
<el-table-column label="事件图片" align="center" prop="images">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-image style="" :src="scope.row.images.split(',')[0]"
|
<el-image
|
||||||
:preview-src-list="scope.row.images.split(',')">
|
v-if="scope.row.images[0] != null"
|
||||||
|
:src="scope.row.images[0]" :preview-src-list="scope.row.images">
|
||||||
</el-image>
|
</el-image>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -254,6 +255,7 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.judgePictureExists();
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateDiscuss(this.form).then(response => {
|
updateDiscuss(this.form).then(response => {
|
||||||
@@ -271,6 +273,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) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
|
|||||||
@@ -38,14 +38,26 @@
|
|||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<el-table v-loading="loading" stripe :data="list">
|
<el-table v-loading="loading" stripe :data="list">
|
||||||
<el-table-column label="事件ID" align="center" prop="id" />
|
<el-table-column label="事件ID" align="center" prop="id" />
|
||||||
<el-table-column label="项目名" align="center" prop="projectId" />
|
<el-table-column label="项目名" align="center" prop="projectId">
|
||||||
<el-table-column label="任务名" align="center" prop="taskId" />
|
<template slot-scope="scope">
|
||||||
|
<span>{{projectList.find(p => p.id == scope.row.projectId).name}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="任务名" align="center" prop="taskId" /> -->
|
||||||
|
|
||||||
|
<el-table-column label="任务类型及内容" align="center" prop="taskId">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{taskConvert(scope.row.taskId)}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="事件名" align="center" prop="name" />
|
<el-table-column label="事件名" align="center" prop="name" />
|
||||||
<el-table-column label="事件内容" align="center" prop="content" />
|
<el-table-column label="事件内容" align="center" prop="content" />
|
||||||
<el-table-column label="事件图片" align="center" prop="images">
|
<el-table-column label="事件图片" align="center" prop="images">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-image style="" :src="scope.row.images.split(',')[0]"
|
<el-image
|
||||||
:preview-src-list="scope.row.images.split(',')">
|
v-if="scope.row.images[0] != null"
|
||||||
|
:src="scope.row.images[0]" :preview-src-list="scope.row.images">
|
||||||
</el-image>
|
</el-image>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -70,7 +82,6 @@
|
|||||||
<!-- 对话框(添加 / 修改) -->
|
<!-- 对话框(添加 / 修改) -->
|
||||||
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
|
||||||
<el-form-item label="项目" prop="projectId">
|
<el-form-item label="项目" prop="projectId">
|
||||||
<el-select v-model="form.projectId" placeholder="请选择项目">
|
<el-select v-model="form.projectId" placeholder="请选择项目">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -81,7 +92,6 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="任务" prop="projectId">
|
<el-form-item label="任务" prop="projectId">
|
||||||
<el-select v-model="form.taskId" placeholder="请选择任务">
|
<el-select v-model="form.taskId" placeholder="请选择任务">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -92,7 +102,6 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="事件名" prop="name">
|
<el-form-item label="事件名" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入" />
|
<el-input v-model="form.name" placeholder="请输入" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -117,7 +126,7 @@ import ImageUpload from '@/components/ImageUpload';
|
|||||||
import Editor from '@/components/Editor';
|
import Editor from '@/components/Editor';
|
||||||
import { getProjectPage } from "@/api/farm/project";
|
import { getProjectPage } from "@/api/farm/project";
|
||||||
import { getTaskPage } from "@/api/farm/task";
|
import { getTaskPage } from "@/api/farm/task";
|
||||||
|
import {getTaskCatePage} from "@/api/farm/taskCate";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Event",
|
name: "Event",
|
||||||
@@ -163,18 +172,33 @@ export default {
|
|||||||
projectList:[],
|
projectList:[],
|
||||||
projectId:'',
|
projectId:'',
|
||||||
taskId:'',
|
taskId:'',
|
||||||
|
taskCateList:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getProject();
|
this.getProject();
|
||||||
|
this.getTaskCate();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
taskConvert(task){
|
||||||
|
let taskArr = this.taskList.filter(t => t.id == task)[0];
|
||||||
|
let taskTypeName = "";
|
||||||
|
let taskName = "";
|
||||||
|
this.taskCateList.forEach(cate =>{
|
||||||
|
if (cate.id == taskArr.taskCateId) {
|
||||||
|
taskTypeName = cate.name;
|
||||||
|
}
|
||||||
|
if (cate.id == taskArr.taskCateName) {
|
||||||
|
taskName = cate.name;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return taskTypeName + "/" +taskName;
|
||||||
|
},
|
||||||
/*获取项目列表*/
|
/*获取项目列表*/
|
||||||
getProject(){
|
getProject(){
|
||||||
getProjectPage({
|
getProjectPage({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 100,
|
||||||
name: null,
|
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
this.projectList = res.data.list;
|
this.projectList = res.data.list;
|
||||||
this.getTask();
|
this.getTask();
|
||||||
@@ -184,13 +208,20 @@ export default {
|
|||||||
getTask(){
|
getTask(){
|
||||||
getTaskPage({
|
getTaskPage({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 100,
|
||||||
name: null,
|
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
this.taskList = res.data.list;
|
this.taskList = res.data.list;
|
||||||
this.getList();
|
this.getList();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getTaskCate(){
|
||||||
|
getTaskCatePage({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 100,
|
||||||
|
}).then(res =>{
|
||||||
|
this.taskCateList = res.data.list;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
getList() {
|
getList() {
|
||||||
@@ -201,20 +232,20 @@ export default {
|
|||||||
// 执行查询
|
// 执行查询
|
||||||
getEventPage(params).then(response => {
|
getEventPage(params).then(response => {
|
||||||
|
|
||||||
//循环遍历List
|
// //循环遍历List
|
||||||
response.data.list.forEach(eve => {
|
// response.data.list.forEach(eve => {
|
||||||
//循环对比 project
|
// //循环对比 project
|
||||||
this.projectList.forEach(project =>{
|
// this.projectList.forEach(project =>{
|
||||||
if(project.id == eve.projectId){
|
// if(project.id == eve.projectId){
|
||||||
eve.projectId = project.name;
|
// eve.projectId = project.name;
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
this.taskList.forEach(task =>{
|
// this.taskList.forEach(task =>{
|
||||||
if (task.id == eve.taskId) {
|
// if (task.id == eve.taskId) {
|
||||||
eve.taskId = task.name;
|
// eve.taskId = task.name;
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
});
|
// });
|
||||||
|
|
||||||
this.list = response.data.list;
|
this.list = response.data.list;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
@@ -297,6 +328,7 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.judgePictureExists();
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateEvent(this.form).then(response => {
|
updateEvent(this.form).then(response => {
|
||||||
@@ -314,6 +346,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) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
|
|||||||
@@ -55,10 +55,9 @@
|
|||||||
<el-table-column label="ID" align="center" prop="id" />
|
<el-table-column label="ID" align="center" prop="id" />
|
||||||
<el-table-column label="项目名" align="center" prop="name" />
|
<el-table-column label="项目名" align="center" prop="name" />
|
||||||
<el-table-column label="项目内容" align="center" prop="content" />
|
<el-table-column label="项目内容" align="center" prop="content" />
|
||||||
<!-- <el-table-column label="区域名" align="center" prop="areas"/> -->
|
|
||||||
<el-table-column label="区域名" align="center" prop="areas" width="80" >
|
<el-table-column label="区域名" align="center" prop="areas" width="80" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{areasConvert(scope.row.areas)}}</span>
|
<span>{{areasConvert(scope.row.areas)}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="作物名" align="center" prop="cropId" >
|
<el-table-column label="作物名" align="center" prop="cropId" >
|
||||||
@@ -66,19 +65,16 @@
|
|||||||
<span> {{cropList.find(t=>t.id == scope.row.cropId ).name}} </span>
|
<span> {{cropList.find(t=>t.id == scope.row.cropId ).name}} </span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="项目成员" align="center" prop="members"/> -->
|
|
||||||
|
|
||||||
<el-table-column label="项目成员" align="center" prop="members">
|
<el-table-column label="项目成员" align="center" prop="members">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{membersConvert(scope.row.members)}}</span>
|
<span>{{membersConvert(scope.row.members)}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
<el-table-column label="图片" align="center" prop="images">
|
<el-table-column label="图片" align="center" prop="images">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-image style="" :src="scope.row.images.split(',')[0]"
|
<el-image
|
||||||
:preview-src-list="scope.row.images.split(',')">
|
v-if="scope.row.images[0] != null"
|
||||||
|
:src="scope.row.images[0]" :preview-src-list="scope.row.images">
|
||||||
</el-image>
|
</el-image>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -376,7 +372,7 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.judgePictureExists();
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateProject(this.form).then(response => {
|
updateProject(this.form).then(response => {
|
||||||
@@ -394,6 +390,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) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
|
|||||||
@@ -61,9 +61,7 @@
|
|||||||
<el-table-column label="图片" align="center" prop="images" >
|
<el-table-column label="图片" align="center" prop="images" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-image
|
<el-image
|
||||||
style=""
|
v-if="scope.row.images[0] != null" :src="scope.row.images[0]" :preview-src-list="scope.row.images">
|
||||||
:src="scope.row.images.split(',')[0]"
|
|
||||||
:preview-src-list="scope.row.images.split(',')">
|
|
||||||
</el-image>
|
</el-image>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -119,10 +117,10 @@
|
|||||||
<imageUpload v-model="form.images"/>
|
<imageUpload v-model="form.images"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="有效期开始:" prop="validityStartTime">
|
<el-form-item label="有效期开始:" prop="validityStartTime">
|
||||||
<el-date-picker clearable v-model="form.validityStartTime" type="date" value-format="timestamp" placeholder="选择" />
|
<el-date-picker clearable v-model="form.validityStartTime" type="datetime" value-format="timestamp" placeholder="选择" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="有效期结束:" prop="validityEndTime">
|
<el-form-item label="有效期结束:" prop="validityEndTime">
|
||||||
<el-date-picker clearable v-model="form.validityEndTime" type="date" value-format="timestamp" placeholder="选择" />
|
<el-date-picker clearable v-model="form.validityEndTime" type="datetime" value-format="timestamp" placeholder="选择" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="唯一占用:" prop="solo">
|
<el-form-item label="唯一占用:" prop="solo">
|
||||||
<el-radio-group v-model="form.solo">
|
<el-radio-group v-model="form.solo">
|
||||||
@@ -184,6 +182,10 @@ export default {
|
|||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
|
resourceType: [{ required: true, message: "资源类型不能为空", trigger: "blur" }],
|
||||||
|
name: [{ required: true, message: "资源名称不能为空", trigger: "blur" }],
|
||||||
|
validityStartTime: [{ required: true, message: "有效期开始不能为空", trigger: "blur" }],
|
||||||
|
validityEndTime: [{ required: true, message: "有效期结束不能为空", trigger: "blur" }],
|
||||||
},
|
},
|
||||||
resourceTypeList:[]
|
resourceTypeList:[]
|
||||||
};
|
};
|
||||||
@@ -193,7 +195,6 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@@ -269,10 +270,12 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
|
console.log("农场资源提交信息", this.form);
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.judgePictureExists();
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateResource(this.form).then(response => {
|
updateResource(this.form).then(response => {
|
||||||
@@ -290,6 +293,21 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/*判断图片是否存在*/
|
||||||
|
judgePictureExists(){
|
||||||
|
if (this.form.id != null) {
|
||||||
|
if (this.form.images == "") {
|
||||||
|
this.form.images = [];
|
||||||
|
}else{
|
||||||
|
let imgArr = this.form.images.split(",")
|
||||||
|
this.form.images = imgArr;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.form.images == undefined) {
|
||||||
|
this.form.images = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
|
|||||||
@@ -298,7 +298,6 @@ export default {
|
|||||||
|
|
||||||
cateOneList: [],
|
cateOneList: [],
|
||||||
cateTwoList: [],
|
cateTwoList: [],
|
||||||
formR: {},
|
|
||||||
|
|
||||||
areasList: [],
|
areasList: [],
|
||||||
assemAreaList: [],
|
assemAreaList: [],
|
||||||
@@ -318,13 +317,15 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
executorPersonConvert(executorPerson){
|
executorPersonConvert(executorPerson){
|
||||||
let executorPersonName = "";
|
let executorPersonName = "";
|
||||||
executorPerson.forEach(person => {
|
if (executorPerson != null) {
|
||||||
this.cpUserList.forEach( user => {
|
executorPerson.forEach(person => {
|
||||||
if (person == user.id) {
|
this.cpUserList.forEach( user => {
|
||||||
executorPersonName += user.name + "\n";
|
if (person == user.id) {
|
||||||
}
|
executorPersonName += user.name + "\n";
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
return executorPersonName;
|
return executorPersonName;
|
||||||
},
|
},
|
||||||
areaConvert(area){
|
areaConvert(area){
|
||||||
@@ -339,7 +340,6 @@ export default {
|
|||||||
})
|
})
|
||||||
return areaMsg;
|
return areaMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
resouceConvert(resources){
|
resouceConvert(resources){
|
||||||
let resouceMsg = "";
|
let resouceMsg = "";
|
||||||
@@ -442,16 +442,6 @@ export default {
|
|||||||
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
||||||
// 执行查询
|
// 执行查询
|
||||||
getTaskPage(params).then(response => {
|
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.list = response.data.list;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@@ -468,13 +458,6 @@ export default {
|
|||||||
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
||||||
// 执行查询
|
// 执行查询
|
||||||
getTaskSearchPage(params).then(response => {
|
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.list = response.data.list;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@@ -535,10 +518,6 @@ export default {
|
|||||||
const id = row.id;
|
const id = row.id;
|
||||||
getTask(id).then(response => {
|
getTask(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
if (response.data.images != null) {
|
|
||||||
let imagesArr = JSON.parse(response.data.images);
|
|
||||||
this.form.images = imagesArr;
|
|
||||||
}
|
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改农场任务";
|
this.title = "修改农场任务";
|
||||||
});
|
});
|
||||||
@@ -550,15 +529,8 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
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) {
|
if (this.form.id != null) {
|
||||||
updateTask(this.form).then(response => {
|
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) {
|
handleDelete(row) {
|
||||||
const id = row.id;
|
const id = row.id;
|
||||||
@@ -643,7 +633,7 @@ export default {
|
|||||||
changeProject(row) {
|
changeProject(row) {
|
||||||
this.form.areas = null;
|
this.form.areas = null;
|
||||||
this.assemArea();
|
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 = [];
|
let filterArr = [];
|
||||||
this.assemAreaList.forEach(t => {
|
this.assemAreaList.forEach(t => {
|
||||||
projectArea.forEach(a => {
|
projectArea.forEach(a => {
|
||||||
|
|||||||
Reference in New Issue
Block a user