Browse Source

页面优化

master
小久哥 3 years ago
parent
commit
c52075e3b9
  1. 13
      src/views/farm/task/index.vue
  2. 10
      src/views/farm/taskCate/index.vue

13
src/views/farm/task/index.vue

@ -108,7 +108,7 @@
</template>
</el-table-column>
<el-table-column label="优先级" align="center" prop="weight" />
<el-table-column label="" align="center" prop="createTime" width="180">
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
@ -156,7 +156,7 @@
</el-form-item>
<el-form-item label="作物选择" prop="cropId">
<el-select v-model="form.cropId" placeholder="请选择">
<el-option v-for="item in cropList" :key="item.id" :label="item.name" :value="item.id">
<el-option v-for="item in selectCropList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
@ -284,6 +284,7 @@ export default {
selectResourceList: [],
projectList: [],
cropList: [],
selectCropList:[], //
resourceTypeList: [],
resourceNumberList: [],
@ -628,7 +629,8 @@ export default {
changeProject(row) {
this.form.areas = null;
this.assemArea();
let projectArea = this.projectList.filter(project => project.id == row)[0].areas;
let project = this.projectList.filter(project => project.id == row)[0];
let projectArea = project.areas;
let filterArr = [];
this.assemAreaList.forEach(t => {
projectArea.forEach(a => {
@ -638,6 +640,11 @@ export default {
})
})
this.assemAreaList = filterArr;
//
this.form.cropId = null;
this.selectCropList = this.cropList.filter(crop => crop.id == project.cropId);
}
}
};

10
src/views/farm/taskCate/index.vue

@ -35,6 +35,7 @@
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column prop="id" label="id" sortable width="180"></el-table-column>
<el-table-column prop="name" label="名" sortable width="180"></el-table-column>
<el-table-column prop="unit" label="单位" sortable width="180"></el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@ -71,6 +72,9 @@
<el-form-item label="分类名称" prop="name">
<el-input v-model="form.name" placeholder="请输入" />
</el-form-item>
<el-form-item label="任务单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -144,17 +148,17 @@ export default {
if(filterList.length == 0){
//
this.list.forEach(t => {
oneList.push({id:one.id, name:one.name, createTime:one.createTime, children:twoList});
oneList.push({id:one.id, name:one.name, unit:one.unit, createTime:one.createTime, children:twoList});
})
}else{
filterList.forEach((one) => {
let twoList = [];
this.list.forEach((two) => {
if(one.id == two.parentId){
twoList.push({id:two.id, name:two.name, createTime:two.createTime})
twoList.push({id:two.id, name:two.name, unit:two.unit, createTime:two.createTime})
}
})
oneList.push({id:one.id, name:one.name, createTime:one.createTime, children:twoList});
oneList.push({id:one.id, name:one.name, unit:one.unit, createTime:one.createTime, children:twoList});
})
}

Loading…
Cancel
Save