Browse Source
退换货 修改添加品质报告不合格分类的插入接口,不合格分类新增的时候详情中不需要新增 退换货详情新增供应商相关字段 退换货新增入库类型字段 退换货新增入库前退货详情页面returnBeforeStorageDetail.html 退换货新增入库前退货按钮和对应后端接口dev
liuxiaoxu
6 months ago
12 changed files with 405 additions and 11 deletions
@ -0,0 +1,195 @@ |
|||||
|
<!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"> |
||||
|
</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"> |
||||
|
</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')}"> |
||||
|
<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', |
||||
|
editable:{ |
||||
|
type:'text' |
||||
|
}, |
||||
|
required:true |
||||
|
}, |
||||
|
{ |
||||
|
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> |
Loading…
Reference in new issue