feat(inventory): 修改库存查询接口为POST请求并优化相关逻辑

- 将库存信息列表接口从GET改为POST请求
- 更新前端调用方式,使用data传递参数
- 优化后端空列表判断逻辑,避免无效查询
- 修复Vue组件中按钮事件参数传递问题
- 调整退回到货状态变更后的回调逻辑
- 更新本地开发环境后端接口地址配置
- 优化MyBatis XML中集合判空条件表达式
master
chenhao 2025-12-16 18:42:34 +08:00
parent 0b1d0f45cc
commit d5b8b0ca68
7 changed files with 14 additions and 9 deletions

View File

@ -74,8 +74,8 @@ export function exportDeliveryDetail(id) {
export function listProductSn(query) { export function listProductSn(query) {
return request({ return request({
url: '/inventory/info/vue/list', url: '/inventory/info/vue/list',
method: 'get', method: 'post',
params: query data: query
}) })
} }

View File

@ -82,7 +82,7 @@
<delivery-detail :delivery-id="deliveryId" :visible.sync="viewOpen" /> <delivery-detail :delivery-id="deliveryId" :visible.sync="viewOpen" />
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button v-if="showReturn" type="danger" @click="handleStatusChange(this.form, '4')">退 </el-button> <el-button v-if="showReturn" type="danger" @click="handleStatusChange(form, '4')">退 </el-button>
<el-button @click="handleCancel"> </el-button> <el-button @click="handleCancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -117,6 +117,7 @@ export default {
getOuter(id).then(response => { getOuter(id).then(response => {
this.visible = true; this.visible = true;
this.form = response.data.inventoryOuter; this.form = response.data.inventoryOuter;
console.log(this.form)
this.productList = response.data.productVoList || []; this.productList = response.data.productVoList || [];
this.deliveryList = response.data.deliveryList || []; this.deliveryList = response.data.deliveryList || [];
this.showReturn=this.deliveryList.length<=0; this.showReturn=this.deliveryList.length<=0;
@ -192,7 +193,8 @@ export default {
return changeOuterStatus(row.id, status, row.orderCode); return changeOuterStatus(row.id, status, row.orderCode);
}).then(() => { }).then(() => {
this.$message.success(`${actionText}成功`); this.$message.success(`${actionText}成功`);
this.getList(); this.visible=false;
this.$emit('returnSuccess');
}).catch(() => {}); }).catch(() => {});
} }
} }

View File

@ -72,7 +72,7 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/> <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
<!-- 新增/编辑弹窗 --> <!-- 新增/编辑弹窗 -->
<outer-form ref="form" @success="getList"></outer-form> <outer-form ref="form" @returnSuccess="getList" @success="getList"></outer-form>
<!-- 详情抽屉 --> <!-- 详情抽屉 -->
<outer-details ref="details"></outer-details> <outer-details ref="details"></outer-details>

View File

@ -9,7 +9,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || 'UNISSENSE-OMS' // 网页标题 const name = process.env.VUE_APP_TITLE || 'UNISSENSE-OMS' // 网页标题
const baseUrl = 'http://localhost:28080' // 后端接口 const baseUrl = 'http://localhost:28081' // 后端接口
const port = process.env.port || process.env.npm_config_port || 80 // 端口 const port = process.env.port || process.env.npm_config_port || 80 // 端口

View File

@ -71,9 +71,9 @@ public class VueInventoryInfoController extends BaseController {
List<ProductInfo> list = productInfoService.listInventory(info); List<ProductInfo> list = productInfoService.listInventory(info);
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(InventoryInfo inventoryInfo) public TableDataInfo list(@RequestBody InventoryInfo inventoryInfo)
{ {
if (!inventoryAuthService.authAll()) { if (!inventoryAuthService.authAll()) {

View File

@ -241,6 +241,9 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
public List<DeliveryInfoVo> getNumberInfo(ApiDataQueryDto dto) { public List<DeliveryInfoVo> getNumberInfo(ApiDataQueryDto dto) {
List<DeliveryInfoVo> resultList = inventoryDeliveryMapper.listSn(dto); List<DeliveryInfoVo> resultList = inventoryDeliveryMapper.listSn(dto);
List<String> orderCodeList = resultList.stream().map(DeliveryInfoVo::getOrderCode).collect(Collectors.toList()); List<String> orderCodeList = resultList.stream().map(DeliveryInfoVo::getOrderCode).collect(Collectors.toList());
if (CollUtil.isEmpty(orderCodeList)){
return Collections.emptyList();
}
// 根据订单ID查询合同信息 // 根据订单ID查询合同信息
List<ProjectProductInfo> projectProductInfos = projectProductInfoService.selectProjectProductInfoListByOrderCode(orderCodeList); List<ProjectProductInfo> projectProductInfos = projectProductInfoService.selectProjectProductInfoListByOrderCode(orderCodeList);

View File

@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</if> </if>
<if test="productSn != null and productSn != ''">and t1.product_sn = #{productSn}</if> <if test="productSn != null and productSn != ''">and t1.product_sn = #{productSn}</if>
<if test="productSnList != null and productSnList != ''">and t1.product_sn in <if test="productSnList != null and productSnList.size>0">and t1.product_sn in
<foreach item="item" index="index" collection="productSnList" separator="," open="(" close=")"> <foreach item="item" index="index" collection="productSnList" separator="," open="(" close=")">
#{item} #{item}
</foreach> </foreach>