Browse Source

[feat]品质管理:

品质单
新增品质单详情页面
新增品质单详情接口
dev
liuxiaoxu 6 months ago
parent
commit
9f96f56558
  1. 30
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java
  2. 10
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html
  3. 243
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQualityDetail.html

30
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java

@ -144,8 +144,36 @@ public class QualityOrderController extends BaseController
return toAjax(qualityOrderService.updateQualityOrder(qualityOrder)); return toAjax(qualityOrderService.updateQualityOrder(qualityOrder));
} }
/**
* 品质单列表详情接口
*/
@GetMapping("/startingQualityDetail/{qualityOrderId}")
public String startingQualityDetail(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap)
{
QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId);
mmap.put("qualityOrder", qualityOrder);
return prefix + "/startingQualityDetail";
}
/**
* 修改保存品质单开始品质详情
*/
@RequiresPermissions("quality:qualityOrder:startingQualityDetail")
@Log(title = "品质管理品质单", businessType = BusinessType.UPDATE)
@PostMapping("/startingQualityDetail")
@ResponseBody
public AjaxResult startingQualityDetailSave(QualityOrder qualityOrder)
{
return toAjax(qualityOrderService.updateQualityOrder(qualityOrder));
}
/** /**
* 品质单详情列表 * 开始品质显示品质单详情列表
*/ */
@ResponseBody @ResponseBody
@RequestMapping("/detailListGroupedBySupplier") @RequestMapping("/detailListGroupedBySupplier")

10
ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html

@ -60,7 +60,7 @@
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<script th:inline="javascript"> <script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('quality:qualityOrder:edit')}]]; var detailFlag = [[${@permission.hasPermi('quality:qualityOrder:detail')}]];
var qualityFlag = [[${@permission.hasPermi('quality:qualityOrder:startingQuality')}]]; var qualityFlag = [[${@permission.hasPermi('quality:qualityOrder:startingQuality')}]];
var qualityStatusDatas = [[${@dict.getType('qualityStatus')}]]; var qualityStatusDatas = [[${@dict.getType('qualityStatus')}]];
var qualityOrderTypeDatas = [[${@dict.getType('quality_order_type')}]]; var qualityOrderTypeDatas = [[${@dict.getType('quality_order_type')}]];
@ -160,7 +160,7 @@
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.qualityOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.qualityOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
actions.push('<a class="btn btn-success btn-xs ' + qualityFlag + '" href="javascript:void(0)" onclick="startingQuality(\'' + row.qualityOrderId + '\')"><i class="fa fa-edit"></i>品质</a> '); actions.push('<a class="btn btn-success btn-xs ' + qualityFlag + '" href="javascript:void(0)" onclick="startingQuality(\'' + row.qualityOrderId + '\')"><i class="fa fa-edit"></i>品质</a> ');
return actions.join(''); return actions.join('');
} }
@ -174,6 +174,12 @@
var url = ctx +'quality/qualityOrder/startingQuality/' + qualityOrderId; var url = ctx +'quality/qualityOrder/startingQuality/' + qualityOrderId;
$.modal.open("进行品质",url) $.modal.open("进行品质",url)
} }
//详情
function detail(qualityOrderId){
var url = ctx +'quality/qualityOrder/startingQualityDetail/' + qualityOrderId;
$.modal.open("品质单详情",url)
}
</script> </script>
</body> </body>
</html> </html>

243
ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQualityDetail.html

@ -0,0 +1,243 @@
<!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-qualityOrder-edit" th:object="${qualityOrder}">
<input name="qualityOrderId" th:field="*{qualityOrderId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">品质单号:</label>
<div class="col-sm-8">
<input name="qualityOrderCode" th:field="*{qualityOrderCode}" 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="inStorageCode" th:field="*{inStorageCode}" 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="qualityOrderType" class="form-control m-b" th:with="type=${@dict.getType('quality_order_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{qualityOrderType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品质单入库类型:</label>
<div class="col-sm-8">
<select name="qualityStorageStatus" class="form-control m-b" th:with="type=${@dict.getType('quality_storage_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{qualityStorageStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交付质检时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryInspectionTime" th:value="${#dates.format(qualityOrder.deliveryInspectionTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库Id:</label>
<div class="col-sm-8">
<input name="warehouseCode" th:field="*{warehouseCode}" 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="warehouseName" th:field="*{warehouseName}" class="form-control" type="text">
</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 qualityOrderCode = [[${qualityOrder.qualityOrderCode}]]
var prefix = ctx + "quality/qualityOrder";
$("#form-qualityOrder-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/startingQuality", $('#form-qualityOrder-edit').serialize());
}
}
$("input[name='deliveryInspectionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function() {
// 假设qualityOrderCode已经定义或者可以通过某种方式获取到
var qualityOrderCode = [[${qualityOrder.qualityOrderCode}]]; // 这里需要实际赋值,比如从前端某个地方读取
$.getJSON(prefix + "/detailListGroupedBySupplier?qualityOrderCode=" + qualityOrderCode, 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: 'qualityQualifiedNum',
},
{
title: '品质不合格数',
field: 'qualityUnqualifiedNum',
}]
});
$tableWrapper.append($header).append($table);
$('#tablesContainer').append($tableWrapper);
}
/*品质报告*/
// function qualityReport(materialNo, supplierCode){
// var url = ctx + 'quality/qualityOrder/qualityReport/' + materialNo + '?supplierCode=' + encodeURIComponent(supplierCode);
// $.modal.open("品质报告", url);
// }
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…
Cancel
Save