Browse Source

[feat]品质管理

新增生产入库品质详情页面
新增生产入库品质详情修改保存后端接口
新增 品质列表按照最新创建时间降序排列
新增 生产入库品质权限字符
新增 生产入库品质详情权限字符
dev
liuxiaoxu 4 months ago
parent
commit
23e4325683
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java
  2. 3
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  3. 1
      ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml
  4. 207
      ruoyi-admin/src/main/resources/templates/quality/qualityOrder/makeStartingQualityDetail.html

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

@ -337,7 +337,7 @@ public class QualityOrderController extends BaseController
{
QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId);
mmap.put("qualityOrder", qualityOrder);
return prefix + "/makeInStartingQualityDetail";
return prefix + "/makeStartingQualityDetail";
}
/**

3
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java

@ -591,6 +591,7 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
//暂收设置为全部品质
warehouseStorageOrder.setWarehouseQualityStatus("2");
warehouseStorageOrder.setWarehouseStorageStatus("2");
//设置为生产订单
warehouseStorageOrder.setWarehouseStorageType("5");
warehouseStorageOrder.setWarehouseOrderType("1");
warehouseStorageOrder.setDeliveryInspectionTime(tempQualityOrder.getDeliveryInspectionTime());
@ -599,8 +600,6 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
warehouseStorageOrder.setCreateBy(loginName);
warehouseStorageOrder.setQualityTime(new Date());
warehouseStorageOrder.setCreateTime(new Date());
//设置委内完成数总价
warehouseStorageOrder.setMakeInTotalPrice(tempQualityOrder.getMakeInTotalPrice());
//插入入库单详情数据
for (QualityOrderDetail qualityOrderDetail : qualityOrderDetailList) {

1
ruoyi-admin/src/main/resources/mapper/quality/QualityOrderMapper.xml

@ -64,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qualityEmployee != null and qualityEmployee != ''"> and quality_employee = #{qualityEmployee}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where>
order by create_time desc
</select>
<select id="selectQualityOrderById" parameterType="Long" resultMap="QualityOrderResult">

207
ruoyi-admin/src/main/resources/templates/quality/qualityOrder/makeStartingQualityDetail.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: 'makeTotal',
},
{
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>
Loading…
Cancel
Save