新增排水量前端,损失贫化等带新增
Some checks failed
Build And Deploy v3-admin-vite / build-and-deploy (push) Has been cancelled
Some checks failed
Build And Deploy v3-admin-vite / build-and-deploy (push) Has been cancelled
This commit is contained in:
parent
d90a26dded
commit
fec3098825
0
src/common/apis/tables/diceke/DicekeMiningloss.ts
Normal file
0
src/common/apis/tables/diceke/DicekeMiningloss.ts
Normal file
42
src/common/apis/tables/diceke/Precipitation.ts
Normal file
42
src/common/apis/tables/diceke/Precipitation.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import { request } from "@/http/axios"
|
||||
|
||||
/** 查 */
|
||||
export function findAllPrecipitation() {
|
||||
return request({
|
||||
url: "/dicekePrecipitation/findAllPrecipitation",
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
/** 删 */
|
||||
export function deletePrecipitation(id: number) {
|
||||
return request({
|
||||
url: `/dicekePrecipitation/deletePrecipitation/${id}`,
|
||||
method: "delete"
|
||||
})
|
||||
}
|
||||
|
||||
/** 根据id查平盘信息 */
|
||||
export function findPrecipitationById(id: number) {
|
||||
return request({
|
||||
url: `/dicekePrecipitation/findPrecipitationById/${id}`,
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
/** 修改盘信息 */
|
||||
export function updatePrecipitationApi(precipitationform: any) {
|
||||
return request({
|
||||
url: `/dicekePrecipitation/updatePrecipitation`,
|
||||
method: "post",
|
||||
data: precipitationform
|
||||
})
|
||||
}
|
||||
|
||||
export function addPrecipitationApi(precipitationform: any) {
|
||||
return request({
|
||||
url: `/dicekePrecipitation/addPrecipitation`,
|
||||
method: "post",
|
||||
data: precipitationform
|
||||
})
|
||||
}
|
@ -39,7 +39,7 @@ export function getTableDataApi(params: Tables.TableRequestData) {
|
||||
/** 查 */
|
||||
export function getTableData() {
|
||||
return request<Tables.TableResponseData>({
|
||||
url: "renshi/renyuanjiegou/findAll",
|
||||
url: "renyuanjiegou/findAll",
|
||||
// url: "tables",
|
||||
method: "get"
|
||||
})
|
||||
|
229
src/pages/demo/diceke/DicekeMiningloss.vue
Normal file
229
src/pages/demo/diceke/DicekeMiningloss.vue
Normal file
@ -0,0 +1,229 @@
|
||||
<script>
|
||||
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"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dicekeMiningrecordQuery: null,
|
||||
updatedicekeMiningrecordform: false,
|
||||
dicekeMiningrecordform: null,
|
||||
plateAreaQuerry: null,
|
||||
shovelQuerry: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 页面渲染之前执行,一般调用methods定义的方法
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
findAllMiningrecord().then((Response) => {
|
||||
console.log(Response)
|
||||
this.dicekeMiningrecordQuery = Response.data.dicekeMiningrecordVoList
|
||||
console.log(this.dicekeMiningrecordQuery)
|
||||
})
|
||||
},
|
||||
// 删除平盘
|
||||
removeDataById(id) {
|
||||
ElMessageBox.confirm(
|
||||
"此操作将永久删除平盘记录,是否继续?",
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deletedicekeMiningrecord(id).then(() => {
|
||||
// 删除成功
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "删除成功!"
|
||||
})
|
||||
// 重新加载列表
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage({
|
||||
type: "info",
|
||||
message: "已取消删除"
|
||||
})
|
||||
})
|
||||
},
|
||||
handleAdd() {
|
||||
this.isEdit = false
|
||||
this.dicekeMiningrecordform = {
|
||||
shovelID: null,
|
||||
plateID: null,
|
||||
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 // 数据加载完成后再打开弹窗
|
||||
})
|
||||
.catch(() => {
|
||||
ElMessage.error("加载平盘和电产信息失败,请稍后重试")
|
||||
})
|
||||
this.updatedicekeMiningrecordform = true
|
||||
},
|
||||
handleEdit(id) {
|
||||
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
|
||||
})
|
||||
},
|
||||
updatePlateArea() {
|
||||
if (this.isEdit) {
|
||||
updatedicekeMiningrecord(this.dicekeMiningrecordform).then(() => {
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "修改成功!"
|
||||
})
|
||||
this.updatedicekeMiningrecordform = false
|
||||
this.getList()
|
||||
}).catch(() => {
|
||||
ElMessage.error("修改失败,请稍后重试")
|
||||
})
|
||||
} else {
|
||||
adddicekeMiningrecord(this.dicekeMiningrecordform).then(() => {
|
||||
ElMessage({
|
||||
type: "success",
|
||||
message: "新增成功!"
|
||||
})
|
||||
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;">
|
||||
<!-- 查询条件输入框 -->
|
||||
<el-input v-model="searchQuery" placeholder="请输入铲号或平盘" style="width: 200px; margin-right: 10px;" />
|
||||
<el-button type="primary" @click="searchData">
|
||||
查询
|
||||
</el-button>
|
||||
|
||||
<!-- 新增按钮 -->
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
icon="el-icon-plus"
|
||||
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-column prop="plateRange" label="平盘(#)" />
|
||||
<el-table-column prop="shovelCode" label="铲号(#)" />
|
||||
<el-table-column prop="totalMiningTon" label="实采总量(t)" />
|
||||
<el-table-column prop="wasteRockTon" label="采下废石(t)" />
|
||||
<el-table-column prop="dilutionRate" label="贫化率(%)" />
|
||||
<el-table-column prop="oxidationRate" label="圈定矿量(t)" />
|
||||
<el-table-column prop="avgGrade" label="损失矿量(t)" />
|
||||
<el-table-column prop="lossRate" label="损失率(%)" />
|
||||
<el-table-column prop="allocationTon" label="配矿配矿量(t)" />
|
||||
<el-table-column prop="month" label="月份" />
|
||||
<el-table-column fixed="right" label="操作" width="150" 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.recordID)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
text bg size="small"
|
||||
@click="removeDataById(scope.row.recordID)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<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>
|
||||
</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>
|
||||
</el-form-item>
|
||||
<el-form-item label="采矿量(t)" :label-width="formLabelWidth">
|
||||
<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-form-item>
|
||||
<el-form-item label="块段采矿品位(%)" :label-width="formLabelWidth">
|
||||
<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-form-item>
|
||||
<el-form-item label="全月平均品位(%)" :label-width="formLabelWidth">
|
||||
<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-form-item>
|
||||
<el-form-item label="全月平均氧化率(%)" :label-width="formLabelWidth">
|
||||
<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-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="updatedicekeMiningrecordform = false">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" @click="updatePlateArea">
|
||||
提交
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
165
src/pages/demo/diceke/Precipitation.vue
Normal file
165
src/pages/demo/diceke/Precipitation.vue
Normal file
@ -0,0 +1,165 @@
|
||||
<script>
|
||||
import {
|
||||
addPrecipitationApi,
|
||||
deletePrecipitation,
|
||||
findAllPrecipitation,
|
||||
findPrecipitationById,
|
||||
updatePrecipitationApi
|
||||
} from "@@/apis/tables/diceke/Precipitation.ts"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
precipitationQuerry: null, // 电铲平台数据
|
||||
updateprecipitationform: false,
|
||||
precipitationform: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 页面渲染之前执行,一般调用methods定义的方法
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
findAllPrecipitation().then((Response) => {
|
||||
console.log(Response)
|
||||
this.precipitationQuerry = Response.data.precipitation
|
||||
})
|
||||
},
|
||||
|
||||
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-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-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">
|
||||
<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)">
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
text bg 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>
|
@ -17,7 +17,7 @@ export default {
|
||||
getTableData().then((Response) => {
|
||||
console.log(Response)
|
||||
this.rsqlQuerry = Response.data.renyuanjiegou
|
||||
this.rsglsum = Response.data.RENYUANSUM
|
||||
this.rsglsum = Response.data.renyuanSum
|
||||
console.log(this.rsqlQuerry)
|
||||
console.log(this.rsglsum)
|
||||
this.processData()
|
||||
|
@ -188,8 +188,15 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
meta: {
|
||||
title: "Mo品味报表"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "dicekePrecipitation",
|
||||
component: () => import("@/pages/demo/diceke/Precipitation.vue"),
|
||||
name: "dicekePrecipitation",
|
||||
meta: {
|
||||
title: "降水量报表"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
|
1
types/auto/components.d.ts
vendored
1
types/auto/components.d.ts
vendored
@ -18,6 +18,7 @@ declare module 'vue' {
|
||||
ElCard: typeof import('element-plus/es')['ElCard']
|
||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||
ElContainer: typeof import('element-plus/es')['ElContainer']
|
||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
||||
|
Loading…
x
Reference in New Issue
Block a user