This commit is contained in:
张怡蓉
2025-10-23 10:00:30 +08:00
parent 937a8da316
commit 2eba2fec89
7 changed files with 140 additions and 62 deletions

View File

@@ -466,12 +466,12 @@ public class MydoJobServiceImpl implements IMydoJobService {
updateMydoJob(job); updateMydoJob(job);
insertHistory(jobId); insertHistory(jobId);
//通知wcs //通知wcs
AjaxResult ajaxResult = iToWcsService.cancelTaskByTaskNo(job.getTaskNo()); // AjaxResult ajaxResult = iToWcsService.cancelTaskByTaskNo(job.getTaskNo());
if (ajaxResult.isSuccess()){ // if (ajaxResult.isSuccess()){
return AjaxResult.success(); // return AjaxResult.success();
}else { // }else {
throw new RuntimeException(Convert.toStr(ajaxResult.get("msg"))); // throw new RuntimeException(Convert.toStr(ajaxResult.get("msg")));
} // }
} }
} catch (Exception e) { } catch (Exception e) {

View File

@@ -90,11 +90,21 @@ public class OutStockout extends BaseEntity
private String productId; private String productId;
private String productName; private String productName;
private String supplierName;
private String remark; private String remark;
private List<String> typeData; private List<String> typeData;
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public List<String> getTypeData() { public List<String> getTypeData() {
return typeData; return typeData;
} }

View File

@@ -127,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lotNo != null">lot_no,</if> <if test="lotNo != null">lot_no,</if>
<if test="productGuid != null">product_guid,</if> <if test="productGuid != null">product_guid,</if>
<if test="productId != null">product_id,</if> <if test="productId != null">product_id,</if>
<if test="productName != null">product_name,</if>
<if test="quantity != null">quantity,</if> <if test="quantity != null">quantity,</if>
<if test="quantityX != null">quantity_x,</if> <if test="quantityX != null">quantity_x,</if>
<if test="quantityJ != null">quantity_j,</if> <if test="quantityJ != null">quantity_j,</if>
@@ -169,7 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lotNo != null">#{lotNo},</if> <if test="lotNo != null">#{lotNo},</if>
<if test="productGuid != null">#{productGuid},</if> <if test="productGuid != null">#{productGuid},</if>
<if test="productId != null">#{productId},</if> <if test="productId != null">#{productId},</if>
<if test="productName != null">#{productName},</if>
<if test="quantity != null">#{quantity},</if> <if test="quantity != null">#{quantity},</if>
<if test="quantityX != null">#{quantityX},</if> <if test="quantityX != null">#{quantityX},</if>
<if test="quantityJ != null">#{quantityJ},</if> <if test="quantityJ != null">#{quantityJ},</if>

View File

@@ -141,7 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectOutStockoutFinishListByOutStockout" parameterType="OutStockout" resultMap="OutStockoutFinishResult"> <select id="selectOutStockoutFinishListByOutStockout" parameterType="OutStockout" resultMap="OutStockoutFinishResult">
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, 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.reamrk from out_stockout_finish o 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_finish o
left join bas_warehouse bw on bw.warehouse_id = o.warehouse_id left join bas_warehouse bw on bw.warehouse_id = o.warehouse_id
left join bas_customer bc on bc.customer_no = o.customer_no left join bas_customer bc on bc.customer_no = o.customer_no
left join out_stockout_detail_finish d on d.stockout_id = o.stockout_id left join out_stockout_detail_finish d on d.stockout_id = o.stockout_id

View File

@@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="finishDate" column="finish_date" /> <result property="finishDate" column="finish_date" />
<result property="warehouseName" column="warehouse_name" /> <result property="warehouseName" column="warehouse_name" />
<result property="customerName" column="customer_name" /> <result property="customerName" column="customer_name" />
<result property="supplierName" column="supplier_name" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
</resultMap> </resultMap>
@@ -33,10 +34,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectOutStockoutList" parameterType="OutStockout" resultMap="OutStockoutResult"> <select id="selectOutStockoutList" parameterType="OutStockout" resultMap="OutStockoutResult">
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, 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 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 bas_warehouse bw on bw.warehouse_id = o.warehouse_id
left join bas_customer bc on bc.customer_no = o.customer_no
left join out_stockout_detail d on d.stockout_id = o.stockout_id 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
<where> <where>
<if test="stockoutGuid != null and stockoutGuid != ''"> and o.stockout_guid = #{stockoutGuid}</if> <if test="stockoutGuid != null and stockoutGuid != ''"> and o.stockout_guid = #{stockoutGuid}</if>
@@ -49,15 +52,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createManId != null and createManId != ''"> and o.create_man_id = #{createManId}</if> <if test="createManId != null and createManId != ''"> and o.create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and o.status = #{status}</if> <if test="status != null and status != ''"> and o.status = #{status}</if>
<if test="stockoutSource != null and stockoutSource != ''"> and o.stockout_source = #{stockoutSource}</if> <if test="stockoutSource != null and stockoutSource != ''"> and o.stockout_source = #{stockoutSource}</if>
<if test="warehouseId != null and warehouseId != ''"> and o.warehouse_id = #{warehouseId}</if> <if test="warehouseId != null and warehouseId != ''"> and d.warehouse_id = #{warehouseId}</if>
<if test="classNowId != null and classNowId != ''"> and o.class_now_id = #{classNowId}</if> <if test="classNowId != null and classNowId != ''"> and o.class_now_id = #{classNowId}</if>
<if test="exitId != null and exitId != ''"> and o.exit_id = #{exitId}</if> <if test="exitId != null and exitId != ''"> and o.exit_id = #{exitId}</if>
<if test="carNumber != null and carNumber != ''"> and o.car_number = #{carNumber}</if> <if test="carNumber != null and carNumber != ''"> and o.car_number = #{carNumber}</if>
<if test="FID != null and FID != ''"> and o.FID = #{FID}</if> <if test="FID != null and FID != ''"> and o.FID = #{FID}</if>
<if test="erpStockoutId != null and erpStockoutId != ''"> and o.erp_stockout_id = #{erpStockoutId}</if> <if test="erpStockoutId != null and erpStockoutId != ''"> and o.erp_stockout_id = #{erpStockoutId}</if>
<if test="productId != null and productId != ''"> and d.product_id = #{productId}</if> <if test="productId != null and productId != ''"> and d.product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and d.product_name like concat('%', #{productName}, '%')</if> <if test="productName != null and productName != ''"> and bp.product_name like concat('%', #{productName}, '%')</if>
<if test="customerName != null and customerName != ''"> and bc.customer_name like concat('%', #{customerName}, '%')</if> <if test="customerName != null and customerName != ''"> and bc.customer_name like concat('%', #{customerName}, '%')</if>
<if test="supplierName != null and supplierName != ''"> and bs.supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="remark != null and remark != ''"> and o.remark like concat('%', #{remark}, '%')</if> <if test="remark != null and remark != ''"> and o.remark like concat('%', #{remark}, '%')</if>
</where> </where>
order by o.create_date desc order by o.create_date desc

View File

@@ -89,7 +89,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bp.remark, --备注 bp.remark, --备注
bs.stock_id, --库存编码 bs.stock_id, --库存编码
bs.stock_status, --库存状态 bs.stock_status, --库存状态
bs.lot_no --批次号 bs.lot_no, --批次号
bs.out_quantity
from bas_stock bs from bas_stock bs
left join bas_product bp on bs.product_id = bp.product_id left join bas_product bp on bs.product_id = bp.product_id
left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id

View File

@@ -46,6 +46,24 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="'供应商名称'" prop="supplierName">
<el-input
v-model="queryParams.supplierName"
:placeholder="'请输入供应商名称'"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item :label="'仓库名称'" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" :placeholder="'请选择仓库'">
<el-option
v-for="dict in dict.type.warehouse"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="'创建时间'" prop="dateRange"> <el-form-item :label="'创建时间'" prop="dateRange">
<el-date-picker <el-date-picker
v-model="dateRange" v-model="dateRange"
@@ -296,14 +314,14 @@
@keyup.enter.native="handleStockQuery" @keyup.enter.native="handleStockQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="批次号" prop="lotNo"> <!-- <el-form-item label="批次号" prop="lotNo">-->
<el-input <!-- <el-input-->
v-model="stockQueryParams.lotNo" <!-- v-model="stockQueryParams.lotNo"-->
placeholder="请输入批次号" <!-- placeholder="请输入批次号"-->
clearable <!-- clearable-->
@keyup.enter.native="handleStockQuery" <!-- @keyup.enter.native="handleStockQuery"-->
/> <!-- />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleStockQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleStockQuery">搜索</el-button>
@@ -313,26 +331,48 @@
<!-- 库存明细表格 --> <!-- 库存明细表格 -->
<el-table ref="stockTable" v-loading="stockLoading" :data="stockList" @selection-change="handleStockSelectionChange" max-height="400"> <el-table ref="stockTable" v-loading="stockLoading" :data="stockList" @selection-change="handleStockSelectionChange" max-height="400">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" :selectable="stockSelectable" />
<el-table-column label="库存编码" align="center" prop="stockId" /> <el-table-column label="库存编码" align="center" prop="stockId" />
<el-table-column label="货位名称" align="center" prop="cargoSpaceName" /> <el-table-column label="货位名称" align="center" prop="cargoSpaceName" />
<el-table-column label="批次号" align="center" prop="lotNo" /> <el-table-column label="批次号" align="center" prop="lotNo" />
<el-table-column label="物料编码" align="center" prop="productId" /> <el-table-column label="物料编码" align="center" prop="productId" />
<el-table-column label="物料名称" align="center" prop="productName" /> <el-table-column label="物料名称" align="center" prop="productName" />
<el-table-column label="数量" align="center" prop="quantity" width="80" /> <el-table-column label="规格型号" align="center" prop="netWeight" />
<el-table-column label="规格" align="center" prop="spare1" /> <el-table-column label="图号" align="center" prop="grossWeight" />
<el-table-column label="单位" align="center" prop="spare3" /> <el-table-column label="库存数量" align="center" prop="quantity" width="80" />
<el-table-column label="型号" align="center" prop="spare4" /> <el-table-column label="来源" align="center" prop="spare1" >
<el-table-column label="颜色" align="center" prop="spare5" /> <template slot-scope="scope">
<el-table-column label="序列号" align="center" prop="spare6" /> <dict-tag :options="dict.type.origin_type" :value="scope.row.spare1"/>
<el-table-column label="电压" align="center" prop="voltage" /> </template>
<el-table-column label="功率" align="center" prop="power" />
<el-table-column label="相位" align="center" prop="phase" /> </el-table-column>
<el-table-column label="净重" align="center" prop="netWeight" /> <el-table-column label="套账" align="center" prop="spare3" >
<el-table-column label="毛重" align="center" prop="grossWeight" /> <template slot-scope="scope">
<el-table-column label="分销" align="center" prop="distribution" /> <dict-tag :options="dict.type.account_type" :value="scope.row.spare3"/>
<el-table-column label="机型" align="center" prop="model" /> </template>
<el-table-column label="订单号" align="center" prop="orderId" /> </el-table-column>
<el-table-column label="用途" align="center" prop="spare4" >
<template slot-scope="scope">
<dict-tag :options="dict.type.purpose_type" :value="scope.row.model"/>
</template>
</el-table-column>
<el-table-column label="台次" align="center" prop="spare5" />
<el-table-column label="入库单价" align="center" prop="spare6" />
<el-table-column label="状态" align="center" prop="voltage" >
<template slot-scope="scope">
<dict-tag :options="dict.type.turnover_type" :value="scope.row.voltage"/>
</template>
</el-table-column>
<el-table-column label="件次" align="center" prop="power" />
<!-- <el-table-column label="供应商" align="center" prop="phase" />-->
<el-table-column label="供应商" align="center" prop="inClassId" />
<el-table-column label="管理号" align="center" prop="distribution" />
<el-table-column label="产品质量" align="center" prop="spare8" >
<template slot-scope="scope">
<dict-tag :options="dict.type.quality_type" :value="scope.row.spare8"/>
</template>
</el-table-column>
<el-table-column label="合同号" align="center" prop="orderId" />
</el-table> </el-table>
@@ -419,6 +459,8 @@ export default {
outType: null, outType: null,
customerNo: null, customerNo: null,
customerName: null, customerName: null,
supplierName: null,
warehouseId: null,
productName: null, productName: null,
startDate: null, startDate: null,
finishDate: null, finishDate: null,
@@ -459,10 +501,10 @@ export default {
return total + (parseFloat(stock.quantity) || 0) return total + (parseFloat(stock.quantity) || 0)
}, 0) }, 0)
}, },
// 计算剩余可分配数量 // 计算剩余可分配数量(显示不为负)
remainingQuantity() { remainingQuantity() {
const planQuantity = this.selectedDetailRows.length > 0 ? (parseFloat(this.selectedDetailRows[0].quantity) || 0) : 0 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() { created() {
@@ -691,6 +733,19 @@ export default {
getStockList() { getStockList() {
this.stockLoading = true this.stockLoading = true
this.stockQueryParams.productId = this.selectedDetailRows[0].productId 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 => { listOut(this.stockQueryParams).then(response => {
this.stockList = response.rows this.stockList = response.rows
this.stockTotal = response.total this.stockTotal = response.total
@@ -723,31 +778,39 @@ export default {
/** 库存多选框选中数据 */ /** 库存多选框选中数据 */
handleStockSelectionChange(selection) { handleStockSelectionChange(selection) {
// 计算新选中的总数量 // 计算新选中的总数量
const newTotalQuantity = selection.reduce((total, stock) => { // const newTotalQuantity = selection.reduce((total, stock) => {
return total + (parseFloat(stock.quantity) || 0) // return total + (parseFloat(stock.quantity) || 0)
}, 0) // }, 0)
//
// 获取计划数量 // // 获取计划数量
const planQuantity = this.selectedDetailRows.length > 0 ? (parseFloat(this.selectedDetailRows[0].quantity) || 0) : 0 // const planQuantity = this.selectedDetailRows.length > 0 ? (parseFloat(this.selectedDetailRows[0].quantity) || 0) : 0
//
// 校验是否超过计划数量 // // 校验是否超过计划数量
if (newTotalQuantity > planQuantity) { // if (newTotalQuantity > planQuantity) {
this.$modal.msgWarning(`选中库存数量(${newTotalQuantity})不能大于计划数量(${planQuantity})`) // this.$modal.msgWarning(`选中库存数量(${newTotalQuantity})不能大于计划数量(${planQuantity})`)
// // 恢复到之前的选择状态 // // // 恢复到之前的选择状态
// this.$nextTick(() => { // // this.$nextTick(() => {
// // 通过表格引用来恢复选择状态 // // // 通过表格引用来恢复选择状态
// if (this.$refs.stockTable) { // // if (this.$refs.stockTable) {
// this.$refs.stockTable.clearSelection() // // this.$refs.stockTable.clearSelection()
// this.selectedStockRows.forEach(row => { // // this.selectedStockRows.forEach(row => {
// this.$refs.stockTable.toggleRowSelection(row, true) // // this.$refs.stockTable.toggleRowSelection(row, true)
// }) // // })
// } // // }
// }) // // })
// return // // return
} // }
this.selectedStockRows = selection 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() { confirmStockAllot() {