Browse Source

ui优化

master
zhanyunjiu 3 years ago
parent
commit
9cc5cf3d81
  1. 21
      src/views/farm/crop/index.vue
  2. 23
      src/views/farm/project/index.vue
  3. 83
      src/views/farm/task/index.vue

21
src/views/farm/crop/index.vue

@ -31,9 +31,10 @@
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="物料id" align="center" prop="id" />
<el-table-column label="物料名" align="center" prop="name" />
<el-table-column label="物料图片" align="center" prop="images" >
<el-table-column label="作物id" align="center" prop="id" />
<el-table-column label="作物名" align="center" prop="name" />
<el-table-column label="作物品种" align="center" prop="variety"/>
<el-table-column label="作物图片" align="center" prop="images" >
<template slot-scope="scope">
<el-image
v-if="scope.row.images[0] != null"
@ -45,7 +46,7 @@
<el-table-column label="ERP物料id" align="center" prop="materialId" />
<el-table-column label="ERP物料名字" align="center">
<template slot-scope="scope">
<span v-if="scope.row.materialId"> {{materialList.find(t=>t.id == scope.row.materialId ).name}} </span>
<span v-if="scope.row.materialId"> {{erpNameConvert(scope.row.materialId)}} </span>
</template>
</el-table-column>
@ -70,8 +71,11 @@
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="物料名" prop="name">
<el-input v-model="form.name" placeholder="请输入物料名" />
<el-form-item label="作物名" prop="name">
<el-input v-model="form.name" placeholder="请输入作物名" />
</el-form-item>
<el-form-item label="作物品种名" prop="variety">
<el-input v-model="form.variety" placeholder="请输入作物品种" />
</el-form-item>
<el-form-item label="图片:">
<imageUpload v-model="form.images"/>
@ -164,6 +168,7 @@ export default {
},
getErpMaterial(){
getMaterialList().then(res =>{
console.log("55555555");
this.materialList = res;
})
},
@ -277,7 +282,11 @@ export default {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
},
erpNameConvert(materialId){
return this.materialList.length == 0 ? "" : this.materialList.find(m => m.id == materialId).name;
}
}
};
</script>

23
src/views/farm/project/index.vue

@ -91,11 +91,24 @@
<span> {{cropList.find(t=>t.id == scope.row.cropId ).name}} </span>
</template>
</el-table-column>
<el-table-column label="负责人" align="center" prop="mainPerson">
<template slot-scope="scope">
<span>{{mainPersonConvert(scope.row.mainPerson)}}</span>
</template>
</el-table-column>
<el-table-column label="项目成员" align="center" prop="members">
<template slot-scope="scope">
<span>{{membersConvert(scope.row.members)}}</span>
</template>
</el-table-column>
<el-table-column label="项目图片" align="center" prop="images">
<template slot-scope="scope">
<el-image
v-if="scope.row.images != null && scope.row.images[0] != null"
:src="scope.row.images[0]" :preview-src-list="scope.row.images">
</el-image>
</template>
</el-table-column>
<el-table-column label="育苗日期" align="center" prop="growSeedTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.growSeedTime) }}</span>
@ -154,6 +167,12 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="负责人" prop="mainPerson">
<el-select v-model="form.mainPerson" filterable placeholder="请选择">
<el-option v-for="item in membersList" :key="item.id" :label="item.name" :value="item.id"> {{item.name}}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="成员选择" prop="members">
<el-select v-model="form.members" filterable multiple placeholder="请选择">
<el-option v-for="item in membersList" :key="item.id" :label="item.name" :value="item.id"> {{item.name}}
@ -270,6 +289,10 @@ export default {
this.getList();
},
methods: {
mainPersonConvert(mainPersonId){
let mainPerson = this.membersList.filter(item => item.id == mainPersonId)[0];
return mainPerson.name;
},
membersConvert(members){
let membersName = "";
this.membersList.forEach(item =>{

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

@ -105,18 +105,12 @@
<template slot-scope="scope">
<span>{{scope.row.projectName}}</span>
</template>
</el-table-column>
<el-table-column label="负责人" align="center" prop="mainPerson">
<template slot-scope="scope">
<span>{{scope.row.mainPersonName}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="执行人" align="center" prop="executorPerson" width="80" >
<template slot-scope="scope">
<span>{{executorPersonConvert(scope.row.executorNameList)}}</span>
</template>
</el-table-column> -->
<el-table-column label="区域" align="center" prop="areas" width="180" >
<template slot-scope="scope">
<span>{{areaConvert(scope.row.areaNameList)}}</span>
@ -127,7 +121,6 @@
<span> {{scope.row.cropName}} </span>
</template>
</el-table-column>
<!-- <el-table-column label="作物数量" align="center" prop="cropNum" /> -->
<el-table-column label="任务名" align="center" prop="taskCateId">
<template slot-scope="scope">
<span> {{scope.row.taskName}} </span>
@ -143,24 +136,6 @@
<span>{{resouceConvert(scope.row.taskResourceList)}}</span>
</template>
</el-table-column> -->
<!-- <el-table-column label="工时" align="center" prop="workingHours" />
<el-table-column label="图片" align="center" prop="images">
<template slot-scope="scope">
<el-image v-if="scope.row.images != null && scope.row.images[0] != null" style="" :src="scope.row.images[0]"
:preview-src-list="scope.row.images">
</el-image>
</template>
</el-table-column>
<el-table-column label="预计执行时间" align="center" prop="planStartTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planStartTime) }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="截止时间" align="center" prop="planEndTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planEndTime) }}</span>
</template>
</el-table-column> -->
<el-table-column label="优先级" align="center" prop="weight" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
@ -197,7 +172,6 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="负责人" prop="mainPerson">
<el-select v-model="form.mainPerson" filterable placeholder="请先选择项目">
<el-option v-for="item in selectCpUserList" :key="item.id" :label="item.name" :value="item.id">
@ -205,21 +179,10 @@
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="执行人" prop="executorPerson">
<el-select v-model="form.executorPerson" filterable multiple placeholder="请先选择项目">
<el-option v-for="item in selectCpUserList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="区域选择" prop="assemAreaList">
<el-cascader :options="assemAreaList" :props="props" emitPath clearable ref="chooseA" v-model="form.areas" placeholder="请先选择项目">
</el-cascader>
</el-form-item>
<!-- <el-form-item label="作物数量" prop="cropNum">
<el-input v-model="form.cropNum" placeholder="请输入" />
</el-form-item> -->
<el-form-item label="任务类型" prop="taskCateId">
<el-select v-model="form.taskCateId" placeholder="请选择" @change="changeCateOne">
<el-option v-for="item in cateOneList" :key="item.id" :label="item.name" :value="item.id">
@ -236,15 +199,11 @@
</el-form-item>
<el-button type="primary" @click="addResource">添加资源</el-button>
<el-form-item label="资源选择" v-for="(item,index) in form.resources" :key="index">
<el-cascader :options="twoList" clearable v-model="item.resourceId" @change="(obj)=>ziyuanxuanze(item,index,obj)">
<el-cascader :options="twoList" clearable v-model="item.resourceId">
</el-cascader>
<el-input v-model="item.num"/>
<el-button @click="deleteResource(item)">删除</el-button>
</el-form-item>
<!-- <el-form-item label="工时" prop="workingHours">
<el-input v-model="form.workingHours" placeholder="请输入工时" />
</el-form-item> -->
<el-form-item label="任务图片">
<imageUpload v-model="form.images" />
</el-form-item>
@ -252,10 +211,6 @@
<el-date-picker clearable v-model="form.planStartTime" type="datetime" value-format="timestamp"
placeholder="选择" />
</el-form-item>
<!-- <el-form-item label="任务结束时间" prop="planEndTime">
<el-date-picker clearable v-model="form.planEndTime" type="datetime" value-format="timestamp"
placeholder="选择" />
</el-form-item> -->
<el-form-item label="优先级" prop="weight">
<el-input v-model="form.weight" placeholder="请输入优先级" />
</el-form-item>
@ -264,7 +219,6 @@
<el-radio :label="0">计划中</el-radio>
<el-radio :label="1">准备中 </el-radio>
<el-radio :label="2">已开始</el-radio>
<!-- <el-radio :label="4">完成</el-radio> -->
</el-radio-group>
</el-form-item>
</el-form>
@ -378,13 +332,11 @@ export default {
};
},
created() {
// this.getList(),
this.getTaskCateList();
this.getAreasList();
this.getProjectList();
this.getResource();
this.getCpUserList();
// this.twoRescoure();
},
methods: {
startMethod(){
@ -395,7 +347,6 @@ export default {
this.getCropList();
this.getTaskCateList();
this.getAreasList();
// this.twoRescoure();
},
executorPersonConvert(executorPerson){
let executorPersonName = "";
@ -420,11 +371,8 @@ export default {
}
return resouceMsg;
},
ziyuanxuanze(item,index,obj){
this.form.resource[index].reource = obj[1];
},
addResource(){
let resourceTmp = {reource:0,num:1}
let resourceTmp = {num:1}
this.form.resources = this.form.resources.concat(resourceTmp)
},
deleteResource(item){
@ -694,33 +642,6 @@ export default {
changeCateOne(row) {
this.cateTwoList = this.taskCateAllList.filter(t => t.parentId == row);
},
// assemArea() {
// let parentLsit = this.areasList.filter(t => t.parentId == 0);
// let sonList = this.areasList.filter(s => s.parentId != 0);
// let firstList = [];
// parentLsit.forEach(p => {
// this.areasParentList.push(p);
// let secondList = [];
// sonList.forEach(s => {
// if (p.id == s.parentId) {
// let three = this.areasList.filter(t => t.parentId == s.id);
// if(three.length == 0){
// secondList.push({ value: s.id, label: s.name });
// }else{
// let threeList = [];
// three.forEach(three =>{
// threeList.push({value:three.id, label:three.name});
// })
// secondList.push({value:s.id, label:s.name, children:threeList});
// }
// }
// })
// firstList.push({ value: p.id, label: p.name, children: secondList })
// })
// this.assemAreaList = firstList;
// },
changeProject(row) {
let project = this.projectList.filter(project => project.id == row)[0];
//

Loading…
Cancel
Save