项目初始化

This commit is contained in:
liuhanqing
2025-09-11 11:19:00 +08:00
parent 13df9e0355
commit d53f41223b
1194 changed files with 245831 additions and 34 deletions

View File

@@ -0,0 +1,432 @@
<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="stockId"><!-- 库存id -->
<el-input
v-model="queryParams.stockId"
placeholder="请输入库存ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="货位ID" prop="cargoSpaceId"><!-- 货位id -->
<el-input
v-model="queryParams.cargoSpaceId"
placeholder="请输入货位ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="库存状态" prop="stockStatus"><!-- 库存状态 -->
<el-select v-model="queryParams.stockStatus" placeholder="请选择库存状态" clearable>
<el-option
v-for="dict in dict.type.stock_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="货位状态" prop="cargoSpaceStockStatus"><!-- 货位状态 -->
<el-select v-model="queryParams.cargoSpaceStockStatus" placeholder="请选择货位状态" clearable>
<el-option
v-for="dict in dict.type.cargo_space_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="物料状态" prop="productStatus"><!-- 物料状态 -->
<el-select v-model="queryParams.productStatus" placeholder="请选择物料状态" clearable>
<el-option
v-for="dict in dict.type.product_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="入库时间" prop="startDate"><!-- 入库时间 -->
<el-date-picker clearable
v-model="queryParams.inDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择入库时间">
</el-date-picker>
</el-form-item>
<el-form-item label="托盘条码" prop="trayCode"><!-- 托盘条码 -->
<el-input
v-model="queryParams.trayCode"
placeholder="请输入托盘条码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料描述" prop="productName"><!-- 物料描述 -->
<el-input
v-model="queryParams.productName"
placeholder="请输入物料描述"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库" prop="warehouseId"><!-- 仓库id -->
<el-select v-model="queryParams.warehouseId" placeholder="请选择仓库">
<el-option
v-for="item in warehouseOptions"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
/>
</el-select>
</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="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['stock:management: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="['stock:management:remove']"
>删除 <!-- 删除 --></el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['stock:management:export']"
>导出 <!-- 导出 --></el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="managementList" @selection-change="handleSelectionChange" max-height="650">
<el-table-column type="selection" align="center" />
<el-table-column width=120 label="库存ID" align="left" prop="stockId" /> <!-- 库存id -->
<el-table-column width=120 label="货位ID" align="left" prop="cargoSpaceId" /> <!-- 货位id -->
<el-table-column width=120 label="货位名称" align="left" prop="cargoSpaceName" /> <!-- 货位id -->
<el-table-column width=120 label="库存状态" align="left" prop="stockStatus" ><!-- 库存状态 -->
<template slot-scope="scope">
<dict-tag :options="dict.type.stock_status" :value="scope.row.stockStatus"/>
</template>
</el-table-column>
<el-table-column width=120 label="货位状态" align="left" prop="cargoSpaceStockStatus"> <!-- 货位状态 -->
<template slot-scope="scope">
<dict-tag :options="dict.type.cargo_space_status" :value="scope.row.cargoSpaceStockStatus"/>
</template>
</el-table-column>
<el-table-column width=120 label="货位状态" align="left" prop="cargoSpaceStatus" ><!--货位状态-->
<template slot-scope="scope">
<dict-tag :options="dict.type.cargo_space_lock_status" :value="scope.row.cargoSpaceStatus"/>
</template>
</el-table-column><!-- 货位状态 -->
<el-table-column width=120 label="物料状态" align="left" prop="productStatus"> <!-- 物料状态 -->
<template slot-scope="scope">
<dict-tag :options="dict.type.product_status" :value="scope.row.productStatus"/>
</template>
</el-table-column>
<el-table-column width=120 label="物料ID" align="left" prop="extraField.productId" /> <!-- 物料Id -->
<el-table-column width=120 label="物料描述" align="left" prop="extraField.materialDesc" /> <!-- 物料描述 -->
<el-table-column width=120 label="英文描述" align="left" prop="extraField.englishDesc" /> <!-- 物料英文描述 -->
<el-table-column width=120 label="净重" align="right" prop="extraField.netWeight" /> <!-- 净重 -->
<el-table-column width=120 label="长" align="right" prop="extraField.length" /> <!-- 长 -->
<el-table-column width=120 label="宽" align="right" prop="extraField.width" /> <!-- 宽 -->
<el-table-column width=120 label="高" align="right" prop="extraField.height" /> <!-- 高 -->
<el-table-column width=120 label="体积" align="right" prop="extraField.volume" /> <!-- 体积 -->
<el-table-column width=120 label="库存数量" align="right" prop="quantity"/> <!-- 库存数量 -->
<el-table-column width=120 label="作业ID" align="left" prop="jobId" /> <!-- 作业ID -->
<el-table-column width=120 label="托盘条码" align="left" prop="trayCode" /> <!-- 托盘条码 -->
<el-table-column width=120 label="入库主单" align="left" prop="stockinId" /> <!-- 入库主单 -->
<el-table-column width=120 label="入库子单ID" align="left" prop="stockinDetailId" /> <!-- 入库子单id -->
<el-table-column width=120 label="入库类型" align="left" prop="inType" /> <!-- 入库类型 -->
<el-table-column width=120 label="仓库" align="left" prop="warehouseName" /> <!-- 仓库 -->
<el-table-column width=120 label="入库时间" align="left" prop="inDate" /> <!-- 入库时间 -->
<el-table-column width=120 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="['stock:management:edit']"
>修改 <!-- 修改 --></el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['stock:management: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="stockId"> <!-- 库存id -->
<el-input v-model="form.stockId" placeholder="请输入库存ID" />
</el-form-item>
<el-form-item label="货位ID" prop="cargoSpaceId"> <!-- 货位id -->
<el-input v-model="form.cargoSpaceId" placeholder="请输入货位ID" />
</el-form-item>
<el-form-item label="库存状态" prop="stockStatus"> <!-- 库存状态 -->
<el-select v-model="form.stockStatus" placeholder="请选择库存状态">
<el-option
v-for="dict in dict.type.stock_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="库存数量" prop="quantity"> <!-- 库存数量 -->
<el-input v-model="form.quantity" 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 { listManagement, getManagement, delManagement, addManagement, updateManagement } from "@/api/stock/management"
import {listWarehouse} from "@/api/bas/warehouse"
export default {
name: "Management",
dicts: ['product_status', 'stock_status','cargo_space_status','cargo_space_lock_status'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 库存信息表格数据
managementList: [],
// 仓库选项
warehouseOptions: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
stockId: null,
cargoSpaceId: null,
stockStatus: null,
productStatus: null,
lotNo: null,
inDate: null,
backDate: null,
productGuid: null,
quantity: null,
jobId: null,
trayCode: null,
outQuantity: null,
stockinDetailId: null,
stockinId: null,
inType: null,
inClassId: null,
warehouseId: null,
stackingId: null,
spare1: null,
spare2: null,
spare3: null,
spare4: null,
spare5: null,
spare6: null
},
queryWarehouse: {
pageNum:1,
pageSize: 99
},
// 表单参数
form: {},
// 表单校验
rules: {
/*stockId: [
{ required: true, message: this.$t('stockManagement.stockIdRequired'), trigger: "blur" } // 库存id不能为空
]*/
}
}
},
created() {
this.getList()
this.getWarehouseList();
},
methods: {
/** 获取仓库列表 */
getWarehouseList() {
listWarehouse(this.queryWarehouse).then(response => {
this.warehouseOptions = response.rows;
});
},
/** 查询库存信息列表 */
getList() {
this.loading = true
listManagement(this.queryParams).then(response => {
this.managementList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
stockId: null,
cargoSpaceId: null,
stockStatus: null,
productStatus: null,
lotNo: null,
inDate: null,
backDate: null,
productGuid: null,
quantity: null,
jobId: null,
trayCode: null,
outQuantity: null,
stockinDetailId: null,
stockinId: null,
inType: null,
inClassId: null,
warehouseId: null,
stackingId: null,
spare1: null,
spare2: null,
spare3: null,
spare4: null,
spare5: null,
spare6: 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.stockId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加库存信息" // 添加库存信息
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const stockId = row.stockId || this.ids
getManagement(stockId).then(response => {
this.form = response.data
this.open = true
this.title = "修改库存信息" // 修改库存信息
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.stockId != null) {
updateManagement(this.form).then(response => {
this.$modal.msgSuccess("修改成功") // 修改成功
this.open = false
this.getList()
})
} else {
addManagement(this.form).then(response => {
this.$modal.msgSuccess("新增成功") // 新增成功
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const stockIds = row.stockId || this.ids
this.$modal.confirm("是否确认删除库存信息编号为" + stockIds).then(function() { // 是否确认删除库存信息编号为
return delManagement(stockIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功") // 删除成功
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('stock/management/export', {
...this.queryParams
}, `management_${new Date().getTime()}.xlsx`)
}
}
}
</script>
<style>
.no-wrap {
white-space: nowrap;
}
</style>