采剥量,损失和贫化
Some checks failed
Build And Deploy v3-admin-vite / build-and-deploy (push) Has been cancelled

This commit is contained in:
吕杰刚 2025-05-08 21:39:47 +08:00
parent 7c202e3981
commit 40b97f8a0f
14 changed files with 1053 additions and 363 deletions

View File

@ -1,17 +1,17 @@
<script lang="ts" setup>
import { useGreyAndColorWeakness } from "@@/composables/useGreyAndColorWeakness"
import { usePany } from "@@/composables/usePany"
import { useTheme } from "@@/composables/useTheme"
import zhCn from "element-plus/es/locale/lang/zh-cn" // Element Plus
import { useGreyAndColorWeakness } from "@@/composables/useGreyAndColorWeakness";
import { usePany } from "@@/composables/usePany";
import { useTheme } from "@@/composables/useTheme";
import zhCn from "element-plus/es/locale/lang/zh-cn"; // Element Plus
const { initTheme } = useTheme()
const { initGreyAndColorWeakness } = useGreyAndColorWeakness()
const { initStarNotification, initStoreNotification } = usePany()
const { initTheme } = useTheme();
const { initGreyAndColorWeakness } = useGreyAndColorWeakness();
const { initStarNotification, initStoreNotification } = usePany();
//
initTheme()
initTheme();
//
initGreyAndColorWeakness()
initGreyAndColorWeakness();
//
// initStarNotification()
// initStoreNotification()

View File

@ -0,0 +1,51 @@
import { request } from "@/http/axios";
// /** 查 */
// export function findAllMiningglossApi() {
// return request({
// url: "/dicekeMiningloss/findAllMininggloss",
// method: "get",
// });
// }
// /** 删 */
// export function deletedicekeMininglossApi(lossID: any) {
// return request({
// url: `/dicekeMiningloss/deletedicekeMiningloss/${lossID}`,
// method: "delete",
// });
// }
// /** 根据id查损失和贫化信息 */
// export function finddicekeMiningrecordById(lossID: any) {
// return request({
// url: `/dicekeMiningloss/finddicekeMininglossById/${lossID}`,
// method: "get",
// });
// }
/** 根据年月查采剥量 */
export function findTotalMiningByMonthApi(data: any) {
return request({
url: "/dicekeTotalMining/findTotalMiningByMonth",
method: "get",
data: data,
});
}
// /** 修改采剥量 */
export function updateTotalMiningApi(data: any) {
return request({
url: "/dicekeTotalMining/updateTotalMining",
method: "post",
data: data,
});
}
// /** 新增损失和贫化信息 */
// export function savedicekeMininglossApi(data: any) {
// return request({
// url: "/dicekeMiningloss/savedicekeMiningloss",
// method: "post",
// data: data,
// });
// }

View File

@ -0,0 +1,52 @@
import { request } from "@/http/axios";
/** 查 */
export function findAllMiningglossApi() {
return request({
url: "/dicekeMiningloss/findAllMininggloss",
method: "get",
});
}
/** 删 */
export function deletedicekeMininglossApi(lossID: any) {
return request({
url: `/dicekeMiningloss/deletedicekeMiningloss/${lossID}`,
method: "delete",
});
}
/** 根据id查损失和贫化信息 */
export function finddicekeMiningrecordById(lossID: any) {
return request({
url: `/dicekeMiningloss/finddicekeMininglossById/${lossID}`,
method: "get",
});
}
/** 根据年月查损失和贫化信息 */
export function findLossByMonthApi(data: any) {
return request({
url: "/dicekeMiningloss/findLossByMonth",
method: "get",
data: data,
});
}
/** 修改损失和贫化信息 */
export function updatedicekeMininglossApi(data: any) {
return request({
url: "/dicekeMiningloss/updatedicekeMiningloss",
method: "post",
data: data,
});
}
/** 新增损失和贫化信息 */
export function savedicekeMininglossApi(data: any) {
return request({
url: "/dicekeMiningloss/savedicekeMiningloss",
method: "post",
data: data,
});
}

View File

@ -39,8 +39,8 @@ body {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-family:
Inter, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial,
sans-serif;
Inter, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
"Microsoft YaHei", "微软雅黑", Arial, sans-serif;
@extend %scrollbar;
}

View File

@ -1,9 +1,25 @@
import dayjs from "dayjs"
import dayjs from "dayjs";
const INVALID_DATE = "N/A"
const INVALID_DATE = "N/A";
/** 格式化日期时间 */
export function formatDateTime(datetime: string | number | Date = "", template: string = "YYYY-MM-DD HH:mm:ss") {
const day = dayjs(datetime)
return day.isValid() ? day.format(template) : INVALID_DATE
export function formatDateTime(
datetime: string | number | Date = "",
template: string = "YYYY-MM-DD HH:mm:ss",
) {
const day = dayjs(datetime);
return day.isValid() ? day.format(template) : INVALID_DATE;
}
export function getDate(val: Date) {
let endY = val.getFullYear();
let endM = val.getMonth() + 1;
let endD = val.getDate();
let enddate =
endY +
"-" +
(endM < 10 ? "0" + endM : endM) +
"-" +
(endD < 10 ? "0" + endD : endD);
return enddate;
}

View File

@ -53,12 +53,12 @@ function logout() {
</div>
<template #dropdown>
<el-dropdown-menu>
<a target="_blank" href="https://github.com/un-pany/v3-admin-vite">
<!-- <a target="_blank" href="https://github.com/un-pany/v3-admin-vite">
<el-dropdown-item>GitHub</el-dropdown-item>
</a>
<a target="_blank" href="https://gitee.com/un-pany/v3-admin-vite">
<el-dropdown-item>Gitee</el-dropdown-item>
</a>
</a> -->
<el-dropdown-item divided @click="logout">
退出登录
</el-dropdown-item>

View File

@ -1,28 +1,28 @@
/* eslint-disable perfectionist/sort-imports */
// core
import { pinia } from "@/pinia"
import { router } from "@/router"
import { installPlugins } from "@/plugins"
import App from "@/App.vue"
import { pinia } from "@/pinia";
import { router } from "@/router";
import { installPlugins } from "@/plugins";
import App from "@/App.vue";
// css
import "normalize.css"
import "nprogress/nprogress.css"
import "element-plus/theme-chalk/dark/css-vars.css"
import "vxe-table/lib/style.css"
import "@@/assets/styles/index.scss"
import "virtual:uno.css"
import "normalize.css";
import "nprogress/nprogress.css";
import "element-plus/theme-chalk/dark/css-vars.css";
import "vxe-table/lib/style.css";
import "@@/assets/styles/index.scss";
import "virtual:uno.css";
// 创建应用实例
const app = createApp(App)
const app = createApp(App);
// 安装插件(全局组件、自定义指令等)
installPlugins(app)
installPlugins(app);
// 安装 pinia 和 router
app.use(pinia).use(router)
app.use(pinia).use(router);
// router 准备就绪后挂载应用
router.isReady().then(() => {
app.mount("#app")
})
app.mount("#app");
});

View File

@ -3,10 +3,11 @@ import {
adddicekeMiningrecord,
deletedicekeMiningrecord,
findAllMiningrecord,
finddicekeMiningrecordById, updatedicekeMiningrecord
} from "@@/apis/tables/diceke/DicekeMiningrecord.js"
import {findAllPlateArea} from "@@/apis/tables/diceke/plateArea.js";
import {findAllshovel} from "@@/apis/tables/diceke/shovel.js";
finddicekeMiningrecordById,
updatedicekeMiningrecord,
} from "@@/apis/tables/diceke/DicekeMiningrecord.js";
import { findAllPlateArea } from "@@/apis/tables/diceke/plateArea.js";
import { findAllshovel } from "@@/apis/tables/diceke/shovel.js";
export default {
data() {
@ -15,70 +16,66 @@ export default {
updatedicekeMiningrecordform: false,
dicekeMiningrecordform: null,
plateAreaQuerry: null,
shovelQuerry: null
}
shovelQuerry: null,
};
},
created() {
// methods
this.getList()
this.getList();
},
methods: {
getList() {
findAllMiningrecord().then((Response) => {
console.log(Response)
this.dicekeMiningrecordQuery = Response.data.dicekeMiningrecordVoList
console.log(this.dicekeMiningrecordQuery)
})
console.log(Response);
this.dicekeMiningrecordQuery = Response.data.dicekeMiningrecordVoList;
console.log(this.dicekeMiningrecordQuery);
});
},
//
removeDataById(id) {
ElMessageBox.confirm(
"此操作将永久删除平盘记录,是否继续?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
)
ElMessageBox.confirm("此操作将永久删除平盘记录,是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deletedicekeMiningrecord(id).then(() => {
//
ElMessage({
type: "success",
message: "删除成功!"
})
message: "删除成功!",
});
//
this.getList()
})
this.getList();
});
})
.catch(() => {
ElMessage({
type: "info",
message: "已取消删除"
})
})
message: "已取消删除",
});
});
},
handleAdd() {
this.isEdit = false;
this.dicekeMiningrecordform = {
shovelID: null,
plateID: null,
totalMiningTon: '',
metalTon: '',
miningGrade: '',
oxidationRate: '',
avgGrade: '',
dressingGrade: '',
avgOxidationRate: '',
beizhu: ''
}; //
totalMiningTon: "",
metalTon: "",
miningGrade: "",
oxidationRate: "",
avgGrade: "",
dressingGrade: "",
avgOxidationRate: "",
beizhu: "",
}; //
//
Promise.all([findAllPlateArea(), findAllshovel()])
.then(([plateAreaResponse, shovelResponse]) => {
this.plateAreaQuerry = plateAreaResponse.data.plateArea;
this.shovelQuerry = shovelResponse.data.shovel;
this.updatedicekeMiningrecordform = true; //
this.updatedicekeMiningrecordform = true; //
})
.catch(() => {
ElMessage.error("加载平盘和电产信息失败,请稍后重试");
@ -86,52 +83,68 @@ export default {
this.updatedicekeMiningrecordform = true;
},
handleEdit(id) {
this.isEdit = true
this.isEdit = true;
finddicekeMiningrecordById(id).then((Response) => {
this.dicekeMiningrecordform = Response.data.dicekeMiningrecordServiceById
this.updatedicekeMiningrecordform = true
})
findAllPlateArea().then((Response)=>{
this.plateAreaQuerry = Response.data.plateArea
})
findAllshovel().then((Response)=>{
this.shovelQuerry = Response.data.shovel
})
this.dicekeMiningrecordform =
Response.data.dicekeMiningrecordServiceById;
this.updatedicekeMiningrecordform = true;
});
findAllPlateArea().then((Response) => {
this.plateAreaQuerry = Response.data.plateArea;
});
findAllshovel().then((Response) => {
this.shovelQuerry = Response.data.shovel;
});
},
updatePlateArea(){
if (this.isEdit){
updatedicekeMiningrecord(this.dicekeMiningrecordform).then(() => {
ElMessage({
type: "success",
message: "修改成功!"
updatePlateArea() {
if (this.isEdit) {
updatedicekeMiningrecord(this.dicekeMiningrecordform)
.then(() => {
ElMessage({
type: "success",
message: "修改成功!",
});
this.updatedicekeMiningrecordform = false;
this.getList();
})
this.updatedicekeMiningrecordform = false
this.getList()
}).catch(() => {
ElMessage.error("修改失败,请稍后重试")
})
}else{
adddicekeMiningrecord(this.dicekeMiningrecordform).then(() => {
ElMessage({
type: "success",
message: "新增成功!"
.catch(() => {
ElMessage.error("修改失败,请稍后重试");
});
} else {
adddicekeMiningrecord(this.dicekeMiningrecordform)
.then(() => {
ElMessage({
type: "success",
message: "新增成功!",
});
this.updatedicekeMiningrecordform = false;
this.getList(); //
})
.catch(() => {
ElMessage.error("新增失败,请稍后重试");
});
this.updatedicekeMiningrecordform = false;
this.getList(); //
}).catch(() => {
ElMessage.error("新增失败,请稍后重试");
});
}
}
}
}
},
},
};
</script>
<template>
<div class="app-container">
<div style="margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center;">
<div
style="
margin-bottom: 20px;
display: flex;
justify-content: space-between;
align-items: center;
"
>
<!-- 查询条件输入框 -->
<el-input v-model="searchQuery" placeholder="请输入铲号或平盘" style="width: 200px; margin-right: 10px;" />
<el-input
v-model="searchQuery"
placeholder="请输入铲号或平盘"
style="width: 200px; margin-right: 10px"
/>
<el-button type="primary" @click="searchData">查询</el-button>
<!-- 新增按钮 -->
@ -139,31 +152,71 @@ export default {
type="primary"
@click="handleAdd"
icon="el-icon-plus"
style="width: 100px; display: flex; justify-content: center; align-items: center;">
style="
width: 100px;
display: flex;
justify-content: center;
align-items: center;
"
>
新增
</el-button>
</div>
<el-table :data="dicekeMiningrecordQuery" border style="width: 100%" :span-method="spanMethod">
<el-table
:cell-style="rowStyle"
:data="dicekeMiningrecordQuery"
border
style="width: 100%"
:span-method="spanMethod"
>
<!-- 表格列定义 -->
<el-table-column prop="plateRange" label="平盘(#" />
<el-table-column prop="shovelCode" label="铲号(#" />
<el-table-column prop="totalMiningTon" label="采矿量t" />
<el-table-column prop="metalTon" label="金属量(#" />
<el-table-column prop="miningGrade" label="块段采矿品位(%" />
<el-table-column prop="oxidationRate" label="块段氧化率(%" />
<el-table-column prop="avgGrade" label="全月平均品位(%" />
<el-table-column prop="dressingGrade" label="选矿平均品位(%" />
<el-table-column prop="avgOxidationRate" label="全月平均氧化率(%" />
<el-table-column prop="beizhu" label="备注" />
<el-table-column fixed="right" label="操作" width="150" align="center">
<el-table-column align="center" prop="plateRange" label="平盘(#" />
<el-table-column align="center" prop="shovelCode" label="铲号(#" />
<el-table-column
align="center"
prop="totalMiningTon"
label="采矿量t"
/>
<el-table-column align="center" prop="metalTon" label="金属量(#" />
<el-table-column
align="center"
prop="miningGrade"
label="块段采矿品位(%"
/>
<el-table-column
align="center"
prop="oxidationRate"
label="块段氧化率(%"
/>
<el-table-column
align="center"
prop="avgGrade"
label="全月平均品位(%"
/>
<el-table-column
align="center"
prop="dressingGrade"
label="选矿平均品位(%"
/>
<el-table-column
align="center"
prop="avgOxidationRate"
label="全月平均氧化率(%"
/>
<el-table-column align="center" prop="beizhu" label="备注" />
<el-table-column align="center" fixed="right" label="操作" width="150">
<template #default="scope">
<div style="display: flex; justify-content: center; gap: 8px;">
<el-button type="primary" text bg size="small" plain @click="handleEdit(scope.row.recordID)">
<div style="display: flex; justify-content: center; gap: 8px">
<el-button
type="primary"
size="small"
@click="handleEdit(scope.row.recordID)"
>
修改
</el-button>
<el-button
type="danger"
text bg size="small"
size="small"
@click="removeDataById(scope.row.recordID)"
>
删除
@ -172,42 +225,86 @@ export default {
</template>
</el-table-column>
</el-table>
<el-dialog v-model="updatedicekeMiningrecordform" title="修改Mo品味信息" width="500">
<el-dialog
v-model="updatedicekeMiningrecordform"
title="修改Mo品味信息"
width="500"
>
<el-form :model="dicekeMiningrecordform">
<el-form-item label="电产" :label-width="formLabelWidth">
<el-select v-model="dicekeMiningrecordform.shovelID" placeholder="请选择电产">
<el-option v-for="shovel in shovelQuerry" :key="shovel.shovelID" :label="shovel.shovelCode" :value="shovel.shovelID" />
<el-select
v-model="dicekeMiningrecordform.shovelID"
placeholder="请选择电产"
>
<el-option
v-for="shovel in shovelQuerry"
:key="shovel.shovelID"
:label="shovel.shovelCode"
:value="shovel.shovelID"
/>
</el-select>
</el-form-item>
<el-form-item label="平盘" :label-width="formLabelWidth">
<el-select v-model="dicekeMiningrecordform.plateID" placeholder="请选择平盘">
<el-option v-for="plateArea in plateAreaQuerry" :key="plateArea.plateID" :label="plateArea.plateRange" :value="plateArea.plateID" />
<el-select
v-model="dicekeMiningrecordform.plateID"
placeholder="请选择平盘"
>
<el-option
v-for="plateArea in plateAreaQuerry"
:key="plateArea.plateID"
:label="plateArea.plateRange"
:value="plateArea.plateID"
/>
</el-select>
</el-form-item>
<el-form-item label="采矿量t" :label-width="formLabelWidth">
<el-input v-model="dicekeMiningrecordform.totalMiningTon" autocomplete="off" />
<el-input
v-model="dicekeMiningrecordform.totalMiningTon"
autocomplete="off"
/>
</el-form-item>
<el-form-item label="金属量(#" :label-width="formLabelWidth">
<el-input v-model="dicekeMiningrecordform.metalTon" autocomplete="off" />
<el-input
v-model="dicekeMiningrecordform.metalTon"
autocomplete="off"
/>
</el-form-item>
<el-form-item label="块段采矿品位(%" :label-width="formLabelWidth">
<el-input v-model="dicekeMiningrecordform.miningGrade" autocomplete="off" />
<el-input
v-model="dicekeMiningrecordform.miningGrade"
autocomplete="off"
/>
</el-form-item>
<el-form-item label="块段氧化率(%" :label-width="formLabelWidth">
<el-input v-model="dicekeMiningrecordform.oxidationRate" autocomplete="off" />
<el-input
v-model="dicekeMiningrecordform.oxidationRate"
autocomplete="off"
/>
</el-form-item>
<el-form-item label="全月平均品位(%" :label-width="formLabelWidth">
<el-input v-model="dicekeMiningrecordform.avgGrade" autocomplete="off" />
<el-input
v-model="dicekeMiningrecordform.avgGrade"
autocomplete="off"
/>
</el-form-item>
<el-form-item label="选矿平均品位(%" :label-width="formLabelWidth">
<el-input v-model="dicekeMiningrecordform.dressingGrade" autocomplete="off" />
<el-input
v-model="dicekeMiningrecordform.dressingGrade"
autocomplete="off"
/>
</el-form-item>
<el-form-item label="全月平均氧化率(%" :label-width="formLabelWidth">
<el-input v-model="dicekeMiningrecordform.avgOxidationRate" autocomplete="off" />
<el-input
v-model="dicekeMiningrecordform.avgOxidationRate"
autocomplete="off"
/>
</el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth">
<el-input v-model="dicekeMiningrecordform.beizhu" autocomplete="off" />
<el-input
v-model="dicekeMiningrecordform.beizhu"
autocomplete="off"
/>
</el-form-item>
</el-form>
<template #footer>
@ -215,9 +312,7 @@ export default {
<el-button @click="updatedicekeMiningrecordform = false">
取消
</el-button>
<el-button type="primary" @click="updatePlateArea">
提交
</el-button>
<el-button type="primary" @click="updatePlateArea"> 提交 </el-button>
</div>
</template>
</el-dialog>

View File

@ -0,0 +1,190 @@
<script>
import {
findTotalMiningByMonthApi,
updateTotalMiningApi,
} from "@@/apis/tables/diceke/excavationQuantityReport.ts";
import { getDate } 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 = getDate(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>

View File

@ -0,0 +1,197 @@
<script>
import {
findAllMiningglossApi,
deletedicekeMininglossApi,
finddicekeMiningrecordById,
findLossByMonthApi,
updatedicekeMininglossApi,
savedicekeMininglossApi,
} from "@@/apis/tables/diceke/LossDepletionReport.ts";
import { getDate } 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 = getDate(this.date);
const res = await findLossByMonthApi(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="采下废石(%)" />
<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="损失率(%)" />
<el-table-column align="center" prop="amount" label="配矿配矿量(t)" />
<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>

View File

@ -4,119 +4,129 @@ import {
deletePlateArea,
findAllPlateArea,
findPlateAreaById,
updatePlateAreaApi
} from "@@/apis/tables/diceke/plateArea.js"
updatePlateAreaApi,
} from "@@/apis/tables/diceke/plateArea.js";
export default {
data() {
return {
plateAreaQuerry: null, //
updatePlateAreaform: false,
plateAreaform: null
}
plateAreaform: null,
};
},
created() {
// methods
this.getList()
this.getList();
},
methods: {
getList() {
findAllPlateArea().then((Response) => {
console.log(Response)
this.plateAreaQuerry = Response.data.plateArea
})
console.log(Response);
this.plateAreaQuerry = Response.data.plateArea;
});
},
//
removeDataById(id) {
ElMessageBox.confirm(
"此操作将永久删除平盘记录,是否继续?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
)
ElMessageBox.confirm("此操作将永久删除平盘记录,是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deletePlateArea(id).then(() => {
//
ElMessage({
type: "success",
message: "删除成功!"
})
message: "删除成功!",
});
//
this.getList()
})
this.getList();
});
})
.catch(() => {
ElMessage({
type: "info",
message: "已取消删除"
})
})
message: "已取消删除",
});
});
},
handleAdd() {
this.isEdit = false //
this.plateAreaform = { plateRange: '' } //
this.updatePlateAreaform = true //
this.isEdit = false; //
this.plateAreaform = { plateRange: "" }; //
this.updatePlateAreaform = true; //
},
/** 修改平盘信息 */
handleEdit(id) {
this.isEdit = true
findPlateAreaById(id).then((Response) => {
this.plateAreaform = Response.data.dicekePlatearea
this.updatePlateAreaform = true
}).catch(() => {
ElMessage.error("查询失败,请稍后重试")
})
this.isEdit = true;
findPlateAreaById(id)
.then((Response) => {
this.plateAreaform = Response.data.dicekePlatearea;
this.updatePlateAreaform = true;
})
.catch(() => {
ElMessage.error("查询失败,请稍后重试");
});
},
updatePlateArea() {
if (this.isEdit){
updatePlateAreaApi(this.plateAreaform).then(() => {
ElMessage({
type: "success",
message: "修改成功!"
if (this.isEdit) {
updatePlateAreaApi(this.plateAreaform)
.then(() => {
ElMessage({
type: "success",
message: "修改成功!",
});
this.updatePlateAreaform = false;
this.getList();
})
this.updatePlateAreaform = false
this.getList()
}).catch(() => {
ElMessage.error("修改失败,请稍后重试")
})
}else {
addPlateAreaApi(this.plateAreaform).then(() => {
ElMessage({
type: "success",
message: "新增成功!"
.catch(() => {
ElMessage.error("修改失败,请稍后重试");
});
} else {
addPlateAreaApi(this.plateAreaform)
.then(() => {
ElMessage({
type: "success",
message: "新增成功!",
});
this.updatePlateAreaform = false;
this.getList();
})
this.updatePlateAreaform = false
this.getList()
}).catch(() => {
ElMessage.error("新增失败,请稍后重试")
})
.catch(() => {
ElMessage.error("新增失败,请稍后重试");
});
}
}
}
}
},
},
};
</script>
<template>
<div class="app-container">
<div style="margin-bottom: 20px;">
<el-button type="primary" @click="handleAdd" icon="el-icon-plus">新增平盘</el-button>
<div style="margin-bottom: 20px">
<el-button type="primary" @click="handleAdd">新增平盘</el-button>
</div>
<el-table :data="plateAreaQuerry" border style="width: 100%" :span-method="spanMethod">
<el-table
:data="plateAreaQuerry"
border
style="width: 100%"
:span-method="spanMethod"
>
<!-- 表格列定义 -->
<el-table-column prop="plateRange" label="平盘(#" />
<el-table-column fixed="right" label="操作" width="300" align="center">
<template #default="scope">
<div style="display: flex; justify-content: center; gap: 8px;">
<el-button type="primary" text bg size="small" plain @click="handleEdit(scope.row.plateID)">
<div style="display: flex; justify-content: center; gap: 8px">
<el-button
type="primary"
size="small"
@click="handleEdit(scope.row.plateID)"
>
修改
</el-button>
<el-button
type="danger"
text bg size="small"
size="small"
@click="removeDataById(scope.row.plateID)"
>
删除
@ -133,12 +143,8 @@ export default {
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="updatePlateAreaform = false">
取消
</el-button>
<el-button type="primary" @click="updatePlateArea">
提交
</el-button>
<el-button @click="updatePlateAreaform = false"> 取消 </el-button>
<el-button type="primary" @click="updatePlateArea"> 提交 </el-button>
</div>
</template>
</el-dialog>

View File

@ -4,128 +4,150 @@ import {
deletePrecipitation,
findAllPrecipitation,
findPrecipitationById,
updatePrecipitationApi
} from "@@/apis/tables/diceke/Precipitation.ts"
updatePrecipitationApi,
} from "@@/apis/tables/diceke/Precipitation.ts";
export default {
data() {
return {
precipitationQuerry: null, //
updateprecipitationform: false,
precipitationform: null
}
precipitationform: null,
};
},
created() {
// methods
this.getList()
this.getList();
},
methods: {
getList() {
findAllPrecipitation().then((Response) => {
console.log(Response)
this.precipitationQuerry = Response.data.precipitation
})
console.log(Response);
this.precipitationQuerry = Response.data.precipitation;
});
},
removeDataById(id) {
ElMessageBox.confirm(
"此操作将永久删除降水量记录,是否继续?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
)
ElMessageBox.confirm("此操作将永久删除降水量记录,是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deletePrecipitation(id).then(() => {
//
ElMessage({
type: "success",
message: "删除成功!"
})
message: "删除成功!",
});
//
this.getList()
})
this.getList();
});
})
.catch(() => {
ElMessage({
type: "info",
message: "已取消删除"
})
})
message: "已取消删除",
});
});
},
handleAdd() {
this.isEdit = false //
this.precipitationform = { plateRange: "" } //
this.updateprecipitationform = true //
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("查询失败,请稍后重试")
})
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"
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: "修改成功!"
updatePrecipitationApi(this.precipitationform)
.then(() => {
ElMessage({
type: "success",
message: "修改成功!",
});
this.updateprecipitationform = false;
this.getList();
})
this.updateprecipitationform = false
this.getList()
}).catch(() => {
ElMessage.error("修改失败,请稍后重试")
})
.catch(() => {
ElMessage.error("修改失败,请稍后重试");
});
} else {
addPrecipitationApi(this.precipitationform).then(() => {
ElMessage({
type: "success",
message: "新增成功!"
addPrecipitationApi(this.precipitationform)
.then(() => {
ElMessage({
type: "success",
message: "新增成功!",
});
this.updateprecipitationform = false;
this.getList();
})
this.updateprecipitationform = false
this.getList()
}).catch(() => {
ElMessage.error("新增失败,请稍后重试")
})
.catch(() => {
ElMessage.error("新增失败,请稍后重试");
});
}
}
}
}
},
},
};
</script>
<template>
<div class="app-container">
<div style="margin-bottom: 20px;">
<div style="margin-bottom: 20px">
<el-button type="primary" @click="handleAdd" icon="el-icon-plus">
新增降水量
</el-button>
</div>
<el-table :data="precipitationQuerry" border style="width: 100%" :span-method="spanMethod">
<el-table
:cell-style="rowStyle"
:data="precipitationQuerry"
border
style="width: 100%"
:span-method="spanMethod"
>
<!-- 表格列定义 -->
<el-table-column prop="amount" label="降水量" />
<el-table-column prop="unit" label="计量单位" />
<el-table-column prop="monthDate" label="月份" :formatter="(row) => formatMonth(row.monthDate)" />
<el-table-column fixed="right" label="操作" width="300" align="center">
<el-table-column align="center" prop="amount" label="降水量" />
<el-table-column align="center" prop="unit" label="计量单位" />
<el-table-column
align="center"
prop="monthDate"
label="月份"
:formatter="(row) => formatMonth(row.monthDate)"
/>
<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" text bg size="small" plain @click="handleEdit(scope.row.precipID)">
<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"
text bg size="small"
size="small"
@click="removeDataById(scope.row.precipID)"
>
删除
@ -134,7 +156,11 @@ export default {
</template>
</el-table-column>
</el-table>
<el-dialog v-model="updateprecipitationform" title="修改降水量信息" width="500">
<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" />
@ -152,9 +178,7 @@ export default {
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="updateprecipitationform = false">
取消
</el-button>
<el-button @click="updateprecipitationform = false"> 取消 </el-button>
<el-button type="primary" @click="updatePrecipitation">
提交
</el-button>

View File

@ -4,121 +4,132 @@ import {
deleteTableDataApi,
findAllshovel,
findShovelById,
updateshovelApi
} from "@@/apis/tables/diceke/shovel.js"
updateshovelApi,
} from "@@/apis/tables/diceke/shovel.js";
export default {
data() {
return {
shovelQuerry: null, //
shovelform: null,
updateshovelform: false
}
updateshovelform: false,
};
},
created() {
// methods
this.getList()
this.getList();
},
methods: {
getList() {
findAllshovel().then((Response) => {
console.log(Response)
this.shovelQuerry = Response.data.shovel
console.log(this.shovelQuerry)
})
console.log(Response);
this.shovelQuerry = Response.data.shovel;
console.log(this.shovelQuerry);
});
},
//
removeDataById(id) {
ElMessageBox.confirm(
"此操作将永久删除电铲记录,是否继续?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
)
ElMessageBox.confirm("此操作将永久删除电铲记录,是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
deleteTableDataApi(id).then(() => {
//
ElMessage({
type: "success",
message: "删除成功!"
})
message: "删除成功!",
});
//
this.getList()
})
this.getList();
});
})
.catch(() => {
ElMessage({
type: "info",
message: "已取消删除"
})
})
message: "已取消删除",
});
});
},
//
handleAdd() {
this.isEdit = false
this.shovelform = { shovelCode: '', attribute: '1' }
this.updateshovelform = true //
this.isEdit = false;
this.shovelform = { shovelCode: "", attribute: "1" };
this.updateshovelform = true; //
},
/** 修改电铲信息 */
handleEdit(id) {
this.isEdit = true
findShovelById(id).then((Response) => {
this.shovelform = Response.data.dicekeShovel
this.isEdit = true;
findShovelById(id)
.then((Response) => {
this.shovelform = Response.data.dicekeShovel;
if (this.shovelform.attribute === 1) {
this.shovelform.attribute = '自营'
this.shovelform.attribute = "自营";
} else if (this.shovelform.attribute === 2) {
this.shovelform.attribute = '外委'
this.shovelform.attribute = "外委";
}
this.updateshovelform = true
}).catch(() => {
ElMessage.error("查询失败,请稍后重试")
this.updateshovelform = true;
})
.catch(() => {
ElMessage.error("查询失败,请稍后重试");
});
},
updateshovel() {
if (this.shovelform.attribute === '自营') {
this.shovelform.attribute = 1
} else if (this.shovelform.attribute === '外委') {
this.shovelform.attribute = 2
if (this.shovelform.attribute === "自营") {
this.shovelform.attribute = 1;
} else if (this.shovelform.attribute === "外委") {
this.shovelform.attribute = 2;
}
if(this.isEdit){
updateshovelApi(this.shovelform).then(() => {
ElMessage({
type: "success",
message: "修改成功!"
if (this.isEdit) {
updateshovelApi(this.shovelform)
.then(() => {
ElMessage({
type: "success",
message: "修改成功!",
});
this.updateshovelform = false;
this.getList();
})
this.updateshovelform = false
this.getList()
}).catch(() => {
ElMessage.error("修改失败,请稍后重试")
})
}else {
addShovelApi(this.shovelform).then(() => {
ElMessage({
type: "success",
message: "新增成功!"
})
this.updateshovelform = false
this.getList()
}).catch(() => {
ElMessage.error("新增失败,请稍后重试")
})
}
}
}
}
.catch(() => {
ElMessage.error("修改失败,请稍后重试");
});
} else {
addShovelApi(this.shovelform)
.then(() => {
ElMessage({
type: "success",
message: "新增成功!",
});
this.updateshovelform = false;
this.getList();
})
.catch(() => {
ElMessage.error("新增失败,请稍后重试");
});
}
},
},
};
</script>
<template>
<div class="app-container">
<div style="margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center;">
<div
style="
margin-bottom: 20px;
display: flex;
justify-content: space-between;
align-items: center;
"
>
<div>
<el-input v-model="searchQuery" placeholder="请输入铲号" style="width: 200px; margin-right: 10px;" />
<el-input
v-model="searchQuery"
placeholder="请输入铲号"
style="width: 200px; margin-right: 10px"
/>
<el-button type="primary" @click="searchData">查询</el-button>
</div>
<!-- 新增按钮 -->
@ -126,26 +137,43 @@ export default {
type="primary"
@click="handleAdd"
icon="el-icon-plus"
style="width: 100px; display: flex; justify-content: center; align-items: center;">
style="
width: 100px;
display: flex;
justify-content: center;
align-items: center;
"
>
新增
</el-button> </div>
<el-table :data="shovelQuerry" border style="width: 100%" :span-method="spanMethod">
</el-button>
</div>
<el-table
:cell-style="rowStyle"
:data="shovelQuerry"
border
style="width: 100%"
:span-method="spanMethod"
>
<!-- 表格列定义 -->
<el-table-column prop="shovelCode" label="铲号(#" />
<el-table-column label="属性">
<el-table-column align="center" prop="shovelCode" label="铲号(#" />
<el-table-column align="center" label="属性">
<template #default="scope">
<span>{{ scope.row.attribute === 1 ? '自营' : '外委' }}</span>
<span>{{ scope.row.attribute === 1 ? "自营" : "外委" }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="300" align="center">
<template #default="scope">
<div style="display: flex; justify-content: center; gap: 8px;">
<el-button type="primary" text bg size="small" plain @click="handleEdit(scope.row.shovelID)">
<div style="display: flex; justify-content: center; gap: 8px">
<el-button
type="primary"
size="small"
@click="handleEdit(scope.row.shovelID)"
>
修改
</el-button>
<el-button
type="danger"
text bg size="small"
size="small"
@click="removeDataById(scope.row.shovelID)"
>
删除
@ -168,12 +196,8 @@ export default {
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="updateshovelform = false">
取消
</el-button>
<el-button type="primary" @click="updateshovel">
提交
</el-button>
<el-button @click="updateshovelform = false"> 取消 </el-button>
<el-button type="primary" @click="updateshovel"> 提交 </el-button>
</div>
</template>
</el-dialog>

View File

@ -197,8 +197,43 @@ export const constantRoutes: RouteRecordRaw[] = [
title: "降水量报表",
},
},
{
path: "lossDepletionReport",
component: () => import("@/pages/demo/diceke/LossDepletionReport.vue"),
name: "",
meta: {
title: "损失和贫化报表",
},
},
{
path: "excavationQuantityReport",
component: () => import("@/pages/demo/diceke/excavationQuantityReport.vue"),
name: "",
meta: {
title: "采剥量报表",
},
},
],
},
// {
// path: "/caiqu",
// component: Layouts,
// redirect: "/caiqu",
// meta: {
// title: "采区",
// elIcon: "Link",
// },
// children: [
// {
// path: "shovel",
// component: () => import("@/pages/demo/diceke/shovel.vue"),
// name: "shovel",
// meta: {
// title: "电铲维护",
// },
// },
// ],
// },
];
/**