Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 6 months ago
parent
commit
4fb7cac952
  1. 23
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java
  2. 191
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeHasConfirmSupplier.html
  3. 17
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html

23
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java

@ -329,4 +329,27 @@ public class QualityRefundsExchangesController extends BaseController
}
/**
* 入库前退换货单-确认供应商-已有退换货
*/
@GetMapping("/beforeHasConfirmSupplier/{refundsExchangesId}")
public String beforeHasConfirmSupplier(@PathVariable("refundsExchangesId") Long refundsExchangesId, ModelMap mmap)
{
QualityRefundsExchanges qualityRefundsExchanges = qualityRefundsExchangesService.selectQualityRefundsExchangesById(refundsExchangesId);
mmap.put("qualityRefundsExchanges", qualityRefundsExchanges);
return prefix + "/beforeHasConfirmSupplier";
}
/**
* 保存入库前退换货单-确认供应商-已有退换货
*/
@RequiresPermissions("quality:refundsExchanges:beforeHasConfirmSupplier")
@Log(title = "品质管理退换货单", businessType = BusinessType.UPDATE)
@PostMapping("/beforeHasConfirmSupplier")
@ResponseBody
public AjaxResult beforeHasConfirmSupplierSave(QualityRefundsExchanges qualityRefundsExchanges)
{
return toAjax(qualityRefundsExchangesService.returnBeforeStorageDetail(qualityRefundsExchanges));
}
}

191
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/beforeHasConfirmSupplier.html

@ -0,0 +1,191 @@
<!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" />
<style>
.supplier-value {
display: flex;
align-items: center;
justify-content: space-between;
}
.supplier-value span {
margin-right: 10px;
}
.info-separator::after {
content: "-";
margin: 0 5px;
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-qualityRefundsExchanges-edit" th:object="${qualityRefundsExchanges}">
<input name="refundsExchangesId" th:field="*{refundsExchangesId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">退换货单号:</label>
<div class="col-sm-8">
<input name="refundsExchangesCode" th:field="*{refundsExchangesCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联单号:</label>
<div class="col-sm-8">
<input name="relatedOrderCode" th:field="*{relatedOrderCode}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品质单入库类型:</label>
<div class="col-sm-8">
<select name="warehouseStorageType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_storage_type')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseStorageType}"></option>
</select>
</div>
</div>
<div class="container">
<!--物料相关-->
<div class="row">
<div class="col-sm-12" id="tablesContainer">
<!-- 表格将在这里动态生成 -->
</div>
</div>
</div>
</form>
</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 refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]]
var prefix = ctx + "quality/refundsExchanges";
$("#form-qualityRefundsExchanges-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/returnBeforeStorageDetail", $('#form-qualityRefundsExchanges-edit').serialize());
}
}
$(function() {
// 假设refundsExchangesCode已经定义或者可以通过某种方式获取到
var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]]; // 这里需要实际赋值,比如从前端某个地方读取
$.getJSON(prefix + "/detailListGroupedBySupplier?refundsExchangesCode=" + refundsExchangesCode, function(data) {
for (var supplierCode in data) {
if (data.hasOwnProperty(supplierCode)) {
var supplierData = data[supplierCode];
createTableForSupplier(supplierCode, supplierData);
}
}
});
});
function createTableForSupplier(supplierCode, supplierData) {
var tableId = 'bootstrap-table-' + supplierCode.replace(/[^a-z0-9]/gi, '_').toLowerCase();
var $tableWrapper = $('<div class="table-responsive mt-3"></div>');
// 确保supplierData至少有一条记录,并从中提取供应商详细信息
var supplierInfo = supplierData.length > 0 ? supplierData[0] : {}; // 默认为空对象,以防数据不存在
// 构建含有额外供应商信息的标题字符串
var headerTitle ='供应商'+'</br>'+supplierCode + ' - ' + (supplierInfo.supplierName || 'N/A') +
' </br> ' + (supplierInfo.customerContact || 'N/A') +
' - ' + (supplierInfo.contactNumber || 'N/A') +
' - ' + (supplierInfo.supplierAddress || 'N/A');
var $header = $('<h4>' + headerTitle + '</h4>');
var $table = $('<table id="' + tableId + '" class="table table-striped table-bordered"></table>');
$table.bootstrapTable({
data: supplierData,
columns: [{
checkbox: true
},
{
title: '供应商ID',
field: 'supplierCode',
visible: false
},
{
title: '料号',
field: 'materialNo'
}, {
title: '物料名称',
field: 'materialName'
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '物料图片地址',
field: 'materialPhotourl',
},
{
title: '物料描述',
field: 'materialDescribe',
},
{
title: '物料品牌',
field: 'materialBrand',
},
{
title: '物料单位',
field: 'materialUnit',
},
{
title: '物料加工方式',
field: 'materialProcessMethod',
},
{
title: '订单数',
field: 'makeTotal',
},
{
title: '品质已合格数',
field: 'qualityHasqualifiedNum',
},
{
title: '本次到货数',
field: 'thisArrivedNum',
},
{
title: '品质报告',
align: 'center',
formatter: function(value, row, index) {
// 这里直接使用row对象获取supplierCode,假设它是存在的
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.supplierCode + '\')"><i class="fa fa-plus"></i>报告</a> ');
return actions.join('');
}
},
{
title: '品质不合格数',
field: 'qualityUnqualifiedNum',
}]
});
$tableWrapper.append($header).append($table);
$('#tablesContainer').append($tableWrapper);
}
/*品质报告*/
function qualityReport(materialNo, supplierCode) {
var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo);
queryParams.append('supplierCode', encodeURIComponent(supplierCode));
var url = ctx + 'quality/qualityOrder/qualityReport?' + queryParams.toString();
$.modal.open("品质报告", url);
}
</script>
</body>
</html>

17
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html

@ -82,7 +82,10 @@
var closingProceduresFlag = [[${@permission.hasPermi('quality:refundsExchanges:closingProcedures')}]];
var returnBeforeStorageDetailFlag = [[${@permission.hasPermi('quality:refundsExchanges:returnBeforeStorageDetail')}]];
var returnAfterStorageDetailFlag = [[${@permission.hasPermi('quality:refundsExchanges:returnAfterStorageDetailFlag')}]];
var returnAfterStorageDetailFlag = [[${@permission.hasPermi('quality:refundsExchanges:returnAfterStorageDetail')}]];
var beforeHasConfirmSupplierFlag = [[${@permission.hasPermi('quality:refundsExchanges:beforeHasConfirmSupplier')}]];
var refundsExchangesStatusDatas = [[${@dict.getType('refunds_exchanges_status')}]];
var qualityWarehouseStatusDatas = [[${@dict.getType('quality_warehouse_status')}]];
@ -198,6 +201,10 @@
if (row.qualityReturnNode == 1){
actions.push('<a class="btn btn-success btn-xs ' + returnAfterStorageDetailFlag + '" href="javascript:void(0)" onclick="returnAfterStorageDetail(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>详情</a> ');
}
/*入库前退换货-确认供应商-已有供应商*/
if (row.qualityReturnNode == 0){
actions.push('<a class="btn btn-success btn-xs ' + beforeHasConfirmSupplierFlag + '" href="javascript:void(0)" onclick="beforeHasConfirmSupplier(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>确认供应商</a> ');
}
return actions.join('');
}
@ -224,6 +231,8 @@
var url = ctx + 'quality/refundsExchanges/closingProcedures/' +refundsExchangesId;
$.modal.open("结案",url);
}
/*添加退货单*/
function add() {
var rows = $("#bootstrap-table").bootstrapTable('getSelections');
console.log("rows" + rows);
@ -244,6 +253,12 @@
};
/*入库前退货-确认供应商-已经-有供应商*/
function beforeHasConfirmSupplier(refundsExchangesId){
var url = ctx + 'quality/refundsExchanges/beforeHasConfirmSupplier/' + refundsExchangesId;
$.modal.open("确认供应商",url);
}
</script>
</body>
</html>
Loading…
Cancel
Save