From 2eba2fec89c9602f3dec3d04e7924f8c91f90e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=80=A1=E8=93=89?= <377046077@qq.com> Date: Thu, 23 Oct 2025 10:00:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/MydoJobServiceImpl.java | 12 +- .../out/outStockout/domain/OutStockout.java | 10 ++ .../mapper/out/OutStockoutDetailMapper.xml | 4 +- .../mapper/out/OutStockoutFinishMapper.xml | 2 +- .../mapper/out/OutStockoutMapper.xml | 14 +- .../resources/mapper/stock/BasStockMapper.xml | 3 +- ruoyi-ui/src/views/out/outStockoutManage.vue | 157 ++++++++++++------ 7 files changed, 140 insertions(+), 62 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/job/mydojob/service/impl/MydoJobServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/job/mydojob/service/impl/MydoJobServiceImpl.java index 56ff6d9..cf1243b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/job/mydojob/service/impl/MydoJobServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/job/mydojob/service/impl/MydoJobServiceImpl.java @@ -466,12 +466,12 @@ public class MydoJobServiceImpl implements IMydoJobService { updateMydoJob(job); insertHistory(jobId); //通知wcs - AjaxResult ajaxResult = iToWcsService.cancelTaskByTaskNo(job.getTaskNo()); - if (ajaxResult.isSuccess()){ - return AjaxResult.success(); - }else { - throw new RuntimeException(Convert.toStr(ajaxResult.get("msg"))); - } +// AjaxResult ajaxResult = iToWcsService.cancelTaskByTaskNo(job.getTaskNo()); +// if (ajaxResult.isSuccess()){ +// return AjaxResult.success(); +// }else { +// throw new RuntimeException(Convert.toStr(ajaxResult.get("msg"))); +// } } } catch (Exception e) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/out/outStockout/domain/OutStockout.java b/ruoyi-admin/src/main/java/com/ruoyi/out/outStockout/domain/OutStockout.java index ae20d80..0ed3d38 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/out/outStockout/domain/OutStockout.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/out/outStockout/domain/OutStockout.java @@ -90,11 +90,21 @@ public class OutStockout extends BaseEntity private String productId; private String productName; + private String supplierName; private String remark; private List typeData; + + public String getSupplierName() { + return supplierName; + } + + public void setSupplierName(String supplierName) { + this.supplierName = supplierName; + } + public List getTypeData() { return typeData; } diff --git a/ruoyi-admin/src/main/resources/mapper/out/OutStockoutDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/out/OutStockoutDetailMapper.xml index 2d02ed0..0c19442 100644 --- a/ruoyi-admin/src/main/resources/mapper/out/OutStockoutDetailMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/out/OutStockoutDetailMapper.xml @@ -127,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" lot_no, product_guid, product_id, - product_name, + quantity, quantity_x, quantity_j, @@ -169,7 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{lotNo}, #{productGuid}, #{productId}, - #{productName}, + #{quantity}, #{quantityX}, #{quantityJ}, diff --git a/ruoyi-admin/src/main/resources/mapper/out/OutStockoutFinishMapper.xml b/ruoyi-admin/src/main/resources/mapper/out/OutStockoutFinishMapper.xml index 8a874bd..a9ac8c4 100644 --- a/ruoyi-admin/src/main/resources/mapper/out/OutStockoutFinishMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/out/OutStockoutFinishMapper.xml @@ -141,7 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select distinct o.stockout_guid, o.stockout_id, o.out_type, o.create_date, o.department_no, o.customer_no, o.create_man_id, o.status, o.stockout_source, - o.warehouse_id, o.class_now_id, o.exit_id, o.car_number, o.FID, o.erp_stockout_id,o.start_date,o.finish_date,bw.warehouse_name,bc.customer_name,o.remark from out_stockout o - left join bas_warehouse bw on bw.warehouse_id = o.warehouse_id - left join bas_customer bc on bc.customer_no = o.customer_no + o.class_now_id, o.exit_id, o.car_number, o.FID, o.erp_stockout_id,o.start_date,o.finish_date,o.remark from out_stockout o left join out_stockout_detail d on d.stockout_id = o.stockout_id + left join bas_customer bc on bc.customer_no = d.out_id + left join bas_warehouse bw on bw.warehouse_id = d.warehouse_id + left join bas_supplier bs on bs.supplier_no = d.supplier_id + left join bas_product bp on bp.product_id = d.product_id and o.stockout_guid = #{stockoutGuid} @@ -49,15 +52,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and o.create_man_id = #{createManId} and o.status = #{status} and o.stockout_source = #{stockoutSource} - and o.warehouse_id = #{warehouseId} + and d.warehouse_id = #{warehouseId} and o.class_now_id = #{classNowId} and o.exit_id = #{exitId} and o.car_number = #{carNumber} and o.FID = #{FID} and o.erp_stockout_id = #{erpStockoutId} and d.product_id = #{productId} - and d.product_name like concat('%', #{productName}, '%') + and bp.product_name like concat('%', #{productName}, '%') and bc.customer_name like concat('%', #{customerName}, '%') + and bs.supplier_name like concat('%', #{supplierName}, '%') and o.remark like concat('%', #{remark}, '%') order by o.create_date desc diff --git a/ruoyi-admin/src/main/resources/mapper/stock/BasStockMapper.xml b/ruoyi-admin/src/main/resources/mapper/stock/BasStockMapper.xml index 1152471..68bb4d3 100644 --- a/ruoyi-admin/src/main/resources/mapper/stock/BasStockMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/stock/BasStockMapper.xml @@ -89,7 +89,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bp.remark, --备注 bs.stock_id, --库存编码 bs.stock_status, --库存状态 - bs.lot_no --批次号 + bs.lot_no, --批次号 + bs.out_quantity from bas_stock bs left join bas_product bp on bs.product_id = bp.product_id left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id diff --git a/ruoyi-ui/src/views/out/outStockoutManage.vue b/ruoyi-ui/src/views/out/outStockoutManage.vue index c8b2b90..af891ce 100644 --- a/ruoyi-ui/src/views/out/outStockoutManage.vue +++ b/ruoyi-ui/src/views/out/outStockoutManage.vue @@ -46,6 +46,24 @@ @keyup.enter.native="handleQuery" /> + + + + + + + + - - - + + + + + + + + 搜索 @@ -313,26 +331,48 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -419,6 +459,8 @@ export default { outType: null, customerNo: null, customerName: null, + supplierName: null, + warehouseId: null, productName: null, startDate: null, finishDate: null, @@ -459,10 +501,10 @@ export default { return total + (parseFloat(stock.quantity) || 0) }, 0) }, - // 计算剩余可分配数量 + // 计算剩余可分配数量(显示不为负) remainingQuantity() { const planQuantity = this.selectedDetailRows.length > 0 ? (parseFloat(this.selectedDetailRows[0].quantity) || 0) : 0 - return planQuantity - this.selectedStockQuantity + return Math.max(planQuantity - this.selectedStockQuantity, 0) } }, created() { @@ -691,6 +733,19 @@ export default { getStockList() { this.stockLoading = true this.stockQueryParams.productId = this.selectedDetailRows[0].productId + this.stockQueryParams.lotNo=this.selectedDetailRows[0].lotNo + this.stockQueryParams.spare1 = this.selectedDetailRows[0].unit + this.stockQueryParams.spare3 = this.selectedDetailRows[0].entryid + this.stockQueryParams.spare4=this.selectedDetailRows[0].model + this.stockQueryParams.spare5 = this.selectedDetailRows[0].power + this.stockQueryParams.spare6 = this.selectedDetailRows[0].price + this.stockQueryParams.voltage = this.selectedDetailRows[0].spec + this.stockQueryParams.power = this.selectedDetailRows[0].phase + this.stockQueryParams.phase = this.selectedDetailRows[0].supplierId + this.stockQueryParams.distribution=this.selectedDetailRows[0].fid + this.stockQueryParams.orderId = this.selectedDetailRows[0].cargoNo + this.stockQueryParams.spare8=this.selectedDetailRows[0].voltage + listOut(this.stockQueryParams).then(response => { this.stockList = response.rows this.stockTotal = response.total @@ -723,31 +778,39 @@ export default { /** 库存多选框选中数据 */ handleStockSelectionChange(selection) { // 计算新选中的总数量 - const newTotalQuantity = selection.reduce((total, stock) => { - return total + (parseFloat(stock.quantity) || 0) - }, 0) - - // 获取计划数量 - const planQuantity = this.selectedDetailRows.length > 0 ? (parseFloat(this.selectedDetailRows[0].quantity) || 0) : 0 - - // 校验是否超过计划数量 - if (newTotalQuantity > planQuantity) { - this.$modal.msgWarning(`选中库存数量(${newTotalQuantity})不能大于计划数量(${planQuantity})`) - // // 恢复到之前的选择状态 - // this.$nextTick(() => { - // // 通过表格引用来恢复选择状态 - // if (this.$refs.stockTable) { - // this.$refs.stockTable.clearSelection() - // this.selectedStockRows.forEach(row => { - // this.$refs.stockTable.toggleRowSelection(row, true) - // }) - // } - // }) - // return - } + // const newTotalQuantity = selection.reduce((total, stock) => { + // return total + (parseFloat(stock.quantity) || 0) + // }, 0) + // + // // 获取计划数量 + // const planQuantity = this.selectedDetailRows.length > 0 ? (parseFloat(this.selectedDetailRows[0].quantity) || 0) : 0 + // + // // 校验是否超过计划数量 + // if (newTotalQuantity > planQuantity) { + // this.$modal.msgWarning(`选中库存数量(${newTotalQuantity})不能大于计划数量(${planQuantity})`) + // // // 恢复到之前的选择状态 + // // this.$nextTick(() => { + // // // 通过表格引用来恢复选择状态 + // // if (this.$refs.stockTable) { + // // this.$refs.stockTable.clearSelection() + // // this.selectedStockRows.forEach(row => { + // // this.$refs.stockTable.toggleRowSelection(row, true) + // // }) + // // } + // // }) + // // return + // } this.selectedStockRows = selection }, + // 判断某库存行是否已选中 + isStockRowSelected(row) { + return this.selectedStockRows && this.selectedStockRows.some(r => r.stockId === row.stockId); + }, + // 选择列可选性:剩余可分配<=0时只允许操作已选中的行,禁用新增选择 + stockSelectable(row, index) { + return this.isStockRowSelected(row) || this.remainingQuantity > 0; + }, /** 确认分配 */ confirmStockAllot() {