Browse Source
出货设备数据库表、实体类、mapper.xml层查找、插入和修改操作都加上 isConfirmReceivingFlag字段 销售出货通知前端页面新增 确认收货按钮和其接口方法 新增业务确认收货前端页面,实现如果有多个销售单号就显示多个,下面的物料分为成品和其他类型,成品的物料分开展示,设置本次出货数为1,每个设备只能签收一次,如果已经签收,则显示已出货,不可编辑;其他物料不必分开展示,但是也要实现如果已经签收,则显示已出货,不可编辑; 新增 客户确认收货物料详情Vo类继承销售出货通知详情表,加上shippingDeviceId和 snCode字段 销售出货通知Controller层新增 确认收货后端接口;新增 修改保存确认收货后端接口; iml层新增 展示确认收货物料详情实现:把物料按照成品和其他类型进行展示,成品关联设备表,如果设备的IsConfirmReceivingFlag字段的值为0,就设置已出货数为1,否则设置为0;本次出货数和已出库数都要设置为1;并且最后得到的集合中,没有设备id的成品会被从列表中移除;其他类型的物料正常展示; 新增修改保存收货后端方法:实现,把从前端传入的数据,按照有设备id和没有设备id的数据进行分组,分别处理;没有设备id的,设置已收货前都要查询数据库中已有的数据,没有值,就为本次收货的数据,有值就进行合计,并且已收货数和本次收货数之和不能大于本次出货数;有设备id的,首先要过滤掉已收货数为1的数据,然后判断 本次收货数量只能为0或1。因为是同一个料号要累加本次收货数,最后统一更新已出货数 销售订单后端新增 通过销售订单号集合查询销售订单集合方法dev
liuxiaoxu
2 weeks ago
12 changed files with 654 additions and 7 deletions
@ -0,0 +1,19 @@ |
|||||
|
package com.ruoyi.system.domain.Vo; |
||||
|
|
||||
|
|
||||
|
import com.ruoyi.system.domain.SysSalesShippingInformDetail; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 客户确认收货物料详情Vo类 |
||||
|
* */ |
||||
|
@Data |
||||
|
public class ConfirmReceivingDetailVo extends SysSalesShippingInformDetail { |
||||
|
|
||||
|
|
||||
|
/** 出货设备id */ |
||||
|
private String shippingDeviceId; |
||||
|
|
||||
|
/** SN号 */ |
||||
|
private String snCode; |
||||
|
} |
@ -0,0 +1,301 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
||||
|
<head> |
||||
|
<th:block th:include="include :: header('确认收货')" /> |
||||
|
<th:block th:include="include :: datetimepicker-css" /> |
||||
|
<th:block th:include="include :: bootstrap-editable-css"/> |
||||
|
</head> |
||||
|
<style> |
||||
|
. |
||||
|
</style> |
||||
|
<body class="white-bg"> |
||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-confirmReceiving-edit" th:object="${sysSalesShippingInform}"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">出库单号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">出库类型:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="warehouseOutType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_out_type')}" readonly> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOutType}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div th:each="order : ${sysSalesOrders}" class="col-sm-12" style="margin-left: -35px;"> |
||||
|
<div class="col-sm-6"> |
||||
|
<label class="col-sm-3 control-label">订单类型:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="salesOrderType" class="form-control m-b" readonly> |
||||
|
<option value="0" th:selected="${order.salesOrderType} == '0'">客户订单</option> |
||||
|
<option value="1" th:selected="${order.salesOrderType} == '1'">研发订单</option> |
||||
|
<option value="2" th:selected="${order.salesOrderType} == '2'">其他订单</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-sm-6" > |
||||
|
<label class="col-sm-3 control-label">销售单号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="salesOrderCode" th:value="${order.salesOrderCode}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">客户ID:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="customerId" th:field="*{customerId}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">客户名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="customerName" th:field="*{customerName}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">收货联系人(Ship To):</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="customerContact" th:field="*{customerContact}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">收货电话(Ship To):</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">收货地址(Ship To):</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="customerContactAddress" th:field="*{customerContactAddress}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">收货联系人(Bill To):</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="customerContactBillto" th:field="*{customerContactBillto}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">收货电话(Bill To):</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="contactNumberBillto" th:field="*{contactNumberBillto}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">收货地址(Bill To):</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="contactAddressBillto" th:field="*{contactAddressBillto}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">备注:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="remark" th:field="*{remark}" class="form-control" type="text" readonly> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
</form> |
||||
|
<!--物料信息--> |
||||
|
<div class="container"> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bootstrap-table"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: datetimepicker-js" /> |
||||
|
<!--用于可以修改列表字段的插件--> |
||||
|
<th:block th:include="include :: bootstrap-table-editable-js" /> |
||||
|
<script th:inline="javascript"> |
||||
|
|
||||
|
var sysSalesShippingInform = [[${sysSalesShippingInform}]]; |
||||
|
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
||||
|
|
||||
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
||||
|
var prefix = ctx + "system/salesShippingInform"; |
||||
|
$("#form-confirmReceiving-edit").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
// 新增提交 |
||||
|
function submitHandler() { |
||||
|
// 获取表单数据 |
||||
|
const sysSalesShippingInformData = $("#form-confirmReceiving-edit").serializeArray().reduce((obj, item) => { |
||||
|
obj[item.name] = item.value; |
||||
|
return obj; |
||||
|
}, {}); |
||||
|
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据 |
||||
|
var table = $('#bootstrap-table').bootstrapTable('getData'); |
||||
|
|
||||
|
// 将表数据转换成与complaintNoticeData格式一致的数组 |
||||
|
var materialDataList = table.map(function(item) { |
||||
|
// 根据实际字段名调整 |
||||
|
return { |
||||
|
"shippingInformDetailId": item.shippingInformDetailId, |
||||
|
"materialCode": item.materialCode, |
||||
|
"materialName": item.materialName, |
||||
|
"materialType": item.materialType, |
||||
|
"materialProcessMethod": item.materialProcessMethod, |
||||
|
"materialModel": item.materialModel, |
||||
|
"shippingDeviceId": item.shippingDeviceId, |
||||
|
"snCode": item.snCode, |
||||
|
"thisShippingNum": item.thisShippingNum, |
||||
|
"hasOutOrderNum": item.hasOutOrderNum, |
||||
|
"thisReceivingNum": item.thisReceivingNum, |
||||
|
"hasReceivingNum": item.hasReceivingNum, |
||||
|
// ...其他字段 |
||||
|
}; |
||||
|
}); |
||||
|
|
||||
|
const combinedData = Object.assign({}, sysSalesShippingInformData, { |
||||
|
shippingInformDetailList: materialDataList |
||||
|
}); |
||||
|
// 合并表单数据和表格数据 |
||||
|
console.log(combinedData) |
||||
|
// 使用 JSON.stringify() 序列化数据 |
||||
|
const jsonData = JSON.stringify(combinedData); |
||||
|
// 发送 AJAX 请求到后端接口 |
||||
|
$.operate.saveJson(prefix + "/confirmReceiving", jsonData); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//物料信息展示列表 |
||||
|
$(function() { |
||||
|
var options = { |
||||
|
modalName: "选择物料", |
||||
|
url: prefix + "/confirmReceivingDetailList", |
||||
|
queryParams: queryParams, |
||||
|
showSearch: false, |
||||
|
showRefresh: false, |
||||
|
showToggle: false, |
||||
|
showColumns: false, |
||||
|
pagination: false, // 设置不分页 |
||||
|
columns: [{ |
||||
|
checkbox: true |
||||
|
}, |
||||
|
{ |
||||
|
title: '销售出货通知单详情Id', |
||||
|
field: 'shippingInformDetailId', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
title: '料号', |
||||
|
field: 'materialNo', |
||||
|
}, |
||||
|
{ |
||||
|
title: '物料名称', |
||||
|
field: 'materialName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '物料类型', |
||||
|
field: 'materialType', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectCategoryLabel(materialTypeDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
title: '加工方式', |
||||
|
field: 'materialProcessMethod', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(processMethodDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
title: '型号', |
||||
|
field: 'materialModel', |
||||
|
}, |
||||
|
{ |
||||
|
title: '出货设备ID', |
||||
|
field: 'shippingDeviceId', |
||||
|
}, |
||||
|
{ |
||||
|
title: 'SN码', |
||||
|
field: 'snCode', |
||||
|
}, |
||||
|
{ |
||||
|
title: '本次出货数', |
||||
|
field: 'thisShippingNum', |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
title: '已出库数', |
||||
|
field: 'hasOutOrderNum', |
||||
|
}, |
||||
|
{ |
||||
|
title: '已收货数', |
||||
|
field: 'hasReceivingNum', |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
title: '本次收货数', |
||||
|
field: 'thisReceivingNum', |
||||
|
editable: { |
||||
|
//动态禁用行内编辑 |
||||
|
noEditFormatter: function(value, row, index){ |
||||
|
if (row.hasReceivingNum === row.thisShippingNum){ |
||||
|
return "已出货"; |
||||
|
|
||||
|
}else{ |
||||
|
return false; |
||||
|
} |
||||
|
}, |
||||
|
validate: function(value) { |
||||
|
if ($.trim(value) === '') { |
||||
|
return '本次收货数不能为空'; |
||||
|
} |
||||
|
if (isNaN(value)) { |
||||
|
return '请输入有效的数字'; |
||||
|
} |
||||
|
if (value < 0) { |
||||
|
return '本次收货数不能小于0'; |
||||
|
} |
||||
|
//不能为小数 |
||||
|
if (value % 1 !== 0) { |
||||
|
return '本次收货数不能为小数'; |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
formatter: function (value, row) { |
||||
|
// 检查 row 是否存在 |
||||
|
if (!row) { |
||||
|
return ""; |
||||
|
} |
||||
|
|
||||
|
// 检查 thisReceivingNum 是否存在 |
||||
|
if (row.thisReceivingNum === undefined || row.thisReceivingNum === null) { |
||||
|
return ""; |
||||
|
} |
||||
|
|
||||
|
// 根据 thisReceivingNum 的值决定返回值 |
||||
|
if (row.thisReceivingNum) { |
||||
|
return row.thisReceivingNum; |
||||
|
} else { |
||||
|
return value; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
}) |
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
outOrderCode: sysSalesShippingInform.outOrderCode |
||||
|
}; |
||||
|
return curParams; |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
Loading…
Reference in new issue