Browse Source

[feat]品质管理:

制程检验
新增制程检验添加页面
新增制程检验检查报告页面
新增制程检验修改页面
修改制程检验物料选择的字段信息
新增查找制程工序列表接口
CheckoutMaterialVO新增订单数量
dev
liuxiaoxu 6 months ago
parent
commit
14528063e0
  1. 51
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingCheckoutController.java
  2. 14
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityManufacturingCheckout.java
  3. 3
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/VO/CheckoutMaterialVO.java
  4. 4
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityManufacturingProcessMapper.java
  5. 13
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityManufacturingCheckoutService.java
  6. 103
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityManufacturingCheckoutServiceImpl.java
  7. 8
      ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml
  8. 276
      ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/add.html
  9. 229
      ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/checkoutReport.html
  10. 91
      ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/edit.html
  11. 4
      ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html

51
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityManufacturingCheckoutController.java

@ -3,6 +3,8 @@ package com.ruoyi.quality.controller;
import java.util.List;
import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO;
import com.ruoyi.quality.domain.QualityManufacturingCheckoutMaterial;
import com.ruoyi.quality.domain.QualityManufacturingProcess;
import com.ruoyi.quality.domain.VO.CheckoutMaterialVO;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@ -83,7 +85,7 @@ public class QualityManufacturingCheckoutController extends BaseController
@Log(title = "品质管理制程检验", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(QualityManufacturingCheckout qualityManufacturingCheckout)
public AjaxResult addSave(@RequestBody QualityManufacturingCheckout qualityManufacturingCheckout)
{
return toAjax(qualityManufacturingCheckoutService.insertQualityManufacturingCheckout(qualityManufacturingCheckout));
}
@ -124,6 +126,32 @@ public class QualityManufacturingCheckoutController extends BaseController
}
/**
* 制程检验报告
*/
@GetMapping("/checkoutReport/{materialNo}/{makeNo}")
public String checkoutReport(@PathVariable("materialNo") String materialNo, @PathVariable("makeNo") String makeNo,ModelMap mmap)
{
QualityManufacturingCheckoutMaterial qualityManufacturingCheckoutMaterial = qualityManufacturingCheckoutService.selectManufacturingCheckoutMaterial(materialNo,makeNo);
mmap.put("qualityManufacturingCheckoutMaterial", qualityManufacturingCheckoutMaterial);
return prefix + "/checkoutReport";
}
/**
* 制程检验报告保存
*/
@RequiresPermissions("quality:manufacturingCheckout:checkoutReport")
@Log(title = "品质管理制程检验", businessType = BusinessType.UPDATE)
@PostMapping("/checkoutReport")
@ResponseBody
public AjaxResult checkoutReportSave(QualityManufacturingCheckout qualityManufacturingCheckout)
{
return toAjax(qualityManufacturingCheckoutService.updateQualityManufacturingCheckout(qualityManufacturingCheckout));
}
/**
* 查找与客户生产单号有关的物料信息
*/
@ -145,4 +173,25 @@ public class QualityManufacturingCheckoutController extends BaseController
return getDataTable(list);
}
/**
* 查找制程工序列表
*/
@GetMapping("/manufacturingProcessSelect")
public String manufacturingProcessSelect()
{
return prefix + "/manufacturingProcessSelect";
}
/**
* 查找制程工序列表
* */
@ResponseBody
@PostMapping("/getAllProcess")
public TableDataInfo getAllProcess(){
startPage();
List<QualityManufacturingProcess> list = qualityManufacturingCheckoutService.selectAllProcess();
return getDataTable(list);
}
}

14
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityManufacturingCheckout.java

@ -1,6 +1,8 @@
package com.ruoyi.quality.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -63,6 +65,9 @@ public class QualityManufacturingCheckout extends BaseEntity
/** 制程工序名称 */
private String manufacturingProcessName;
/**品质管理制程检验物料对象 */
private List<QualityManufacturingCheckoutMaterial> checkoutMaterialList;
public void setManufacturingCheckoutId(Long manufacturingCheckoutId)
{
this.manufacturingCheckoutId = manufacturingCheckoutId;
@ -172,6 +177,14 @@ public class QualityManufacturingCheckout extends BaseEntity
return manufacturingProcessName;
}
public List<QualityManufacturingCheckoutMaterial> getCheckoutMaterialList() {
return checkoutMaterialList;
}
public void setCheckoutMaterialList(List<QualityManufacturingCheckoutMaterial> checkoutMaterialList) {
this.checkoutMaterialList = checkoutMaterialList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -192,6 +205,7 @@ public class QualityManufacturingCheckout extends BaseEntity
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("checkoutMaterialList()",getCheckoutMaterialList())
.toString();
}
}

3
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/VO/CheckoutMaterialVO.java

@ -40,4 +40,7 @@ public class CheckoutMaterialVO extends BaseEntity {
@Excel(name = "物料加工方式")
private String materialProcessMethod;
/** 订单数量*/
private String makeTotal;
}

4
ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityManufacturingProcessMapper.java

@ -92,4 +92,8 @@ public interface QualityManufacturingProcessMapper
*/
boolean existsByManufacturingProcessCode(QualityManufacturingProcess qualityManufacturingProcess);
/*
* 查找制程工序列表
* */
List<QualityManufacturingProcess> selectAllProcess();
}

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

@ -2,6 +2,8 @@ package com.ruoyi.quality.service;
import java.util.List;
import com.ruoyi.quality.domain.QualityManufacturingCheckout;
import com.ruoyi.quality.domain.QualityManufacturingCheckoutMaterial;
import com.ruoyi.quality.domain.QualityManufacturingProcess;
import com.ruoyi.quality.domain.VO.CheckoutMaterialVO;
/**
@ -78,4 +80,15 @@ public interface IQualityManufacturingCheckoutService
* 查找与制程检验有关的物料信息
* */
List<CheckoutMaterialVO> selectMaterialInfoByMakeNo(String makeNo);
/*
* 查找制程工序列表
* */
List<QualityManufacturingProcess> selectAllProcess();
/*
* 查找制程工序列表
* */
QualityManufacturingCheckoutMaterial selectManufacturingCheckoutMaterial(String materialNo, String makeNo);
}

103
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityManufacturingCheckoutServiceImpl.java

@ -5,15 +5,24 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.quality.domain.QualityManufacturingCheckoutMaterial;
import com.ruoyi.quality.domain.QualityManufacturingProcess;
import com.ruoyi.quality.domain.VO.CheckoutMaterialVO;
import com.ruoyi.quality.mapper.QualityManufacturingCheckoutMaterialMapper;
import com.ruoyi.quality.mapper.QualityManufacturingProcessMapper;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.mapper.SysMakeorderBomMapper;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -39,6 +48,17 @@ public class QualityManufacturingCheckoutServiceImpl implements IQualityManufact
@Autowired
private SysMakeorderBomMapper sysMakeorderBomMapper;
@Autowired
private SysMakeOrderMapper sysMakeOrderMapper;
@Autowired
private QualityManufacturingCheckoutMaterialMapper checkoutMaterialMapper;
@Autowired
private QualityManufacturingProcessMapper manufacturingProcessMapper;
@Autowired
private SysSalesOrderChildMapper sysSalesOrderChildMapper;
/**
* 查询品质管理制程检验
*
@ -73,6 +93,7 @@ public class QualityManufacturingCheckoutServiceImpl implements IQualityManufact
@Override
public int insertQualityManufacturingCheckout(QualityManufacturingCheckout qualityManufacturingCheckout)
{
String loginName = ShiroUtils.getLoginName();
//格式化日期格式
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String formatDate = df.format(new Date());
@ -85,7 +106,18 @@ public class QualityManufacturingCheckoutServiceImpl implements IQualityManufact
String newCode = generateNewCode(prefix, maxCode);
qualityManufacturingCheckout.setManufacturingCheckoutCode(newCode);
String loginName = ShiroUtils.getLoginName();
List<QualityManufacturingCheckoutMaterial> checkoutMaterialList = qualityManufacturingCheckout.getCheckoutMaterialList();
if (StringUtils.isEmpty(checkoutMaterialList)){
log.warn("与生产订单号有关的物料数据为空:{}",qualityManufacturingCheckout.getCheckoutMaterialList());
}
for (QualityManufacturingCheckoutMaterial qualityManufacturingCheckoutMaterial : checkoutMaterialList) {
qualityManufacturingCheckoutMaterial.setMakeNo(qualityManufacturingCheckout.getMakeNo());
qualityManufacturingCheckoutMaterial.setManufacturingCheckoutCode(newCode);
qualityManufacturingCheckoutMaterial.setCreateBy(loginName);
qualityManufacturingCheckoutMaterial.setCreateTime(new Date());
checkoutMaterialMapper.insertQualityManufacturingCheckoutMaterial(qualityManufacturingCheckoutMaterial);
}
qualityManufacturingCheckout.setCreateBy(loginName);
qualityManufacturingCheckout.setCreateTime(DateUtils.getNowDate());
return qualityManufacturingCheckoutMapper.insertQualityManufacturingCheckout(qualityManufacturingCheckout);
@ -183,24 +215,69 @@ public class QualityManufacturingCheckoutServiceImpl implements IQualityManufact
ArrayList<CheckoutMaterialVO> checkoutMaterialVOS = new ArrayList<>();
List<SysMakeorderBom> sysMakeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomByMakeNo(makeNo);
if (StringUtils.isEmpty(sysMakeorderBoms)){
SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectSaleNoByMakeNo(makeNo);
if (StringUtils.isEmpty(sysMakeOrder.getSaleNo())){
log.warn("未查找到与生产订单关联的销售订单, 生产订单号: {}", makeNo);
}
List<SysSalesOrderChild> sysSalesOrderChildList = sysSalesOrderChildMapper.selectSysSalesOrderChildByQuoteId(sysMakeOrder.getSaleNo());
if (StringUtils.isEmpty(sysSalesOrderChildList)){
// 记录日志
log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo);
log.warn("未查找到与销售订单关联的物料相关数据, 销售订单号: {}", sysMakeOrder.getSaleNo());
}
for (SysMakeorderBom sysMakeorderBom : sysMakeorderBoms) {
for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildList) {
CheckoutMaterialVO checkoutMaterialVO = new CheckoutMaterialVO();
checkoutMaterialVO.setMaterialNo(sysMakeorderBom.getMaterialNo());
checkoutMaterialVO.setMaterialBrand(sysMakeorderBom.getBrand());
checkoutMaterialVO.setMaterialDescribe(sysMakeorderBom.getDescribe());
checkoutMaterialVO.setMaterialName(sysMakeorderBom.getMaterialName());
checkoutMaterialVO.setMaterialProcessMethod(sysMakeorderBom.getProcessMethod());
checkoutMaterialVO.setMaterialPhotourl(sysMakeorderBom.getPhotoUrl());
checkoutMaterialVO.setMaterialUnit(sysMakeorderBom.getUnit());
checkoutMaterialVO.setMaterialType(sysMakeorderBom.getMaterialType());
checkoutMaterialVO.setMaterialNo(sysSalesOrderChild.getMaterialCode());
checkoutMaterialVO.setMaterialBrand(sysSalesOrderChild.getBrand());
checkoutMaterialVO.setMaterialDescribe(sysSalesOrderChild.getDescribe());
checkoutMaterialVO.setMaterialName(sysSalesOrderChild.getMaterialName());
checkoutMaterialVO.setMaterialProcessMethod(sysSalesOrderChild.getProcessMethod());
checkoutMaterialVO.setMaterialPhotourl(sysSalesOrderChild.getPhotoUrl());
checkoutMaterialVO.setMaterialUnit(sysSalesOrderChild.getUnit());
checkoutMaterialVO.setMaterialType(sysSalesOrderChild.getMaterialType());
checkoutMaterialVO.setMakeTotal(sysSalesOrderChild.getMaterialNum().toString());
checkoutMaterialVOS.add(checkoutMaterialVO);
}
return checkoutMaterialVOS;
}
/*
* 查找制程工序列表
* */
@Override
public List<QualityManufacturingProcess> selectAllProcess() {
List<QualityManufacturingProcess> list = manufacturingProcessMapper.selectAllProcess();
if (StringUtils.isEmpty(list)){
log.warn("未查找到制程工序相关数据: {}");
}
return list;
}
@Override
public QualityManufacturingCheckoutMaterial selectManufacturingCheckoutMaterial(String materialNo, String makeNo) {
QualityManufacturingCheckoutMaterial checkoutMaterial = new QualityManufacturingCheckoutMaterial();
SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectSaleNoByMakeNo(makeNo);
if (StringUtils.isEmpty(sysMakeOrder.getSaleNo())){
log.warn("未查找到与生产订单关联的销售订单, 生产订单号: {}", makeNo);
}
SysSalesOrderChild sysSalesOrderChild = sysSalesOrderChildMapper.selectOneByQuoteIdAndMaterialCode(sysMakeOrder.getSaleNo(), materialNo);
if (StringUtils.isEmpty(sysSalesOrderChild.getMaterialCode())){
// 记录日志
log.warn("未查找到与销售订单关联的物料相关数据, 销售订单号: {}", sysMakeOrder.getSaleNo());
}
checkoutMaterial.setMaterialNo(materialNo);
checkoutMaterial.setMaterialName(sysSalesOrderChild.getMaterialName());
checkoutMaterial.setMakeTotal(sysSalesOrderChild.getMaterialNum().toString());
return checkoutMaterial;
}
}

8
ruoyi-admin/src/main/resources/mapper/quality/QualityManufacturingProcessMapper.xml

@ -37,7 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
</select>
<select id="selectAllProcess" resultMap="QualityManufacturingProcessResult">
<include refid="selectQualityManufacturingProcessVo"/>
</select>
<select id="selectQualityManufacturingProcessById" parameterType="Long" resultMap="QualityManufacturingProcessResult">
<include refid="selectQualityManufacturingProcessVo"/>
where manufacturing_process_autoid = #{manufacturingProcessAutoid}

276
ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/add.html

@ -0,0 +1,276 @@
<!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-manufacturingCheckout-add">
<div class="form-group">
<label class="col-sm-4 control-label is-required">生产单号:</label>
<div class="col-sm-8">
<select class="form-control" id="makeNo" name="makeNo" required>
<!-- 这里动态生成客户编号选项 -->
</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="checkoutTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择物料</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 选择物料
</a>
</div>
</div>
<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 prefix = ctx + "quality/manufacturingCheckout"
$("#form-manufacturingCheckout-add").validate({
focusCleanup: true
});
// 新增提交
function submitHandler() {
// 获取表单数据
const manufacturingCheckoutData = $("#form-manufacturingCheckout-add").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-table').bootstrapTable('getData');
// 检查表格数据是否为空
if (table.length===0){
$.modal.alertWarning("请至少添加一条物料数据后再保存!");
return;
}
console.log(table);
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"materialNo": item.materialNo, // 假设id对应materialId
"materialPhotourl": item.materialPhotourl, // 假设quantity是物料数量字段
"materialName": item.materialName,
"materialType": item.materialType,
"materialUnit": item.materialUnit,
"materialBrand": item.materialBrand,
"materialDescribe": item.materialDescribe,
"makeTotal": item.makeTotal,
"checkedNum": item.checkedNum,
"currentCheckoutNum": item.currentCheckoutNum,
"processQualifiedNum":item.processQualifiedNum,
"processUnqualifiedNum":item.processUnqualifiedNum
// ...其他字段
};
});
const combinedData = Object.assign({}, manufacturingCheckoutData, { checkoutMaterialList: materialDataList });
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/add", jsonData);
}
$("input[name='checkoutTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
/*加载所有的关联生产单号*/
loadAllMakeNos();
/*加载所有的关联生产单号*/
function loadAllMakeNos(){
var url = ctx + 'system/makeorder/getAllMakeNos';
$.ajax({
type:'GET',//请求类型
url:url,//后端接口url
dataType:'json', //预期服务器返回数据类型
success: function (data){
if (data && Array.isArray(data)){
var selectElement = $('#makeNo'); //获取生产编号下拉框元素
//清空下拉框现有选项
selectElement.empty();
// 添加默认选项(如果需要)
selectElement.append('<option value="">请选择关联生产单号</option>');
//遍历返回的数据,添加下拉框的选项
$.each(data,function (index,item){
//赋值遍历数据中的makeNo到下拉框中
selectElement.append('<option value="'+item.makeNo+'">'+item.makeNo+'</option>');
})
}else {
$.modal.error("数据为空");
}
}
})
}
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
columns: [{
checkbox: true
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'materialPhotourl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '描述',
field: 'materialDescribe',
},
{
title: '品牌',
field: 'materialBrand',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '物料加工方式',
field: 'materialProcessMethod',
},
{
title: '订单数',
field: 'makeTotal',
},
{
title: '已检验数',
field: 'checkedNum',
},
{
title: '本次检验数',
field: 'currentCheckoutNum',
editable: {
type:'text'
}
},
{
title: '制程检验报告',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="checkoutReport(\'' + row.materialNo + '\')"><i class="fa fa-plus"></i>检验报告</a> ');
return actions.join('');
}
},
{
title: '工序合格数',
field: 'processQualifiedNum',
},
{
title: '工序不合格数',
field: 'processUnqualifiedNum',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.materialNo + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
]
};
$.table.init(options);
})
/*选择物料按钮*/
function insertRow() {
var selectedMakeNo = $("#makeNo").val();
if (!selectedMakeNo) {
$.modal.alertWarning("请先选择生产单号。");
return;
}
var encodedMakeNo = encodeURIComponent(selectedMakeNo);
var url = ctx + 'quality/manufacturingCheckout/materialSelect?makeNo=' + encodedMakeNo;
var options = {
title: '选择物料',
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-materialSelect-table').bootstrapTable('getSelections')[0];
console.log("rowData: "+rowData);
$("#bootstrap-table").bootstrapTable('insertRow', {
index:1,
row: {
materialNo:rowData.materialNo,
materialPhotourl:rowData.materialPhotourl,
materialName: rowData.materialName,
materialType: rowData.materialType,
materialDescribe: rowData.materialDescribe,
materialBrand: rowData.materialBrand,
materialUnit: rowData.materialUnit,
materialProcessMethod: rowData.materialProcessMethod,
makeTotal:rowData.makeTotal
}
})
layer.close(index);
}
// 逻辑删除前端的一行数据
function removeRow(materialNo){
$("#bootstrap-table").bootstrapTable('remove', {
field: 'materialNo',
values: materialNo
})
}
/*检验报告*/
function checkoutReport(materialNo){
var makeNo = $('#makeNo').val(); //获取生产编号下拉框元素
var url = ctx + 'quality/manufacturingCheckout/checkoutReport/' + materialNo+'/'+makeNo;
$.modal.open("制程检验报告",url);
}
</script>
</body>
</html>

229
ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/checkoutReport.html

@ -0,0 +1,229 @@
<!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-checkoutMaterial-edit" th:object="${qualityManufacturingCheckoutMaterial}">
<input name="manufacturingCheckoutMaterialId" th:field="*{manufacturingCheckoutMaterialId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">料号:</label>
<div class="col-sm-8">
<input name="materialNo" th:field="*{materialNo}" 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="materialName" th:field="*{materialName}" 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="makeTotal" th:field="*{makeTotal}" 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="checkedNum" th:field="*{checkedNum}" class="form-control" type="text">
</div>
</div>
<!-- <div class="form-row">-->
<!-- <div class="container">-->
<!-- <div class="form-row">-->
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- <span>选择制程工序</span>-->
<!-- <a class="btn btn-success" onclick="addManufacturingProcess()">-->
<!-- <i class="fa fa-plus"></i> 添加制程工序-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- </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="checkoutCompletionTime" th:value="${#dates.format(qualityManufacturingCheckoutMaterial.checkoutCompletionTime, '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">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var manufacturingProcessNameDatas = [[${@dict.getType('manufacturing_process_name')}]];
var prefix = ctx + "quality/checkoutMaterial";
$("#form-checkoutMaterial-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-checkoutMaterial-edit').serialize());
}
}
$("input[name='checkoutTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='checkoutCompletionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
//制程工序展示列表
$(function() {
var options = {
id:'bootstrap-manufacturingProcess-table',
modalName: "选择制程工序",
height:50,
columns: [{
checkbox: true
},
{
title: '制程工序编号',
field: 'manufacturingProcessCode',
},
{
title: '制程工序名称',
field: 'manufacturingProcessName',
formatter: function(value, row, index) {
return $.table.selectDictLabel(manufacturingProcessNameDatas, value);
}
},
{
title: '设备名称',
field: 'deviceName',
},
{
title: '设备型号',
field: 'deviceModelCode',
},
{
title: '工序顺序',
field: 'processSequence',
},
{
title: '车间名称',
field: 'workshopName',
},
{
title: '零件名称',
field: 'modName',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.manufacturingProcessCode + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
},
]
};
$.table.init(options);
})
$(function() {
var options = {
id:'bootstrap-manufacturingProcess-table',
modalName: "选择制程工序",
height:50,
columns: [{
checkbox: true
},
{
title: '制程工序编号',
field: 'manufacturingProcessCode',
},
{
title: '制程工序名称',
field: 'manufacturingProcessName',
formatter: function(value, row, index) {
return $.table.selectDictLabel(manufacturingProcessNameDatas, value);
}
},
{
title: '设备名称',
field: 'deviceName',
},
{
title: '设备型号',
field: 'deviceModelCode',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.manufacturingProcessCode + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
]
};
$.table.init(options);
})
/*添加制程工序按钮*/
// function insertRow() {
// var url = ctx + 'quality/manufacturingCheckout/manufacturingProcessSelect';
// var options = {
// title: '选制程工序',
// url: url,
// callBack: doSubmit
// };
// $.modal.openOptions(options);
// }
//
//
// function doSubmit(index, layero,uniqueId){
// console.log(uniqueId);
// var iframeWin = window[layero.find('iframe')[0]['name']];
// var rowData = iframeWin.$('#bootstrap-manufacturingProcessSelect-table').bootstrapTable('getSelections')[0];
// console.log("rowData: "+rowData);
// $("#bootstrap-manufacturingProcess-table").bootstrapTable('insertRow', {
// index:1,
// row: {
// manufacturingProcessCode:rowData.manufacturingProcessCode,
// manufacturingProcessName:rowData.manufacturingProcessName,
// deviceName: rowData.deviceName,
// deviceModelCode: rowData.deviceModelCode,
// processSequence: rowData.processSequence,
// workshopName: rowData.workshopName,
// modName: rowData.modName,
// }
// })
// layer.close(index);
// }
</script>
</body>
</html>

91
ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/edit.html

@ -0,0 +1,91 @@
<!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-manufacturingCheckout-edit" th:object="${qualityManufacturingCheckout}">
<input name="manufacturingCheckoutId" th:field="*{manufacturingCheckoutId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">制程检验单号:</label>
<div class="col-sm-8">
<input name="manufacturingCheckoutCode" th:field="*{manufacturingCheckoutCode}" 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="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</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="checkoutTime" th:value="${#dates.format(qualityManufacturingCheckout.checkoutTime, '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">料号:</label>
<div class="col-sm-8">
<input name="materialNo" th:field="*{materialNo}" 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="materialName" th:field="*{materialName}" 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="materialTotal" th:field="*{materialTotal}" 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="numTotal" th:field="*{numTotal}" 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="processQualifiedNum" th:field="*{processQualifiedNum}" 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="processUnqualifiedNum" th:field="*{processUnqualifiedNum}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "quality/manufacturingCheckout";
$("#form-manufacturingCheckout-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-manufacturingCheckout-edit').serialize());
}
}
$("input[name='checkoutTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

4
ruoyi-admin/src/main/resources/templates/quality/manufacturingCheckout/materialSelect.html

@ -59,6 +59,10 @@
title: '加工方式',
field: 'materialProcessMethod',
},
{
title: '订单数',
field: 'makeTotal'
}
]
};
$.table.init(options);

Loading…
Cancel
Save