zhangsiqi
6 months ago
6 changed files with 522 additions and 4 deletions
@ -0,0 +1,426 @@ |
|||
<!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" id="form-materialReturnInspection-edit" th:object="${erpMaterialReturnInspection}"> |
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
<input name="id" th:field="*{id}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">退检单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input id="returnInspectionNo" name="returnInspectionNo" th:field="*{returnInspectionNo}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">生产单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input readonly id="makeNo" name="makeNo" th:field="*{makeNo}" class="form-control" type="text" required> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">退料时间:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="returnMaterialTime" th:value="${#dates.format(erpMaterialReturnInspection.returnMaterialTime, '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> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">紧急程度:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="urgencyLevel" class="form-control" th:with="type=${@dict.getType('urgency_level')}" readonly disabled> |
|||
<option value=""></option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{urgencyLevel}"></option> |
|||
</select> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-6"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">是否结案:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}"> |
|||
<input type="radio" th:id="${'isClosed_' + dict.dictCode}" name="isClosed" th:value="${dict.dictValue}" th:field="*{isClosed}"> |
|||
<label th:for="${'isClosed_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-12"> |
|||
<!-- <a class="btn btn-success btn-sm" onclick="insertRow()">--> |
|||
<!-- <i class="fa fa-plus"></i> 新增行--> |
|||
<!-- </a>--> |
|||
<!-- <a class="btn btn-danger multiple btn-sm" onclick="removeRow()">--> |
|||
<!-- <i class="fa fa-remove"></i> 删除选择行--> |
|||
<!-- </a>--> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-sub-table-1"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:src="@{/js/jquery.tmpl.js}"></script> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "quality/returnInspection"; |
|||
|
|||
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
|||
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]]; |
|||
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|||
|
|||
$(function(){ |
|||
var options = { |
|||
url: ctx + "erp/materialReturnInspectionDetail/list", |
|||
id: 'bootstrap-sub-table-1', |
|||
showSearch: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
showColumns: false, |
|||
uniqueId: "id", |
|||
pagination: false, // 设置不分页 |
|||
sidePagination: "client", |
|||
queryParams: queryParams, |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'id', |
|||
title: '主键id', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
var columnInput = $.common.sprintf("<input type='hidden' name='inspectionDetails[%s].id' value='%s'>", curIndex, value); |
|||
return value + columnInput; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialNo', |
|||
align: 'center', |
|||
title: '料号', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
var columnInput = $.common.sprintf("<input type='hidden' name='inspectionDetails[%s].materialNo' value='%s'>", curIndex, value); |
|||
return value + columnInput; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'photoUrl', |
|||
title: '图片', |
|||
formatter: function(value, row, index) { |
|||
var curIndex = index; |
|||
var columnInput = $.common.sprintf("<input type='hidden' name='inspectionDetails[%s].photoUrl' value='%s'>", curIndex, value); |
|||
return $.table.imageView(value) + columnInput; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialName', |
|||
align: 'center', |
|||
title: '物料名称', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
var columnInput = $.common.sprintf("<input type='hidden' name='inspectionDetails[%s].materialName' value='%s'>", curIndex, value); |
|||
return value + columnInput; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'materialType', |
|||
align: 'center', |
|||
title: '物料类型', |
|||
formatter: function(value, row, index) { |
|||
var curIndex = index; |
|||
var columnInput = $.common.sprintf("<input type='hidden' name='inspectionDetails[%s].materialType' value='%s'>", curIndex, value); |
|||
return $.table.selectCategoryLabel(materialTypeDatas, value) + columnInput; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'describe', |
|||
align: 'center', |
|||
title: '描述', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
var columnInput = $.common.sprintf("<input type='hidden' name='inspectionDetails[%s].describe' value='%s'>", curIndex, value); |
|||
if(value){ |
|||
return value + columnInput; |
|||
} |
|||
return columnInput; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'brand', |
|||
align: 'center', |
|||
title: '品牌', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
var columnInput = $.common.sprintf("<input type='hidden' name='inspectionDetails[%s].brand' value='%s'>", curIndex, value); |
|||
if(value){ |
|||
return value + columnInput; |
|||
} |
|||
return columnInput; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'unit', |
|||
align: 'center', |
|||
title: '单位', |
|||
formatter: function(value, row, index) { |
|||
var curIndex = index; |
|||
var columnInput = $.common.sprintf("<input type='hidden' name='inspectionDetails[%s].unit' value='%s'>", curIndex, value); |
|||
return $.table.selectDictLabel(sysUnitClassDatas, value) + columnInput; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'processMethod', |
|||
align: 'center', |
|||
title: '加工方式', |
|||
formatter: function(value, row, index) { |
|||
var curIndex = index; |
|||
var columnInput = $.common.sprintf("<input type='hidden' name='inspectionDetails[%s].processMethod' value='%s'>", curIndex, value); |
|||
return $.table.selectDictLabel(processMethodDatas, value) + columnInput; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'returnInspectionNum', |
|||
align: 'center', |
|||
title: '退检数量', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
return '<input class = "form-control" data-id = "returnInspectionNum_'+curIndex+'" name="inspectionDetails['+curIndex+'].returnInspectionNum" value="'+value+'">'; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'returnInspectionType', |
|||
align: 'center', |
|||
title: '退检类型', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
return '<input class = "form-control" data-id = "returnInspectionType_'+curIndex+'" name="inspectionDetails['+curIndex+'].returnInspectionType" value="'+value+'">'; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'urgencyLevel', |
|||
align: 'center', |
|||
title: '紧急程度', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
var data = [{ index: curIndex, type: value }]; |
|||
return $("#urgencyLevelTpl").tmpl(data).html(); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'pickMaterialTime', |
|||
align: 'center', |
|||
title: '领料时间', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
var html = $.common.sprintf("<input class='form-control' type='text' name='inspectionDetails[%s].pickMaterialTime' value='%s' placeholder='yyyy-MM-dd'>", curIndex, value); |
|||
return html; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'returnInspectionRemark', |
|||
align: 'center', |
|||
title: '退检备注', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
return '<input class = "form-control" data-id = "returnInspectionRemark_'+curIndex+'" name="inspectionDetails['+curIndex+'].returnInspectionRemark" value="'+value+'">'; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'abnormalCause', |
|||
align: 'center', |
|||
title: '异常原因', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
var data = [{ index: curIndex, type: value }]; |
|||
return $("#abnormalCauseTpl").tmpl(data).html(); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'dutyUnit', |
|||
align: 'center', |
|||
title: '责任单位', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
return '<input class = "form-control" data-id = "dutyUnit_'+curIndex+'" name="inspectionDetails['+curIndex+'].dutyUnit" value="'+value+'">'; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'recheckRemark', |
|||
align: 'center', |
|||
title: '复检备注', |
|||
formatter: function (value,row,index){ |
|||
var curIndex = index; |
|||
return '<input class = "form-control" data-id = "recheckRemark_'+curIndex+'" name="inspectionDetails['+curIndex+'].recheckRemark" value="'+value+'">'; |
|||
} |
|||
}, |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}) |
|||
|
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
pageSize: params.limit, |
|||
pageNum: params.offset / params.limit + 1, |
|||
searchValue: params.search, |
|||
orderByColumn: params.sort, |
|||
isAsc: params.order |
|||
}; |
|||
// 额外传参 |
|||
curParams.returnInspectionNo = $("#returnInspectionNo").val(); |
|||
return curParams; |
|||
} |
|||
|
|||
|
|||
|
|||
function selectMakeOrder() { |
|||
var url = ctx + "system/makeorder/selectMakeorder"; |
|||
var options = { |
|||
title: '选择生产订单', |
|||
url: url, |
|||
callBack: doSubmit1 |
|||
}; |
|||
$.modal.openOptions(options); |
|||
} |
|||
|
|||
function doSubmit1(index, layero){ |
|||
debugger |
|||
var iframeWin = window[layero.find('iframe')[0]['name']]; |
|||
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; |
|||
$("#makeNo").val(rowData.makeNo); |
|||
$.modal.close(index); |
|||
} |
|||
|
|||
|
|||
/* 新增表格行 */ |
|||
function insertRow(){ |
|||
var makeNo = $("#makeNo").val(); |
|||
if(!makeNo){ |
|||
$.modal.msgWarning("请先选择生产单号!"); |
|||
return; |
|||
} |
|||
var url = ctx + "system/makeorder/selectMakeorderDetail/"+makeNo; |
|||
var options = { |
|||
title: '选择料号', |
|||
url: url, |
|||
callBack: doSubmit |
|||
}; |
|||
$.modal.openOptions(options); |
|||
} |
|||
/* 删除指定表格行 */ |
|||
function removeRow(){ |
|||
var ids = $.table.selectColumns("id"); |
|||
if (ids.length == 0) { |
|||
$.modal.alertWarning("请至少选择一条记录"); |
|||
return; |
|||
} |
|||
$("#bootstrap-sub-table-1").bootstrapTable('remove', { |
|||
field: 'id', |
|||
values: ids |
|||
}) |
|||
} |
|||
|
|||
function doSubmit(index, layero,uniqueId){ |
|||
console.log(uniqueId); |
|||
var iframeWin = window[layero.find('iframe')[0]['name']]; |
|||
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; |
|||
var totalNum = $("#bootstrap-sub-table-1").bootstrapTable('getData').length; |
|||
console.log("rowData:"+rowData); |
|||
$("#bootstrap-sub-table-1").bootstrapTable('insertRow',{ |
|||
index: 1, |
|||
row: { |
|||
id: totalNum+1, |
|||
materialNo: rowData.materialNo, |
|||
photoUrl: rowData.photoUrl, |
|||
materialName: rowData.materialName, |
|||
materialType: rowData.materialType, |
|||
describe: rowData.describe, |
|||
brand: rowData.brand, |
|||
unit: rowData.unit, |
|||
processMethod: rowData.processMethod, |
|||
returnInspectionNum: '', |
|||
returnInspectionType: '', |
|||
urgencyLevel: '', |
|||
pickMaterialTime: '', |
|||
returnInspectionRemark: '', |
|||
abnormalCause:'', |
|||
dutyUnit:'', |
|||
recheckRemark:'' |
|||
} |
|||
}) |
|||
layer.close(index); |
|||
} |
|||
|
|||
$("#form-materialReturnInspection-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/processing", $('#form-materialReturnInspection-edit').serialize()); |
|||
} |
|||
} |
|||
|
|||
$("input[name='returnMaterialTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
$("#bootstrap-sub-table-1").on("post-body.bs.table", function (e, args) { |
|||
$("input[name$='Time']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true, |
|||
pickerPosition:'top-right' |
|||
}); |
|||
}); |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
|||
|
|||
<!-- 紧急程度 --> |
|||
<script id="urgencyLevelTpl" type="text/x-jquery-tmpl"> |
|||
<div> |
|||
<select class='form-control' name='inspectionDetails[${index}].urgencyLevel'> |
|||
<option value=""></option> |
|||
<option value="0" {{if type==="0"}}selected{{/if}}>一般</option> |
|||
<option value="1" {{if type==="1"}}selected{{/if}}>紧急</option> |
|||
</select> |
|||
</div> |
|||
</script> |
|||
|
|||
|
|||
<script id="abnormalCauseTpl" type="text/x-jquery-tmpl"> |
|||
<div> |
|||
<select class='form-control' name='inspectionDetails[${index}].abnormalCause'> |
|||
<option value="">所有</option> |
|||
<option value="0" {{if type==="0"}}selected{{/if}}>漏检</option> |
|||
<option value="1" {{if type==="1"}}selected{{/if}}>图纸实物</option> |
|||
<option value="2" {{if type==="2"}}selected{{/if}}>未检验</option> |
|||
</select> |
|||
</div> |
|||
</script> |
Loading…
Reference in new issue