zhangsiqi
6 months ago
12 changed files with 388 additions and 15 deletions
@ -0,0 +1,249 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
||||
|
<head> |
||||
|
<th:block th:include="include :: header('修改品质管理制程检验')" /> |
||||
|
<th:block th:include="include:: select2-css" /> |
||||
|
<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="manufacturingCheckoutCode" th:field="*{manufacturingCheckoutCode}" type="hidden"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-4 control-label">生产单号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select class="form-control" id="makeNo" name="makeNo" th:field="*{makeNo}" disabled> |
||||
|
<!-- 这里动态生成生产单号选项 --> |
||||
|
</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" th:value="${#dates.format(qualityManufacturingCheckout.checkoutTime, '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:: select2-js" /> |
||||
|
<th:block th:include="include :: datetimepicker-js" /> |
||||
|
<script th:inline="javascript"> |
||||
|
|
||||
|
var qualityManufacturingCheckout = [[${qualityManufacturingCheckout}]]; |
||||
|
var makeNo = [[${qualityManufacturingCheckout.makeNo}]]; |
||||
|
var prefix = ctx + "quality/manufacturingCheckout"; |
||||
|
$("#form-manufacturingCheckout-edit").validate({focusCleanup: true }); |
||||
|
//物料信息展示列表 |
||||
|
$(function() { |
||||
|
var options = { |
||||
|
url: ctx + "quality/manufacturingCheckout/getMaterialListByCode", |
||||
|
showSearch: false, |
||||
|
showRefresh: false, |
||||
|
showToggle: false, |
||||
|
showColumns: false, |
||||
|
pagination: false, // 设置不分页 |
||||
|
queryParams: queryParams, |
||||
|
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); |
||||
|
loadAllMakeNos(); |
||||
|
}) |
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
manufacturingCheckoutCode: qualityManufacturingCheckout.manufacturingCheckoutCode |
||||
|
}; |
||||
|
return curParams; |
||||
|
} |
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
$.operate.save(prefix + "/detail", $('#form-manufacturingCheckout-edit').serialize()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
$("input[name='checkoutTime']").datetimepicker({ |
||||
|
format: "yyyy-mm-dd", |
||||
|
minView: "month", |
||||
|
autoclose: true |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
/*加载所有的关联生产单号*/ |
||||
|
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 = $("#form-manufacturingCheckout-edit select[name='makeNo']"); //获取生产编号下拉框元素 |
||||
|
//清空下拉框现有选项 |
||||
|
selectElement.empty(); |
||||
|
// 添加默认选项(如果需要) |
||||
|
selectElement.append('<option value="">请选择关联生产单号</option>'); |
||||
|
//遍历返回的数据,添加下拉框的选项 |
||||
|
$.each(data,function (index,item){ |
||||
|
//赋值遍历数据中的makeNo到下拉框中 |
||||
|
selectElement.append('<option value="'+item.makeNo+'">'+item.makeNo+'</option>'); |
||||
|
}) |
||||
|
$("#makeNo").val(makeNo); |
||||
|
}else { |
||||
|
$.modal.error("数据为空"); |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/*选择物料按钮*/ |
||||
|
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> |
Loading…
Reference in new issue