Browse Source
售后维护设备出库前端页面:新增确认验收按钮和其对应的方法 新增 收货确认验收前端页面。实现现如果有多个销售单号就显示多个,下面的物料分为成品和其他类型,成品的物料分开展示,设置本次出货数为1,每个设备只能签收一次,如果已收货数等于已验收数,则显示已验收,不可编辑;其他物料不必分开展示,但是也要如果已收货数等于已验收数,则显示已验收,不可编辑;如果已收货数为0的数据,显示不可验收 新增 售后确认验收Vo类 售后维护设备出库Controller,新增确认验收后端接口;新增 修改保存确认验收后端接口;新增 确认验收 物料信息详情后端接口 售后维护设备出库iml层: 售后确认验收方法实现:先设置 没有出货设备Id的是否全部验收为0,有出货设备Id的是否全部验收为0;先遍历前端传入的每个数据,如果已经验收数等于已经出货数。 根据已收货数来决定填写本次验收数;并且首先要 过滤掉每个已收货数为0的数据,因为其不可验收;还要过滤掉已收货数等于已验收数的数据,因为其已验收;还要判断已经过滤完的数据是否全部填写本次验收数;然后分别处理有出货设备id的数据和没有出货设备id的数据。分别进行判断如果本次出货数等于已验收数,就设置全部验收。如果有出货设备id的数据和没有出货设备id的数据都全部验收,则设置出货通知单全部验收,否则是部分验收 售后确认验收详情方法实现:把带出货设备id的成品出货设备进行拆分展示,根据设备的状态设置已验收数和已收货数 出货设备实体类新增 isConfirmCheckFlag字段,并且mapper.xml层的所有方法加上 isConfirmCheckFlag字段, 去掉销售出货通知旧版客户验收按钮和方法 销售出货通知iml层新增 根据出库单号查询销售出货通知单方法;修改保存确认收货方法:实现 过滤掉每个已收货数等于本次出货数的数据;对有出货设备id的数据和没有出货设备id的数据都进行判空操作dev
liuxiaoxu
2 weeks ago
12 changed files with 787 additions and 31 deletions
@ -0,0 +1,19 @@ |
|||
package com.ruoyi.aftersales.domain.vo; |
|||
|
|||
import com.ruoyi.system.domain.SysSalesShippingInformDetail; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 收货确认验收Vo类 |
|||
* */ |
|||
@Data |
|||
public class ConfirmCheckDetailVo extends SysSalesShippingInformDetail { |
|||
|
|||
|
|||
/** 出货设备id */ |
|||
private String shippingDeviceId; |
|||
|
|||
/** SN号 */ |
|||
private String snCode; |
|||
|
|||
} |
@ -0,0 +1,306 @@ |
|||
<!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> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-aftersalesConfirmCheck-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 + "aftersales/aftersalesOutOrder"; |
|||
$("#form-aftersalesConfirmCheck-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
// 新增提交 |
|||
function submitHandler() { |
|||
// 获取表单数据 |
|||
const sysSalesShippingInformData = $("#form-aftersalesConfirmCheck-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, |
|||
"hasReceivingNum": item.hasReceivingNum, |
|||
"hasCheckNum": item.hasCheckNum, |
|||
"thisCheckNum": item.thisCheckNum, |
|||
// ...其他字段 |
|||
}; |
|||
}); |
|||
|
|||
const combinedData = Object.assign({}, sysSalesShippingInformData, { |
|||
shippingInformDetailList: materialDataList |
|||
}); |
|||
// 合并表单数据和表格数据 |
|||
console.log(combinedData) |
|||
// 使用 JSON.stringify() 序列化数据 |
|||
const jsonData = JSON.stringify(combinedData); |
|||
// 发送 AJAX 请求到后端接口 |
|||
$.operate.saveJson(prefix + "/aftersalesConfirmCheck", jsonData); |
|||
} |
|||
|
|||
|
|||
//物料信息展示列表 |
|||
$(function() { |
|||
var options = { |
|||
modalName: "选择物料", |
|||
url: prefix + "/aftersalesConfirmCheckDetailList", |
|||
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: 'hasCheckNum', |
|||
}, |
|||
|
|||
{ |
|||
title: '本次验收数', |
|||
field: 'thisCheckNum', |
|||
editable: { |
|||
//动态禁用行内编辑 |
|||
noEditFormatter: function(value, row, index){ |
|||
if (row.hasReceivingNum === row.hasCheckNum && row.hasCheckNum !== 0){ |
|||
return "已验收"; |
|||
|
|||
}else if (row.hasReceivingNum === 0){ |
|||
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 ""; |
|||
} |
|||
|
|||
// 检查 thisCheckNum 是否存在 |
|||
if (row.thisCheckNum === undefined || row.thisCheckNum === null) { |
|||
return ""; |
|||
} |
|||
|
|||
// 根据 thisCheckNum 的值决定返回值 |
|||
if (row.thisCheckNum) { |
|||
return row.thisCheckNum; |
|||
} else { |
|||
return value; |
|||
} |
|||
} |
|||
}, |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}) |
|||
|
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
outOrderCode: sysSalesShippingInform.outOrderCode |
|||
}; |
|||
return curParams; |
|||
} |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue