部门 巷道 重量统计

This commit is contained in:
刘汗青
2026-06-08 10:09:26 +08:00
parent 2ffea4b088
commit aab14ac716
12 changed files with 879 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询各巷道重量统计列表
export function listWeight(query) {
return request({
url: '/search/weight/list',
method: 'get',
params: query
})
}
// 查询各巷道重量统计详细
export function getWeight(warehouseId) {
return request({
url: '/search/weight/' + warehouseId,
method: 'get'
})
}
// 新增各巷道重量统计
export function addWeight(data) {
return request({
url: '/search/weight',
method: 'post',
data: data
})
}
// 修改各巷道重量统计
export function updateWeight(data) {
return request({
url: '/search/weight',
method: 'put',
data: data
})
}
// 删除各巷道重量统计
export function delWeight(warehouseId) {
return request({
url: '/search/weight/' + warehouseId,
method: 'delete'
})
}

View File

@@ -58,6 +58,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="部门" prop="deptName">
<el-input
v-model="queryParams.deptName"
placeholder="请输入部门"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="巷道" prop="roadwayId">
<el-input
v-model="queryParams.roadwayId"
@@ -406,6 +414,7 @@ export default {
managementNo: null,
dateStart:null,
dateEnd:null,
deptName:null,
roadwayId:null
},
// 表单参数

View File

@@ -61,6 +61,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="巷道" prop="roadwayId">
<el-input
v-model="queryParams.roadwayId"
placeholder="请输入巷道"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="起始时间" prop="inDateStart">
<el-date-picker clearable
v-model="queryParams.inDateStart"
@@ -249,6 +257,7 @@ export default {
trayCode:null,
inDateStart:null,
inDateEnd:null,
roadwayId:null
},
// 表单参数
form: {},

View File

@@ -0,0 +1,297 @@
<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="仓库id" prop="warehouseId">
<el-input
v-model="queryParams.warehouseId"
placeholder="请输入仓库id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="queryParams.warehouseName"
placeholder="请输入仓库名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="巷道" prop="roadwayId">
<el-input
v-model="queryParams.roadwayId"
placeholder="请输入巷道"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="排" prop="thePlatoon">
<el-input
v-model="queryParams.thePlatoon"
placeholder="请输入排"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="总量" prop="weightTotal">
<el-input
v-model="queryParams.weightTotal"
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-button icon="el-icon-refresh" size="mini" @click="handleExport" v-hasPermi="['search:weight:export']">导出</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="['search:weight: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="['search:weight: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="['search:weight:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- -->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
<!-- </el-row>-->
<el-table v-loading="loading" :data="weightList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="仓库id" align="center" prop="warehouseId" />
<el-table-column label="仓库名称" align="center" prop="warehouseName" />
<el-table-column label="巷道" align="center" prop="roadwayId" />
<el-table-column label="排" align="center" prop="thePlatoon" />
<el-table-column label="总量(KG)" align="center" prop="weightTotal" />
<!-- <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="['search:weight:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['search:weight: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="仓库id" prop="warehouseId">
<el-input v-model="form.warehouseId" placeholder="请输入仓库id" />
</el-form-item>
<el-form-item label="仓库名称" prop="warehouseName">
<el-input v-model="form.warehouseName" placeholder="请输入仓库名称" />
</el-form-item>
<el-form-item label="巷道" prop="roadwayId">
<el-input v-model="form.roadwayId" placeholder="请输入巷道" />
</el-form-item>
<el-form-item label="排" prop="thePlatoon">
<el-input v-model="form.thePlatoon" placeholder="请输入排" />
</el-form-item>
<el-form-item label="总量" prop="weightTotal">
<el-input v-model="form.weightTotal" 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 { listWeight, getWeight, delWeight, addWeight, updateWeight } from "@/api/search/weight"
export default {
name: "Weight",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 各巷道重量统计表格数据
weightList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
warehouseId: null,
warehouseName: null,
roadwayId: null,
thePlatoon: null,
weightTotal: null
},
// 表单参数
form: {},
// 表单校验
rules: {
warehouseId: [
{ required: true, message: "仓库id不能为空", trigger: "blur" }
],
thePlatoon: [
{ required: true, message: "排不能为空", trigger: "blur" }
],
}
}
},
created() {
this.getList()
},
methods: {
/** 查询各巷道重量统计列表 */
getList() {
this.loading = true
listWeight(this.queryParams).then(response => {
this.weightList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
warehouseId: null,
warehouseName: null,
roadwayId: null,
thePlatoon: null,
weightTotal: 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.warehouseId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加各巷道重量统计"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const warehouseId = row.warehouseId || this.ids
getWeight(warehouseId).then(response => {
this.form = response.data
this.open = true
this.title = "修改各巷道重量统计"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.warehouseId != null) {
updateWeight(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addWeight(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const warehouseIds = row.warehouseId || this.ids
this.$modal.confirm('是否确认删除各巷道重量统计编号为"' + warehouseIds + '"的数据项?').then(function() {
return delWeight(warehouseIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('search/weight/export', {
...this.queryParams
}, `weight_${new Date().getTime()}.xlsx`)
}
}
}
</script>