fix:出库bug处理,产品库存页面增加权限限制

dev_1.0.2
jiangpeng 2026-07-30 16:30:55 +08:00
parent 2c6547f5ec
commit 0106da0c29
6 changed files with 18 additions and 13 deletions

View File

@ -53,14 +53,14 @@
<el-table-column label="产品名称" align="center" prop="productName" show-overflow-tooltip /> <el-table-column label="产品名称" align="center" prop="productName" show-overflow-tooltip />
<el-table-column label="在库现存" align="center" prop="inventoryNum"> <el-table-column label="在库现存" align="center" prop="inventoryNum">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link v-if="scope.row.inventoryNum" class="inventory-num inventory-num--stock" :underline="false" @click="handleInventoryInner(scope.row)">{{ scope.row.inventoryNum }}</el-link> <el-link v-if="scope.row.inventoryNum && checkPermi(['inventory:info:button'])" class="inventory-num inventory-num--stock" :underline="false" @click="handleInventoryInner(scope.row)">{{ scope.row.inventoryNum }}</el-link>
<span v-else class="inventory-num inventory-num--empty">0</span> <span v-else :class="['inventory-num', scope.row.inventoryNum ? 'inventory-num--stock' : 'inventory-num--empty']">{{ scope.row.inventoryNum || 0 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="在途库存" align="center" prop="purchaseNum"> <el-table-column label="在途库存" align="center" prop="purchaseNum">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link v-if="scope.row.purchaseNum" class="inventory-num inventory-num--bind" :underline="false" @click="handlePurchaseStock(scope.row)">{{ scope.row.purchaseNum }}</el-link> <el-link v-if="scope.row.purchaseNum && checkPermi(['inventory:info:button'])" class="inventory-num inventory-num--bind" :underline="false" @click="handlePurchaseStock(scope.row)">{{ scope.row.purchaseNum }}</el-link>
<span v-else class="inventory-num inventory-num--empty">0</span> <span v-else :class="['inventory-num', scope.row.purchaseNum ? 'inventory-num--bind' : 'inventory-num--empty']">{{ scope.row.purchaseNum || 0 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="可用量" align="center" prop="usableNum"> <el-table-column label="可用量" align="center" prop="usableNum">
@ -70,8 +70,8 @@
</el-table-column> </el-table-column>
<el-table-column label="锁单量" align="center" prop="bindNum"> <el-table-column label="锁单量" align="center" prop="bindNum">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link v-if="scope.row.bindNum" class="inventory-num inventory-num--purchase" :underline="false" @click="handleBindOrder(scope.row)">{{ scope.row.bindNum }}</el-link> <el-link v-if="scope.row.bindNum && checkPermi(['inventory:info:button'])" class="inventory-num inventory-num--purchase" :underline="false" @click="handleBindOrder(scope.row)">{{ scope.row.bindNum }}</el-link>
<span v-else class="inventory-num inventory-num--empty">0</span> <span v-else :class="['inventory-num', scope.row.bindNum ? 'inventory-num--purchase' : 'inventory-num--empty']">{{ scope.row.bindNum || 0 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="累计发货" align="center" prop="outerNum"> <el-table-column label="累计发货" align="center" prop="outerNum">
@ -82,9 +82,11 @@
<el-table-column label="制造商" align="center" prop="vendorName" show-overflow-tooltip/> <el-table-column label="制造商" align="center" prop="vendorName" show-overflow-tooltip/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="checkPermi(['inventory:info:button'])">
<el-button size="mini" type="text" icon="el-icon-download" @click="handleInnerLog(scope.row)"></el-button> <el-button size="mini" type="text" icon="el-icon-download" @click="handleInnerLog(scope.row)"></el-button>
<el-button size="mini" type="text" icon="el-icon-upload2" @click="handleOuterLog(scope.row)"></el-button> <el-button size="mini" type="text" icon="el-icon-upload2" @click="handleOuterLog(scope.row)"></el-button>
</template> </template>
</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -344,6 +346,7 @@
<script> <script>
import { listInfo, getInfo, addInfo, updateInfo, delInfo, listAllVendors, listAllWarehouses, getPurchaseStock, getBindOrder, getInventoryInner } from "@/api/inventory/info"; import { listInfo, getInfo, addInfo, updateInfo, delInfo, listAllVendors, listAllWarehouses, getPurchaseStock, getBindOrder, getInventoryInner } from "@/api/inventory/info";
import { checkPermi } from "@/utils/permission";
import { getInner } from "@/api/inventory/inner"; import { getInner } from "@/api/inventory/inner";
import InnerLog from './innerLog'; import InnerLog from './innerLog';
import OuterLog from './outerLog'; import OuterLog from './outerLog';
@ -462,6 +465,7 @@ export default {
this.getOptions(); this.getOptions();
}, },
methods: { methods: {
checkPermi,
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;

View File

@ -150,7 +150,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单位"> <el-table-column label="单位">
<span></span> <span></span>
</el-table-column> </el-table-column>
<el-table-column label="单价"> <el-table-column label="单价">
<template slot-scope="scope"> <template slot-scope="scope">

View File

@ -148,7 +148,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="单位"> <el-table-column label="单位">
<span></span> <span></span>
</el-table-column> </el-table-column>
<el-table-column label="单价"> <el-table-column label="单价">
<template slot-scope="scope"> <template slot-scope="scope">

View File

@ -88,7 +88,7 @@ public interface InventoryInfoMapper
int updateOrderCodeByProductSnList(@Param("productSnList") List<String> productSnList, @Param("orderCode") String orderCode); int updateOrderCodeByProductSnList(@Param("productSnList") List<String> productSnList, @Param("orderCode") String orderCode);
int countByOrderCodeAndPurchaseNo(@Param("orderCode") String orderCode, @Param("purchaseNo") String purchaseNo); int countByOrderCodeAndPurchaseNo(@Param("orderCode") String orderCode, @Param("purchaseNo") String purchaseNo, @Param("productCode") String productCode);
void clearOrderCodeByIds(@Param("idList") List<Long> idList); void clearOrderCodeByIds(@Param("idList") List<Long> idList);
} }

View File

@ -135,7 +135,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
throw new ServiceException("当前订单与采购单未建立绑定关系或绑定数量为0"); throw new ServiceException("当前订单与采购单未建立绑定关系或绑定数量为0");
} }
int totalBindNum = purchaseOrderMap.getBindNum(); int totalBindNum = purchaseOrderMap.getBindNum();
int alreadyBindNum = inventoryInfoMapper.countByOrderCodeAndPurchaseNo(inventoryDelivery.getOrderCode(), inventoryDelivery.getPurchaseNo()); int alreadyBindNum = inventoryInfoMapper.countByOrderCodeAndPurchaseNo(inventoryDelivery.getOrderCode(), inventoryDelivery.getPurchaseNo(), inventoryDelivery.getProductCode());
int remainingNum = totalBindNum - alreadyBindNum; int remainingNum = totalBindNum - alreadyBindNum;
if (newSnCount > remainingNum) { if (newSnCount > remainingNum) {
throw new ServiceException(String.format("新增SN码数量(%d)超过剩余可新增数量(%d),总绑定数(%d),已绑定数(%d)", newSnCount, remainingNum, totalBindNum, alreadyBindNum)); throw new ServiceException(String.format("新增SN码数量(%d)超过剩余可新增数量(%d),总绑定数(%d),已绑定数(%d)", newSnCount, remainingNum, totalBindNum, alreadyBindNum));
@ -176,7 +176,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
} }
int totalBindNum = purchaseOrderMap.getBindNum(); int totalBindNum = purchaseOrderMap.getBindNum();
int alreadyBindNum = inventoryInfoMapper.countByOrderCodeAndPurchaseNo(inventoryDelivery.getOrderCode(), purchaseNo); int alreadyBindNum = inventoryInfoMapper.countByOrderCodeAndPurchaseNo(inventoryDelivery.getOrderCode(), purchaseNo, inventoryDelivery.getProductCode());
int remainingNum = totalBindNum - alreadyBindNum; int remainingNum = totalBindNum - alreadyBindNum;
if (newSnCount > remainingNum) { if (newSnCount > remainingNum) {

View File

@ -257,6 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
inner join oms_inventory_inner t2 on t1.inner_code = t2.inner_code inner join oms_inventory_inner t2 on t1.inner_code = t2.inner_code
where t1.order_code = #{orderCode} where t1.order_code = #{orderCode}
and t2.purchase_no = #{purchaseNo} and t2.purchase_no = #{purchaseNo}
and t1.product_code = #{productCode}
</select> </select>
<update id="clearOrderCodeByIds"> <update id="clearOrderCodeByIds">