新增库存货位冻结/解冻功能,包含前端按钮和后端逻辑
实现遍历选中的库存ID,找到对应的货位。 确定操作方向(冻结/解冻)。 查找同组 (groupCodingNo) 的所有关联货位。 遍历所有涉及的货位时,先检查该货位是否有库存。 如果有库存:执行冻结/解冻操作(锁定货位 + 更新库存状态 + 记录日志)。 如果没有库存:跳过该货位,不执行任何操作(不锁货位,也不处理库存)。 修改了库存明细中库存数量和出库数量的小数显示为向下取整显示整数
This commit is contained in:
@@ -52,6 +52,15 @@ export function updateManagement(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 冻结/解冻库存
|
||||
export function freezeStock(stockIds) {
|
||||
return request({
|
||||
url: '/stock/management/freeze',
|
||||
method: 'post',
|
||||
data: stockIds
|
||||
})
|
||||
}
|
||||
|
||||
// 删除库存信息
|
||||
export function delManagement(stockId) {
|
||||
return request({
|
||||
|
||||
@@ -74,9 +74,13 @@
|
||||
<el-table-column width="150" label="货位id" align="center" prop="cargoSpaceId" />
|
||||
<el-table-column width="180" label="物料编码" align="center" prop="productId" />
|
||||
<el-table-column width="180" label="物料名称" align="center" prop="productName" />
|
||||
<el-table-column width="180" label="库存数量" align="center" prop="quantity" />
|
||||
<el-table-column width="200" label="unitPrices" align="center" prop="spare5" />
|
||||
<el-table-column width="180" label="units" align="center" prop="spare6" />
|
||||
<el-table-column width="180" label="库存数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.quantity != null ? Math.trunc(Number(scope.row.quantity)) : 0 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column width="200" label="unitPrices" align="center" prop="spare5" />
|
||||
<el-table-column width="180" label="units" align="center" prop="spare6" /> -->
|
||||
<el-table-column label="库存状态" align="center" prop="stockStatus">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.stock_status" :value="scope.row.stockStatus"/>
|
||||
@@ -93,7 +97,11 @@
|
||||
<!-- <el-table-column width="180" label="物料GUID" align="center" prop="productGuid" />-->
|
||||
<el-table-column width="180" label="作业ID" align="center" prop="jobId" />
|
||||
<el-table-column width="180" label="托盘条码" align="center" prop="trayCode" />
|
||||
<el-table-column width="180" label="出库数量" align="center" prop="outQuantity" />
|
||||
<el-table-column width="180" label="出库数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.outQuantity != null ? Math.trunc(Number(scope.row.outQuantity)) : 0 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="180" label="入库子单id" align="center" prop="stockinDetailId" />
|
||||
<el-table-column width="180" label="入库主单" align="center" prop="stockinId" />
|
||||
<el-table-column width="180" label="入库类型" align="center" prop="inType" >
|
||||
@@ -102,7 +110,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column width="180" label="合同号" align="center" prop="orderId" />
|
||||
<!-- <el-table-column width="180" label="合同号" align="center" prop="orderId" /> -->
|
||||
<!-- <el-table-column width="180" label="集合数据" align="center" prop="Rows" />-->
|
||||
<!-- <el-table-column width="180" label="入库主题" align="center" prop="Title" />-->
|
||||
<el-table-column width="180" label="首次入库时间" align="center" prop="inDate" />
|
||||
@@ -170,7 +178,7 @@
|
||||
<dict-tag :options="dict.type.cargo_space_lock_status" :value="scope.row.locked"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="180" label="产品分类" align="center" prop="parentId" />
|
||||
<!-- <el-table-column width="180" label="产品分类" align="center" prop="parentId" />
|
||||
<el-table-column width="180" label="价格" align="center" prop="price" />
|
||||
<el-table-column width="180" label="产品编码" align="center" prop="cargoNo" />
|
||||
<el-table-column width="180" label="单位" align="center" prop="unit" />
|
||||
@@ -178,7 +186,7 @@
|
||||
<el-table-column width="180" label="单位名称" align="center" prop="spare1" />
|
||||
<el-table-column width="180" label="url " align="center" prop="spare3" />
|
||||
<el-table-column width="180" label="btnurl" align="center" prop="spare4" />
|
||||
<el-table-column width="180" label="unitjb" align="center" prop="spare7" />
|
||||
<el-table-column width="180" label="unitjb" align="center" prop="spare7" /> -->
|
||||
<el-table-column width="180" label="备注" align="center" prop="remark" />
|
||||
|
||||
</el-table>
|
||||
|
||||
@@ -67,6 +67,17 @@
|
||||
v-hasPermi="['stock:management:remove']"
|
||||
>删除 <!-- 删除 --></el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-lock"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleFreeze"
|
||||
v-hasPermi="['stock:management:edit']"
|
||||
>冻结/解冻</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
@@ -92,7 +103,11 @@
|
||||
<el-table-column label="托盘" align="center" prop="trayCode"/>
|
||||
<el-table-column label="物料编码" align="center" prop="productId"/>
|
||||
<el-table-column label="物料名称" align="center" prop="productName" width="160" />
|
||||
<el-table-column label="库存数量" align="center" prop="quantity" width="160" />
|
||||
<el-table-column label="库存数量" align="center" width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.quantity != null ? Math.trunc(Number(scope.row.quantity)) : 0 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库时间" align="center" prop="inDate" width="160" />
|
||||
|
||||
</el-table>
|
||||
@@ -144,7 +159,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="库存状态" prop="stockStatus"> <!-- 库存状态 -->
|
||||
<el-select v-model="form.stockStatus" placeholder="请选择库存状态">
|
||||
<el-select v-model="form.stockStatus" placeholder="请选择库存状态" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="dict in dict.type.stock_status"
|
||||
:key="dict.value"
|
||||
@@ -155,7 +170,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="库存数量" prop="quantity"> <!-- 库存数量 -->
|
||||
<el-input v-model="form.quantity" placeholder="请输入库存数量" />
|
||||
<el-input v-model.number="form.quantity" @blur="form.quantity = Math.trunc(form.quantity || 0)" placeholder="请输入库存数量" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
@@ -291,7 +306,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addManagement, delManagement, getManagement, stockManagementList, updateManagement} from "@/api/stock/management"
|
||||
import {addManagement, delManagement, getManagement, stockManagementList, updateManagement, freezeStock} from "@/api/stock/management"
|
||||
import {listWarehouse} from "@/api/bas/warehouse"
|
||||
import {listBasProduct} from "@/api/bas/BasProduct"
|
||||
import {listCargoSpace} from "@/api/bas/cargoSpace"
|
||||
@@ -360,7 +375,7 @@ export default {
|
||||
pdProductName: null,
|
||||
pdBatchNo: null,
|
||||
pdSerialNo: null,
|
||||
cargoSpaceStockStatus:2,
|
||||
cargoSpaceStockStatus: null,
|
||||
productId:null,
|
||||
productName:null
|
||||
},
|
||||
@@ -578,6 +593,16 @@ export default {
|
||||
this.$modal.msgSuccess("删除成功") // 删除成功
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 冻结/解冻按钮操作 */
|
||||
handleFreeze(row) {
|
||||
const stockIds = row.stockId ? [row.stockId] : this.ids;
|
||||
this.$modal.confirm('是否确认冻结/解冻选中的库存货位?').then(function() {
|
||||
return freezeStock(stockIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('stock/management/export', {
|
||||
|
||||
Reference in New Issue
Block a user