liuxiaoxu
6 months ago
5 changed files with 384 additions and 14 deletions
@ -0,0 +1,332 @@ |
|||||
|
<!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"> |
||||
|
</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" readonly> |
||||
|
<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}" |
||||
|
disabled="disabled"> <!-- 添加disabled属性到这里 --> |
||||
|
<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 urgencyLevelDatas = [[${@dict.getType('urgency_level')}]]; |
||||
|
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' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialNo', |
||||
|
align: 'center', |
||||
|
title: '料号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'photoUrl', |
||||
|
title: '图片', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.imageView(value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialName', |
||||
|
align: 'center', |
||||
|
title: '物料名称' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialType', |
||||
|
align: 'center', |
||||
|
title: '物料类型', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectCategoryLabel(materialTypeDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'describe', |
||||
|
align: 'center', |
||||
|
title: '描述' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'brand', |
||||
|
align: 'center', |
||||
|
title: '品牌' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'unit', |
||||
|
align: 'center', |
||||
|
title: '单位', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(sysUnitClassDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'processMethod', |
||||
|
align: 'center', |
||||
|
title: '加工方式', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(processMethodDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'returnInspectionNum', |
||||
|
align: 'center', |
||||
|
title: '退检数量' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'returnInspectionType', |
||||
|
align: 'center', |
||||
|
title: '退检类型' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'urgencyLevel', |
||||
|
align: 'center', |
||||
|
title: '紧急程度', |
||||
|
// 如果urgencyLevelTpl是用于生成可编辑内容的模板,这里也需要调整或移除 |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(urgencyLevelDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'pickMaterialTime', |
||||
|
align: 'center', |
||||
|
title: '领料时间' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'returnInspectionRemark', |
||||
|
align: 'center', |
||||
|
title: '退检备注' |
||||
|
} |
||||
|
] |
||||
|
}; |
||||
|
$.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: '' |
||||
|
} |
||||
|
}) |
||||
|
layer.close(index); |
||||
|
} |
||||
|
|
||||
|
$("#form-materialReturnInspection-edit").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
$.operate.save(prefix + "/detail", $('#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> |
Loading…
Reference in new issue