农机作业时间,农机作业面积

This commit is contained in:
wangyan21 2023-11-16 14:23:48 +08:00
parent cb47078c79
commit cc941dc2d4
2 changed files with 764 additions and 0 deletions

View File

@ -0,0 +1,396 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="农机名称" prop="machineName">
<el-input
v-model="queryParams.machineName"
placeholder="请输入农机名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="任务单号" prop="taskNumber">
<el-input
v-model="queryParams.taskNumber"
placeholder="请输入任务单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="地块" prop="farmland">
<el-input
v-model="queryParams.farmland"
placeholder="请输入地块"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="农机状态" prop="machineStatus">
<el-select v-model="queryParams.machineStatus" placeholder="请选择农机状态" clearable>
<el-option
v-for="dict in dict.type.zhcj_equip_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="长度" prop="speed">
<el-input
v-model="queryParams.speed"
placeholder="请输入长度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="宽度" prop="power">
<el-input
v-model="queryParams.power"
placeholder="请输入宽度"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="作业亩数" prop="runValue">
<el-input
v-model="queryParams.runValue"
placeholder="请输入作业亩数"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="作业时间" prop="returnTime">
<el-date-picker clearable
v-model="queryParams.returnTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择作业时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['machinery:status:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['machinery:status:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['machinery:status:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="statusList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="农机编码" align="center" prop="machineCode" />
<el-table-column label="农机名称" align="center" prop="machineName" />
<el-table-column label="任务单号" align="center" prop="taskNumber" />
<el-table-column label="地块" align="center" prop="farmland" />
<el-table-column label="农机状态" align="center" prop="machineStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.zhcj_equip_status" :value="scope.row.machineStatus"/>
</template>
</el-table-column>
<!-- <el-table-column label="油耗" align="center" prop="consumeOil" />-->
<!-- <el-table-column label="作业深度" align="center" prop="depth" />-->
<el-table-column label="长度" align="center" prop="speed" />
<el-table-column label="宽度" align="center" prop="power" />
<el-table-column label="作业亩数" align="center" prop="runValue" />
<!-- <el-table-column label="计量单位" align="center" prop="runUnit" />-->
<el-table-column label="作业日期" align="center" prop="returnTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.returnTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="数据类型" align="center" prop="dataType" />-->
<!-- <el-table-column label="备注" align="center" prop="remark" />-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['machinery:status:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['machinery:status:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改农机运行状态对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="农机编码" prop="machineCode">
<el-input v-model="form.machineCode" placeholder="请输入农机编码" />
</el-form-item>
<el-form-item label="农机名称" prop="machineName">
<el-input v-model="form.machineName" placeholder="请输入农机名称" />
</el-form-item>
<el-form-item label="任务单号" prop="taskNumber">
<el-input v-model="form.taskNumber" placeholder="请输入任务单号" />
</el-form-item>
<el-form-item label="地块" prop="farmland">
<el-input v-model="form.farmland" placeholder="请输入地块" />
</el-form-item>
<el-form-item label="农机状态" prop="machineStatus">
<el-select v-model="form.machineStatus" placeholder="请选择农机状态">
<el-option
v-for="dict in dict.type.zhcj_equip_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="油耗" prop="consumeOil">-->
<!-- <el-input v-model="form.consumeOil" placeholder="请输入油耗" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="作业深度" prop="depth">-->
<!-- <el-input v-model="form.depth" placeholder="请输入作业深度" />-->
<!-- </el-form-item>-->
<el-form-item label="长度" prop="speed">
<el-input v-model="form.speed" placeholder="请输入长度" />
</el-form-item>
<el-form-item label="宽度" prop="power">
<el-input v-model="form.power" placeholder="请输入宽度" />
</el-form-item>
<el-form-item label="作业亩数" prop="runValue">
<el-input v-model="form.runValue" placeholder="请输入作业亩数" />
</el-form-item>
<!-- <el-form-item label="计量单位" prop="runUnit">-->
<!-- <el-input v-model="form.runUnit" placeholder="请输入计量单位" />-->
<!-- </el-form-item>-->
<el-form-item label="作业日期" prop="returnTime">
<el-date-picker clearable
v-model="form.returnTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择作业日期">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="数据类型" prop="dataType">-->
<!-- <el-input v-model="form.dataType" placeholder="请输入数据类型" />-->
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listStatus, getStatus, delStatus, addStatus, updateStatus } from "@/api/machinery/status";
export default {
//
name: "Area",
dicts: ['zhcj_equip_status'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
statusList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
machineCode: null,
machineName: null,
taskNumber: null,
farmland: null,
machineStatus: null,
consumeOil: null,
depth: null,
speed: null,
power: null,
runValue: null,
runUnit: null,
returnTime: null,
dataType: "作业面积",
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询农机运行状态列表 */
getList() {
this.loading = true;
listStatus(this.queryParams).then(response => {
this.statusList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
machineCode: null,
machineName: null,
taskNumber: null,
farmland: null,
machineStatus: null,
consumeOil: null,
depth: null,
speed: null,
power: null,
runValue: null,
runUnit: null,
returnTime: null,
dataType: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加农机作业面积";
this.form.dataType = "作业面积";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getStatus(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改农机作业面积";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateStatus(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addStatus(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除农机作业面积编号为"' + ids + '"的数据项?').then(function() {
return delStatus(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('machinery/status/export', {
...this.queryParams
}, `status_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,368 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="农机编码" prop="machineCode">
<el-input
v-model="queryParams.machineCode"
placeholder="请输入农机编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="农机名称" prop="machineName">
<el-input
v-model="queryParams.machineName"
placeholder="请输入农机名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="任务单号" prop="taskNumber">
<el-input
v-model="queryParams.taskNumber"
placeholder="请输入任务单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="地块" prop="farmland">
<el-input
v-model="queryParams.farmland"
placeholder="请输入地块"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker clearable
v-model="queryParams.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="作业类型" prop="jobType">
<el-select v-model="queryParams.jobType" placeholder="请选择作业类型" clearable>
<el-option
v-for="dict in dict.type.cqyg_machine_job_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="作业时长" prop="chargePerson">
<el-input
v-model="queryParams.chargePerson"
placeholder="请输入作业时长"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['machinery:time:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['machinery:time:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['machinery:time:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="timeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="农机编码" align="center" prop="machineCode" />
<el-table-column label="农机名称" align="center" prop="machineName" />
<el-table-column label="任务单号" align="center" prop="taskNumber" />
<el-table-column label="地块" align="center" prop="farmland" />
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="作业类型" align="center" prop="jobType">
<template slot-scope="scope">
<dict-tag :options="dict.type.cqyg_machine_job_type" :value="scope.row.jobType"/>
</template>
</el-table-column>
<el-table-column label="作业时长" align="center" prop="chargePerson" />
<el-table-column label="添加人" align="center" prop="addPerson" />
<!-- <el-table-column label="数据类型" align="center" prop="dataType" />-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['machinery:time:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['machinery:time:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改农机运行时间对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="农机编码" prop="machineCode">
<el-input v-model="form.machineCode" placeholder="请输入农机编码" />
</el-form-item>
<el-form-item label="农机名称" prop="machineName">
<el-input v-model="form.machineName" placeholder="请输入农机名称" />
</el-form-item>
<el-form-item label="任务单号" prop="taskNumber">
<el-input v-model="form.taskNumber" placeholder="请输入任务单号" />
</el-form-item>
<el-form-item label="地块" prop="farmland">
<el-input v-model="form.farmland" placeholder="请输入地块" />
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker clearable
v-model="form.startTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker clearable
v-model="form.endTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="作业类型" prop="jobType">
<el-select v-model="form.jobType" placeholder="请选择作业类型">
<el-option
v-for="dict in dict.type.cqyg_machine_job_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="作业时长" prop="chargePerson">
<el-input v-model="form.chargePerson" placeholder="请输入作业时长" />
</el-form-item>
<el-form-item label="添加人" prop="addPerson">
<el-input v-model="form.addPerson" placeholder="请输入添加人" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listTime, getTime, delTime, addTime, updateTime } from "@/api/machinery/time";
export default {
//
name: "Duration",
dicts: ['cqyg_machine_job_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
timeList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
machineCode: null,
machineName: null,
taskNumber: null,
farmland: null,
startTime: null,
endTime: null,
jobType: null,
chargePerson: null,
addPerson: null,
dataType: "作业时间"
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询农机运行时间列表 */
getList() {
this.loading = true;
listTime(this.queryParams).then(response => {
this.timeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
machineCode: null,
machineName: null,
taskNumber: null,
farmland: null,
startTime: null,
endTime: null,
jobType: null,
chargePerson: null,
addPerson: null,
dataType: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加农机作业时间";
this.form.dataType = "作业时间";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getTime(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改农机作业时间";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateTime(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addTime(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除农机作业时间编号为"' + ids + '"的数据项?').then(function() {
return delTime(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('machinery/time/export', {
...this.queryParams
}, `time_${new Date().getTime()}.xlsx`)
}
}
};
</script>