Browse Source

页面优化

master
zhanyunjiu 3 years ago
parent
commit
bf06a98345
  1. 80
      src/views/farm/discuss/index.vue
  2. 4
      src/views/farm/project/index.vue
  3. 7
      src/views/farm/resource/index.vue
  4. 22
      src/views/farm/task/index.vue

80
src/views/farm/discuss/index.vue

@ -46,11 +46,6 @@
</template>
</el-table-column>
<el-table-column label="讨论内容" align="center" prop="content" />
<!-- <el-table-column label="需要的资源" align="center" prop="resources" width="180">
<template slot-scope="scope">
<span>{{resouceConvert(scope.row.resources)}}</span>
</template>
</el-table-column> -->
<el-table-column label="事件图片" align="center" prop="images">
<template slot-scope="scope">
<el-image
@ -111,7 +106,6 @@
<el-form-item label="讨论图片">
<imageUpload v-model="form.images"/>
</el-form-item>
<el-form-item label="工时" prop="workingHours">
<el-input v-model="form.workingHours" placeholder="请输入工时" />
</el-form-item>
@ -129,15 +123,6 @@
<el-date-picker clearable v-model="form.executeTime" type="datetime" value-format="timestamp"
placeholder="选择" />
</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>
<el-input v-model="item.num"/>
<el-button @click="deleteResource(item)">删除</el-button>
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -154,8 +139,6 @@ import Editor from '@/components/Editor';
import { getProjectPage } from "@/api/farm/project";
import { getTaskPage } from "@/api/farm/task";
import { getTaskCatePage } from "@/api/farm/taskCate";
// import { getResourcePage } from "@/api/farm/resource";
// import { getResourceTypePage } from "@/api/farm/resourceType";
import { getCpUserPage } from "@/api/system/cpUser";
export default {
@ -204,11 +187,6 @@ export default {
taskList:[],
selectTaskList:[], //
taskCateList:[],
// resourceTypeList:[], //
// resourceList:[], //
// twoList:[],
cpUserList:[], //cpUser
selectCpUserList:[] //
};
@ -217,9 +195,6 @@ export default {
created() {
this.getProject();
this.getTaskCateList();
// this.getResourceTypeList();
// this.getResource();
// this.twoRescoure();
this.getCpUserList();
},
methods: {
@ -242,54 +217,6 @@ export default {
})
return executorPersonName;
},
// twoRescoure() {
// let firstList = [];
// this.resourceTypeList.forEach((type) => {
// let secondList = [];
// this.resourceList.forEach((res) => {
// if (res.resourceType == type.id) {
// secondList.push({ value: res.id, label: res.name });
// }
// })
// firstList.push({ value: type.id, label: type.name, children: secondList });
// })
// this.twoList = firstList;
// },
// ziyuanxuanze(item,index,obj){
// this.form.resource[index].reource = obj[1];
// },
// addResource(){
// let resourceTmp = {reource:0,num:1}
// this.form.resources = this.form.resources.concat(resourceTmp);
// },
// deleteResource(item){
// this.form.resources = this.form.resources.filter(res => res!=item)
// },
// resouceConvert(resources){
// let resouceMsg = "";
// resources.forEach(res =>{
// let typeName = this.resourceTypeList.filter(type => type.id == res.resourceId[0])[0].name;
// let name = this.resourceList.filter(name => name.id == res.resourceId[1])[0].name;
// resouceMsg += typeName +"/" + name +":" + res.num +"\n";
// })
// return resouceMsg;
// },
// getResourceTypeList() {
// getResourceTypePage({
// pageNo: 1,
// pageSize: 100
// }).then(res => {
// this.resourceTypeList = res.data.list;
// })
// },
// getResource() {
// getResourcePage({
// pageNo: 1,
// pageSize: 10,
// }).then(res => {
// this.resourceList = res.data.list;
// })
// },
getTaskCateList() {
getTaskCatePage({
pageNo: 1,
@ -303,7 +230,7 @@ export default {
getProjectPage({
pageNo: 1,
pageSize: 400,
name: null,
state: 'STARTING' //
}).then(res=>{
this.projectList = res.data.list;
this.getTask();
@ -314,8 +241,9 @@ export default {
getTaskPage({
pageNo: 1,
pageSize: 400,
name: null,
draft:false
draft:false,
status:'STARTED' //
}).then(res=>{
this.taskList = res.data.list;
this.getList();

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

@ -74,8 +74,8 @@
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="项目状态" align="center" prop="state" >
<template slot-scope="scope">
<el-button type="success" v-if="scope.row.state == 'PLAN'">计划中</el-button>
<el-button type="success" v-if="scope.row.state == 'STARTING'">进行中</el-button>
<el-button type="info" v-if="scope.row.state == 'PLAN'">计划中</el-button>
<el-button type="primary" v-if="scope.row.state == 'STARTING'">进行中</el-button>
<el-button type="success" v-if="scope.row.state == 'FINISH'">已完成</el-button>
</template>
</el-table-column>

7
src/views/farm/resource/index.vue

@ -64,7 +64,6 @@
</el-table-column>
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="数量" align="center" prop="number" />
<!-- <el-table-column label="征文" align="center" prop="content" /> -->
<el-table-column label="图片" align="center" prop="images" >
<template slot-scope="scope">
<el-image
@ -88,6 +87,12 @@
<el-button type="success" v-if="!scope.row.solo">任意</el-button>
</template>
</el-table-column>
<el-table-column label="是否被占用" align="center" prop="occupied" >
<template slot-scope="scope">
<el-button type="danger" v-if="scope.row.occupied">被占用</el-button>
<el-button type="success" v-if="!scope.row.occupied"></el-button>
</template>
</el-table-column>
<el-table-column label="" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>

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

@ -92,9 +92,9 @@
<el-table-column label="任务ID" fixed align="center" prop="id" />
<el-table-column label="任务状态" fixed align="center" prop="status" >
<template slot-scope="scope">
<el-button type="success" v-if="scope.row.status == 'PLAN'">计划中</el-button>
<el-button type="success" v-if="scope.row.status == 'READY'">准备中</el-button>
<el-button type="success" v-if="scope.row.status == 'STARTED'">已开始</el-button>
<el-button type="info" v-if="scope.row.status == 'PLAN'">计划中</el-button>
<el-button type="info" v-if="scope.row.status == 'READY'">准备中</el-button>
<el-button type="primary" v-if="scope.row.status == 'STARTED'">已开始</el-button>
<el-button type="danger" v-if="scope.row.status == 'EXCEPTION'">异常状态</el-button>
<el-button type="success" v-if="scope.row.status == 'COMPLETE'">任务完成</el-button>
<el-button type="danger" v-if="scope.row.status == 'RETRY'">返工</el-button>
@ -184,14 +184,14 @@
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="项目选择" prop="projectId">
<el-select v-model="form.projectId" placeholder="请选择" @change="changeProject">
<el-select v-model="form.projectId" placeholder="只能选择进行中的项目" @change="changeProject">
<el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="作物选择" prop="cropId">
<el-select v-model="form.cropId" placeholder="请选择">
<el-select v-model="form.cropId" placeholder="请选择项目">
<el-option v-for="item in selectCropList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
@ -213,7 +213,7 @@
</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">
<el-cascader :options="assemAreaList" :props="props" emitPath clearable ref="chooseA" v-model="form.areas" placeholder="请先选择项目">
</el-cascader>
</el-form-item>
@ -234,7 +234,7 @@
</el-option>
</el-select>
</el-form-item>
<el-button type="primary" @click="addResource">主要按钮</el-button>
<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>
@ -264,7 +264,7 @@
<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 :label="4">完成</el-radio> -->
</el-radio-group>
</el-form-item>
</el-form>
@ -288,8 +288,6 @@ import { getTaskCatePage } from "@/api/farm/taskCate";
import { getCpUserPage } from "@/api/system/cpUser";
import { getAreaPage } from "@/api/farm/area";
import { values } from 'min-dash';
import { ifStatement } from "@babel/types";
export default {
name: "Task",
@ -430,7 +428,6 @@ export default {
this.form.resources = this.form.resources.concat(resourceTmp)
},
deleteResource(item){
console.log(this.form.resources);
this.form.resources = this.form.resources.filter(res => res!=item)
},
getAreasList() {
@ -484,7 +481,8 @@ export default {
getProjectList() {
getProjectPage({
pageNo: 1,
pageSize: 100
pageSize: 100,
state: 'STARTING' //
}).then(res => {
this.projectList = res.data.list;
})

Loading…
Cancel
Save