Browse Source

[fix] 品质管理

新增委内加工入库品质单品质详情页面。
新增品质单详情通用保存后端接口方法。
新增委内加工入库品质单品质按钮。
新增 委内加工入库品质单品质权限注解。
dev
liuxiaoxu 4 months ago
parent
commit
d1924f8344
  1. 31
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java
  3. 13
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java
  4. 22
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/makeInStartingQuality.html
  5. 207
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/makeInStartingQualityDetail.html
  6. 19
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html

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

@ -168,7 +168,7 @@ public class QualityOrderController extends BaseController
@ResponseBody
public AjaxResult startingQualityDetailSave(QualityOrder qualityOrder)
{
return toAjax(qualityOrderService.updateQualityOrder(qualityOrder));
return toAjax(qualityOrderService.qualityOrderDetailSave(qualityOrder));
}
@ -206,7 +206,6 @@ public class QualityOrderController extends BaseController
/**
* 修改保存品质报告按钮
*/
@RequiresPermissions("quality:qualityOrder:qualityReport")
@Log(title = "品质管理品质单", businessType = BusinessType.UPDATE)
@PostMapping("/qualityReport")
@ResponseBody
@ -240,12 +239,37 @@ public class QualityOrderController extends BaseController
}
/**
* 委内加工品质单开始品质列表详情接口
*/
@GetMapping("/makeInStartingQualityDetail/{qualityOrderId}")
public String makeInStartingQualityDetail(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap)
{
QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId);
mmap.put("qualityOrder", qualityOrder);
return prefix + "/makeInStartingQualityDetail";
}
/**
* 修改保存委内加工品质单开始品质详情
*/
@RequiresPermissions("quality:qualityOrder:makeInStartingQualityDetail")
@Log(title = "品质管理品质单", businessType = BusinessType.UPDATE)
@PostMapping("/makeInStartingQualityDetail")
@ResponseBody
public AjaxResult makeInStartingQualityDetailSave(QualityOrder qualityOrder)
{
return toAjax(qualityOrderService.qualityOrderDetailSave(qualityOrder));
}
/**
* 委内加工品质单开始品质 物料相关信息
*/
@PostMapping("/getMaterialListByQualityOrderCode")
@ResponseBody
public TableDataInfo getMaterialListByOutOrderCode(QualityOrder qualityOrder)
public TableDataInfo getMaterialListByQualityOrderCode(QualityOrder qualityOrder)
{
startPage();
List<QualityOrderDetail> list = qualityOrderService.getMaterialListByQualityOrderCode(qualityOrder);
@ -270,7 +294,6 @@ public class QualityOrderController extends BaseController
/**
* 修改保存委内加工入库单品质报告按钮
*/
@RequiresPermissions("quality:qualityOrder:makeInOrderReport")
@Log(title = "品质管理品质单", businessType = BusinessType.UPDATE)
@PostMapping("/makeInOrderReport")
@ResponseBody

5
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java

@ -91,4 +91,9 @@ public interface IQualityOrderService
* 查询委内加工品质单开始品质 物料相关信息
*/
List<QualityOrderDetail> getMaterialListByQualityOrderCode(QualityOrder qualityOrder);
/*
* 品质单详情通用保存方法
* */
int qualityOrderDetailSave(QualityOrder qualityOrder);
}

13
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java

@ -110,7 +110,7 @@ public class QualityOrderServiceImpl implements IQualityOrderService
String loginName = ShiroUtils.getLoginName();
qualityOrder.setUpdateBy(loginName);
qualityOrder.setUpdateTime(new Date());
qualityOrder.setQualityEmployee(loginName);
List<QualityOrderDetail> qualityOrderDetailList = qualityOrder.getQualityOrderDetailList();
if (CollectionUtils.isEmpty(qualityOrderDetailList)){
@ -319,7 +319,7 @@ public class QualityOrderServiceImpl implements IQualityOrderService
String loginName = ShiroUtils.getLoginName();
qualityOrder.setUpdateBy(loginName);
qualityOrder.setUpdateTime(new Date());
qualityOrder.setQualityEmployee(loginName);
List<QualityOrderDetail> qualityOrderDetailList = qualityOrder.getQualityOrderDetailList();
if (CollectionUtils.isEmpty(qualityOrderDetailList)){
@ -437,6 +437,15 @@ public class QualityOrderServiceImpl implements IQualityOrderService
return details;
}
/**
* 品质单详情通用保存方法
* */
@Override
public int qualityOrderDetailSave(QualityOrder qualityOrder) {
return 1;
}
//品质单不合格分类表
private void insertQualityOrderUnqualifiedByWarehouseStorageOrder(WarehouseStorageOrderDetail warehouseStorageOrderDetail) {
QualityOrderReportUnqualified qualityOrderReportUnqualified = new QualityOrderReportUnqualified();

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

@ -51,18 +51,6 @@
</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>
</form>
<!--物料信息-->
<div class="container">
@ -83,10 +71,18 @@
var qualityOrderCode = [[${qualityOrder.qualityOrderCode}]]
var qualityOrder = [[${qualityOrder}]]
var prefix = ctx + "quality/qualityOrder";
$("#form-qualityOrder-edit").validate({
$("#form-makeInStartingQuality-edit").validate({
focusCleanup: true
});
$("input[name='deliveryInspectionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
// 新增提交
function submitHandler() {
// 获取表单数据

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

@ -0,0 +1,207 @@
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-makeInStartingQualityDetail-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" disabled>
</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" 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="qualityOrderType" class="form-control m-b" th:with="type=${@dict.getType('quality_order_type')}" disabled>
<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')}" disabled>
<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" disabled>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</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 qualityOrderCode = [[${qualityOrder.qualityOrderCode}]]
var qualityOrder = [[${qualityOrder}]]
var prefix = ctx + "quality/qualityOrder";
$("#form-makeInStartingQualityDetail-edit").validate({
focusCleanup: true
});
$("input[name='deliveryInspectionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
// 新增提交
function submitHandler() {
// 获取表单数据
const qualityOrderData = $("#form-makeInStartingQualityDetail-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 {
"qualityOrderDetailId": item.qualityOrderDetailId,
"materialNo": item.materialNo,
"thisArrivedNum": item.thisArrivedNum,
"qualityQualifiedNum": item.qualityQualifiedNum,
"qualityUnqualifiedNum": item.qualityUnqualifiedNum
// ...其他字段
};
});
const combinedData = Object.assign({}, qualityOrderData, {
qualityOrderDetailList: materialDataList,
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/makeInStartingQualityDetail", jsonData);
}
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
url: prefix + "/getMaterialListByQualityOrderCode",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '品质单详情ID',
field: 'qualityOrderDetailId',
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: 'makeInNum',
},
{
title: '品质已合格数',
field: 'qualityHasqualifiedNum',
},
{
title: '本次到货数',
field: 'thisArrivedNum',
},
{
title: '品质合格数',
field: 'qualityQualifiedNum',
},
{
title: '品质不合格数',
field: 'qualityUnqualifiedNum',
}]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
qualityOrderCode: qualityOrderCode
};
console.log(curParams);
return curParams;
}
</script>
</body>
</html>

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

@ -58,6 +58,8 @@
var detailFlag = [[${@permission.hasPermi('quality:qualityOrder:detail')}]];
var qualityFlag = [[${@permission.hasPermi('quality:qualityOrder:startingQuality')}]];
var makeInStartingQualityFlag = [[${@permission.hasPermi('quality:qualityOrder:makeInStartingQuality')}]];
var makeInStartingQualityDetailFlag = [[${@permission.hasPermi('quality:qualityOrder:makeInStartingQualityDetail')}]];
var qualityStatusDatas = [[${@dict.getType('qualityStatus')}]];
var qualityOrderTypeDatas = [[${@dict.getType('quality_order_type')}]];
@ -157,16 +159,23 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
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> ');
//采购订单品质
if (row.qualityStatus != 2 && row.qualityStorageStatus == 0 ){
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> ');
}
//采购订单品质详情
if (row.qualityStorageStatus == 0 ){
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> ');
}
//委内入库品质
if (row.qualityStatus != 2 && row.qualityStorageStatus == 1 ){
actions.push('<a class="btn btn-success btn-xs ' + makeInStartingQualityFlag + '" href="javascript:void(0)" onclick="makeInStartingQuality(\'' + row.qualityOrderId + '\')"><i class="fa fa-edit"></i>品质</a> ');
}
//委内入库品质详情
if (row.qualityStorageStatus == 1 ){
actions.push('<a class="btn btn-success btn-xs ' + makeInStartingQualityDetailFlag + '" href="javascript:void(0)" onclick="makeInStartingQualityDetail(\'' + row.qualityOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
}
return actions.join('');
}
}]
@ -193,6 +202,12 @@
$.modal.open("进行品质",url)
}
//委内加工单品质详情
function makeInStartingQualityDetail(qualityOrderId){
var url = ctx +'quality/qualityOrder/makeInStartingQualityDetail/' + qualityOrderId;
$.modal.open("进行品质详情",url)
}
</script>
</body>
</html>
Loading…
Cancel
Save