This commit is contained in:
parent
fa6f4625f2
commit
5e79f05265
42
src/common/apis/tables/drainageWorkshop/pumpOperationLog.ts
Normal file
42
src/common/apis/tables/drainageWorkshop/pumpOperationLog.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import { request } from "@/http/axios";
|
||||||
|
|
||||||
|
/**修改水泵运行日志 */
|
||||||
|
export function updateFangpaishuiPumpoperationrecordApi(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/FangpaishuiPumpoperationrecordController/updateFangpaishuiPumpoperationrecord",
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 删除水泵运行日志 */
|
||||||
|
export function deleteFangpaishuiPumpoperationrecordApi(id: any) {
|
||||||
|
return request({
|
||||||
|
url: `/FangpaishuiPumpoperationrecordController/deleteFangpaishuiPumpoperationrecord/${id}`,
|
||||||
|
method: "delete",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 根据条件查水泵运行日志 */
|
||||||
|
export function findPumpoperationrecordByDetailApi(data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/FangpaishuiPumpoperationrecordController/findPumpoperationrecordByDetail`,
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增水泵运行日志
|
||||||
|
export function addFangpaishuiPumpoperationrecordApi(data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/FangpaishuiPumpoperationrecordController/addFangpaishuiPumpoperationrecord`,
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据月查询排/倒水月报表
|
||||||
|
export function findFangpaishuiPumpoperationrecordByMonthApi(data: any) {
|
||||||
|
return request({
|
||||||
|
url: `/FangpaishuiPumpoperationrecordController/findFangpaishuiPumpoperationrecordByMonth/${data}`,
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
}
|
193
src/pages/demo/drainageWorkshop/pumpOperationLog.vue
Normal file
193
src/pages/demo/drainageWorkshop/pumpOperationLog.vue
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
<script>
|
||||||
|
import {
|
||||||
|
updateFangpaishuiPumpoperationrecordApi,
|
||||||
|
deleteFangpaishuiPumpoperationrecordApi,
|
||||||
|
findPumpoperationrecordByDetailApi,
|
||||||
|
addFangpaishuiPumpoperationrecordApi,
|
||||||
|
findFangpaishuiPumpoperationrecordByMonthApi,
|
||||||
|
} from "@@/apis/tables/drainageWorkshop/pumpOperationLog.ts";
|
||||||
|
import { getSpecificDate } from "@@/utils/datetime";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
date: "",
|
||||||
|
tableList: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
// 页面渲染之前执行,一般调用methods定义的方法
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//获取列表
|
||||||
|
async getList() {
|
||||||
|
const res = await findAllMiningglossApi();
|
||||||
|
console.log(res);
|
||||||
|
},
|
||||||
|
//按月查询
|
||||||
|
async getMouthLoss() {
|
||||||
|
let data = getSpecificDate(this.date);
|
||||||
|
const res = await findTotalMiningByMonthApi(data);
|
||||||
|
console.log(res);
|
||||||
|
},
|
||||||
|
removeDataById(id) {
|
||||||
|
ElMessageBox.confirm("此操作将永久删除降水量记录,是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
deletePrecipitation(id).then(() => {
|
||||||
|
// 删除成功
|
||||||
|
ElMessage({
|
||||||
|
type: "success",
|
||||||
|
message: "删除成功!",
|
||||||
|
});
|
||||||
|
// 重新加载列表
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: "info",
|
||||||
|
message: "已取消删除",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleAdd() {
|
||||||
|
this.isEdit = false; // 设置为新增操作
|
||||||
|
this.precipitationform = { plateRange: "" }; // 初始化为空数据
|
||||||
|
this.updateprecipitationform = true; // 显示弹窗
|
||||||
|
},
|
||||||
|
handleEdit(id) {
|
||||||
|
this.isEdit = true;
|
||||||
|
findPrecipitationById(id)
|
||||||
|
.then((Response) => {
|
||||||
|
this.precipitationform = Response.data.precipitationById;
|
||||||
|
console.log(this.precipitationform);
|
||||||
|
this.updateprecipitationform = true;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
ElMessage.error("查询失败,请稍后重试");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
formatMonth(dateTime) {
|
||||||
|
if (!dateTime) return "-";
|
||||||
|
return dateTime.slice(0, 7); // 直接截取 "yyyy-MM"
|
||||||
|
// 或用 dayjs(需安装):
|
||||||
|
// return dayjs(dateTime).format('YYYY-MM');
|
||||||
|
},
|
||||||
|
updatePrecipitation() {
|
||||||
|
if (this.isEdit) {
|
||||||
|
updatePrecipitationApi(this.precipitationform)
|
||||||
|
.then(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: "success",
|
||||||
|
message: "修改成功!",
|
||||||
|
});
|
||||||
|
this.updateprecipitationform = false;
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
ElMessage.error("修改失败,请稍后重试");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addPrecipitationApi(this.precipitationform)
|
||||||
|
.then(() => {
|
||||||
|
ElMessage({
|
||||||
|
type: "success",
|
||||||
|
message: "新增成功!",
|
||||||
|
});
|
||||||
|
this.updateprecipitationform = false;
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
ElMessage.error("新增失败,请稍后重试");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div style="margin-bottom: 20px">
|
||||||
|
<el-date-picker v-model="date" type="month" placeholder="选择年月">
|
||||||
|
</el-date-picker>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
style="margin-left: 20px"
|
||||||
|
@click="getMouthLoss"
|
||||||
|
>查询</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:data="tableList"
|
||||||
|
border
|
||||||
|
style="width: 100%"
|
||||||
|
:span-method="spanMethod"
|
||||||
|
:header-align="center"
|
||||||
|
:cell-style="rowStyle"
|
||||||
|
>
|
||||||
|
<!-- 表格列定义 -->
|
||||||
|
<el-table-column align="center" prop="amount" label="平盘(m)" />
|
||||||
|
<el-table-column align="center" prop="amount" label="铲号(#)" />
|
||||||
|
<el-table-column align="center" prop="amount" label="出矿量(t)" />
|
||||||
|
<el-table-column align="center" prop="amount" label="剥离量(t)" />
|
||||||
|
<el-table-column align="center" prop="amount" label="采剥总量(t)" />
|
||||||
|
<el-table-column align="center" prop="amount" label="计量单位" />
|
||||||
|
<el-table-column align="center" prop="amount" label="月份" />
|
||||||
|
<el-table-column align="center" fixed="right" label="操作" width="300">
|
||||||
|
<template #default="scope">
|
||||||
|
<div style="display: flex; justify-content: center; gap: 8px">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="handleEdit(scope.row.precipID)"
|
||||||
|
>
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
@click="removeDataById(scope.row.precipID)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-dialog
|
||||||
|
v-model="updateprecipitationform"
|
||||||
|
title="修改降水量信息"
|
||||||
|
width="500"
|
||||||
|
>
|
||||||
|
<el-form :model="precipitationform">
|
||||||
|
<el-form-item label="降水量" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="precipitationform.amount" autocomplete="off" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计量单位" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="precipitationform.unit" autocomplete="off" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="月份" :label-width="formLabelWidth">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="precipitationform.monthDate"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择月份"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="updateprecipitationform = false"> 取消 </el-button>
|
||||||
|
<el-button type="primary" @click="updatePrecipitation">
|
||||||
|
提交
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
@ -207,7 +207,8 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "excavationQuantityReport",
|
path: "excavationQuantityReport",
|
||||||
component: () => import("@/pages/demo/diceke/ExcavationQuantityReport.vue"),
|
component: () =>
|
||||||
|
import("@/pages/demo/diceke/ExcavationQuantityReport.vue"),
|
||||||
name: "",
|
name: "",
|
||||||
meta: {
|
meta: {
|
||||||
title: "采剥量报表",
|
title: "采剥量报表",
|
||||||
@ -215,6 +216,26 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/drainageWorkshop",
|
||||||
|
component: Layouts,
|
||||||
|
redirect: "/drainageWorkshop",
|
||||||
|
meta: {
|
||||||
|
title: "防排水车间",
|
||||||
|
elIcon: "Link",
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "pumpOperationLog",
|
||||||
|
component: () =>
|
||||||
|
import("@/pages/demo/drainageWorkshop/pumpOperationLog.vue"),
|
||||||
|
name: "pumpOperationLog",
|
||||||
|
meta: {
|
||||||
|
title: "水泵运行日志",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// path: "/caiqu",
|
// path: "/caiqu",
|
||||||
// component: Layouts,
|
// component: Layouts,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user