Commit 7da03a9d by 胡懿

Merge branches 'hy' and 'master' of gitlab.yqdchina.com:huyi/warehouse into hy

parents dbaf91ed b2e10a8c
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
var data = ${fns:toJson(ledger.ledgerInfoList)}; var data = ${fns:toJson(ledger.ledgerInfoList)};
$(selector).bootstrapTable({ $(selector).bootstrapTable({
data: data, data: data,
columns:[{checkbox: true}, columns:[
{ {
field: 'no', field: 'no',
title: '序号', title: '序号',
...@@ -183,6 +183,10 @@ ...@@ -183,6 +183,10 @@
<input id="ledgerInfoList{{idx}}_batchNum" name="ledgerInfoList[{{idx}}].batchNum" type="text" value="{{row.batchNum}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/> <input id="ledgerInfoList{{idx}}_batchNum" name="ledgerInfoList[{{idx}}].batchNum" type="text" value="{{row.batchNum}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script> </script>
<script id="shelvesTpl" type="text/html">
<input id="ledgerInfoList{{idx}}_shelvesName" name="ledgerInfoList[{{idx}}].shelves.name" type="text" value="{{row.shelves.name}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
<script id="codeTpl" type="text/html"> <script id="codeTpl" type="text/html">
<input id="ledgerInfoList{{idx}}_code" name="ledgerInfoList[{{idx}}].code" type="text" value="{{row.code}}" readonly class="form-control" /> <input id="ledgerInfoList{{idx}}_code" name="ledgerInfoList[{{idx}}].code" type="text" value="{{row.code}}" readonly class="form-control" />
</script> </script>
...@@ -124,10 +124,10 @@ $(document).ready(function() { ...@@ -124,10 +124,10 @@ $(document).ready(function() {
} }
,{ ,{
field: 'shelvesIds', field: 'sum',
title: '货架id集合', title: '总价',
sortable: true, sortable: true,
sortName: 'shelvesIds' sortName: 'sum'
} }
,{ ,{
...@@ -138,10 +138,10 @@ $(document).ready(function() { ...@@ -138,10 +138,10 @@ $(document).ready(function() {
} }
,{ ,{
field: 'remarks', field: 'createDate',
title: '备注信息', title: '创建时间',
sortable: true, sortable: true,
sortName: 'remarks' sortName: 'createDate'
} }
] ]
...@@ -275,9 +275,9 @@ $(document).ready(function() { ...@@ -275,9 +275,9 @@ $(document).ready(function() {
var html = Mustache.render(htmltpl, { var html = Mustache.render(htmltpl, {
idx:row.id idx:row.id
}); });
$.get("${ctx}/warehouse/ledger/ledger/detail?id="+row.id, function(ledger){ $.get("${ctx}/warehouse/ledger/ledger/countLedger?id="+row.id, function(ledger){
var ledgerChild1RowIdx = 0, ledgerChild1Tpl = $("#ledgerChild1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,""); var ledgerChild1RowIdx = 0, ledgerChild1Tpl = $("#ledgerChild1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
var data1 = ledger.ledgerInfoList; var data1 = ledger.countLedgerInfoList;
for (var i=0; i<data1.length; i++){ for (var i=0; i<data1.length; i++){
data1[i].dict = {}; data1[i].dict = {};
addRow('#ledgerChild-'+row.id+'-1-List', ledgerChild1RowIdx, ledgerChild1Tpl, data1[i]); addRow('#ledgerChild-'+row.id+'-1-List', ledgerChild1RowIdx, ledgerChild1Tpl, data1[i]);
...@@ -312,7 +312,7 @@ $(document).ready(function() { ...@@ -312,7 +312,7 @@ $(document).ready(function() {
<th>型号</th> <th>型号</th>
<th>批次号</th> <th>批次号</th>
<th>货架</th> <th>货架</th>
<th>物资编码</th> <th>仓库</th>
</tr> </tr>
</thead> </thead>
<tbody id="ledgerChild-{{idx}}-1-List"> <tbody id="ledgerChild-{{idx}}-1-List">
...@@ -327,7 +327,7 @@ $(document).ready(function() { ...@@ -327,7 +327,7 @@ $(document).ready(function() {
{{row.name}} {{row.name}}
</td> </td>
<td> <td>
{{row.type.code}} {{row.type.name}}
</td> </td>
<td> <td>
{{row.model}} {{row.model}}
...@@ -336,22 +336,12 @@ $(document).ready(function() { ...@@ -336,22 +336,12 @@ $(document).ready(function() {
{{row.batchNum}} {{row.batchNum}}
</td> </td>
<td> <td>
{{row.ledger.id}} {{row.shelvesNames}}
</td> </td>
<td> <td>
{{row.goodsInfo.id}} {{row.warehouseNames}}
</td>
<td>
{{row.qr.id}}
</td>
<td>
{{row.shelves.name}}
</td>
<td>
{{row.code}}
</td>
<td>
{{row.remarks}}
</td> </td>
</tr>//--> </tr>//-->
</script> </script>
<%--
Created by IntelliJ IDEA.
User: yangzi
Date: 2023/2/21
Time: 10:29
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/webpage/include/taglib.jsp" %>
<div id="toolbar" class="text-left">
<c:if test="${mode == 'add' || mode == 'edit'}">
<a class="btn btn-primary btn-sm" onclick="addDetail('#detail_table')" title="新增"><i class="fa fa-plus"></i> 手动添加</a>
<a class="btn btn-primary btn-sm" onclick="addScan('#detail_table')" title="新增"><i class="fa fa-plus"></i> 扫码添加</a>
<a id="editAll" class="btn btn-primary btn-sm" onclick="addShelve('#detail_table')" title="新增"><i class="fa fa-plus"></i> 批量编辑货架</a>
</c:if>
</div>
<table id="detail_table" data-toolbar="#toolbar"></table>
<script>
var selector = "#detail_table";
function initTable(){
var data = ${fns:toJson(materialRequisition.materialRequisitionInfoList)};
$(selector).bootstrapTable({
data: data,
columns:[{checkbox: true},
{
field: 'no',
title: '序号',
align: 'center',
width: 60,
formatter: function (value, row, index){
var tpl = $("#hideTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
var html = Mustache.render(tpl, {
idx: index,
row: row
})
return html + '<span>'+(index+1)+'</span>'
}
},
{
field: 'name',
title: '名称',
formatter: function (value,row,index){
return Mustache.render($("#nameTpl").html(),{
row: row,
idx: index
})
}
},
{
field: 'type.name',
title: '类型',
formatter: function (value,row,index){
return Mustache.render($("#typeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'remarks',
title: '备注',
formatter: function (value,row,index){
return Mustache.render($("#remarksTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: '',
title: '操作',
formatter: function (value,row,index){
var text = row.delFlag == 1 ? '撤销删除' : '删除';
var result = ["<a href='javascript:void(0);' onclick=\"removeRow(" + index + ", '" + row.id + "', '" + row.delFlag + "')\">"+text+"</a>" ]
return result.join('');
}
}
]
});
$(selector).on('check.bs.table uncheck.bs.table load-success.bs.table ' +
'check-all.bs.table uncheck-all.bs.table', function () {
$('#editAll').prop('disabled', !getSelections().length);
});
}
function getSelections(){
return $(selector).bootstrapTable('getSelections');
}
/**
* 手动添加明细
* @param selector
*/
function addDetail(selector){
// 选择该批次号下的货品明细
if(!$("#batchNum").val()){
jp.warning('请选择批次号!');
return;
}
jp.openStorageSelectDialog({batchNum:$("#batchNum").val(),state: 0, isMultiSelect: true },function (items){
if(Array.isArray(items)){
var data = items.map(function (item){
if(item.goodsInfo && !item.goodsInfo.amount){
item.goodsInfo.amount = 0;
}
return {
id: '',
delFlag: 0,
remarks: '',
...item
}
})
$(selector).bootstrapTable('append', data)
}
})
}
function removeRow(index, rowId, rowDelFlag){
if(rowId){
var delFlag = rowDelFlag === 1 ? 0 : 1
updateRow(index, {
delFlag: delFlag
})
}else{
$(selector).bootstrapTable("remove", {
field: '$index',
values: [index]
})
}
}
function updateRow(index, row){
$(selector).bootstrapTable('updateRow', {
index: index,
row: row
})
}
function onInputChange(rowIndex, elem , field){
var obj = {};
obj[field] = $(elem).val()
var timer = null;
clearTimeout(timer);
timer = setTimeout(function (){
updateRow(rowIndex, obj)
}, 0)
}
function onSelectType(nodes, rowIndex){
if(Array.isArray(nodes) && nodes.length === 1){
var node = nodes[0];
var obj = {
type: {
id: node.id,
name: node.text
}
};
updateRow(rowIndex, obj)
}
}
/**
* 获取所有明细数据
* @returns {*|jQuery}
*/
function getTableData(){
return $(selector).bootstrapTable('getData');
}
function addShelve(){
jp.openShelvesSelectDialog(function (items){
var Shelve = items[0];
// TODO: 获取选中的明细下标
getSelections().forEach(function (item){
var index = getTableData().findIndex(function (current){
return current.qrCode.id === item.qrCode.id;
})
updateRow(index,{
shelves: {
id: Shelve.id,
name: Shelve.name
},
warehouse: Shelve.warehouse
})
})
})
}
/**
* 点击扫码显示扫码窗口
*/
function addScan(){
layer.open({
type: 1,
title: '扫码',
auto: true,
area: ['500','300'],
content: $("#scanResultTpl").html(),
success: function (){
$("#scanResult").focus();
},
btn:['关闭']
})
}
/**
* 扫码
* 一、获取扫码结果
* 二、请求后台接口获取结果
* 三、增一条明细数据
* 四、清空扫码结果
* @param elem
*/
function onScanChange(elem){
try{
var json = JSON.parse($(elem).val());
var qrCodeId = json.code;
var goodsInfoId = json.infoId;
jp.get('${ctx}/warehouse/goods/goods/getGIAndQCByTwoId?goodsInfoId='+goodsInfoId+"&qrCodeId="+qrCodeId, function (res){
var qrCode = res.body.qrCode;
$(selector).bootstrapTable('append',[
{
qrCode: qrCode,
goodsInfo: qrCode.goodsInfo,
...qrCode.goodsInfo,
id: '',
delFlag: 0,
remarks: ''
}
]);
$(elem).val('').focus();
})
}catch (e){
console.log(e);
}
}
</script>
<script id="hideTpl" type="text/html">
<input id="materialRequisitionInfoList{{idx}}_id" name="materialRequisitionInfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
<input id="materialRequisitionInfoList{{idx}}_delFlag" name="materialRequisitionInfoList[{{idx}}].delFlag" type="hidden" value="{{row.delFlag}}"/>
<input id="materialRequisitionInfoList{{idx}}_materialRequisition" name="materialRequisitionInfoList[{{idx}}].materialRequisition.id" type="hidden" value="{{row.materialRequisition.id}}"/>
</script>
<script id="ledgerInfoTpl" type="text/html">//<!--
<sys:gridselect url="${ctx}/warehouse/ledger/ledger/data" id="materialRequisitionInfoList{{idx}}_ledgerInfo" name="materialRequisitionInfoList[{{idx}}].ledgerInfo.id" value="{{row.ledgerInfo.id}}" labelName="materialRequisitionInfoList[{{idx}}].ledgerInfo.name" labelValue="{{row.ledgerInfo.name}}"
title="选择物资" cssClass="form-control required" fieldLabels="物资名称|物资编号" fieldKeys="name|code" searchLabels="仓库名称|仓库编号" searchKeys="name|code" ></sys:gridselect>//-->
</script>
<script id="typeTpl" type="text/html">//<!--
<sys:treeselect id="storageInfoList{{idx}}_type" name="storageInfoList[{{idx}}].type.id" value="{{row.type.id}}" labelName="storageInfoList{{idx}}.type.name" labelValue="{{row.type.name}}"
title="类型" url="/warehouse/materialtype/materialType/treeData" cssClass="form-control " disabled="disabled" allowClear="true" allowSearch="true" callback="onSelectType" />//-->
</script>
<script id="modelTpl" type="text/html">
<input id="storageInfoList{{idx}}_model" name="storageInfoList[{{idx}}].model" type="text" value="{{row.model}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
<script id="shelvesTpl" type="text/html">
<input id="storageInfoList{{idx}}_shelvesName" name="storageInfoList[{{idx}}].shelves.name" type="text" value="{{row.shelves.name}}" readonly class="form-control" />
</script>
<script id="remarksTpl" type="text/html">
<textarea id="storageInfoList{{idx}}_remarks" name="storageInfoList[{{idx}}].remarks" rows="2" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
</script>
<script id="scanResultTpl" type="text/html">
<br>
<div class="container-fluid">
<div class="row">
<div class="col-xs-2 text-right">
<label>扫码结果:</label>
</div>
<div class="col-xs-10">
<input type="text" id="scanResult" class="form-control" onchange="onScanChange(this)">
<span class="text-danger">请切换英文输入法</span>
</div>
</div>
</div>
<br>
</script>
\ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" %> <%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%> <%@ include file="/webpage/include/taglib.jsp" %>
<html> <html>
<head> <head>
<title>物资领用管理</title> <title>物资领用管理</title>
<meta name="decorator" content="ani"/> <meta name="decorator" content="ani"/>
<script type="text/javascript"> <link rel="stylesheet" href="${ctxStatic}/common/css/form.css">
<link rel="stylesheet" href="${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.css">
$(document).ready(function() { <script type="text/javascript" src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.js"></script>
jp.ajaxForm("#inputForm",function(data){ <script type="text/javascript" src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"></script>
if(data.success){
jp.success(data.msg);
jp.go("${ctx}/warehouse/materialrequisition/materialRequisition");
}else{
jp.error(data.msg);
$("#inputForm").find("button:submit").button("reset");
}
});
$('#time').datetimepicker({
format: "YYYY-MM-DD HH:mm:ss"
});
});
function addRow(list, idx, tpl, row){
$(list).append(Mustache.render(tpl, {
idx: idx, delBtn: true, row: row
}));
$(list+idx).find("select").each(function(){
$(this).val($(this).attr("data-value"));
});
$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
var ss = $(this).attr("data-value").split(',');
for (var i=0; i<ss.length; i++){
if($(this).val() == ss[i]){
$(this).attr("checked","checked");
}
}
});
$(list+idx).find(".form_datetime").each(function(){
$(this).datetimepicker({
format: "YYYY-MM-DD HH:mm:ss"
});
});
}
function delRow(obj, prefix){
var id = $(prefix+"_id");
var delFlag = $(prefix+"_delFlag");
if (id.val() == ""){
$(obj).parent().parent().remove();
}else if(delFlag.val() == "0"){
delFlag.val("1");
$(obj).html("&divide;").attr("title", "撤销删除");
$(obj).parent().parent().addClass("error");
}else if(delFlag.val() == "1"){
delFlag.val("0");
$(obj).html("&times;").attr("title", "删除");
$(obj).parent().parent().removeClass("error");
}
}
</script>
</head> </head>
<body> <body>
<div class="wrapper wrapper-content"> <div class="wrapper wrapper-content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="panel panel-primary"> <div class="panel panel-primary">
<div class="panel-heading"> <div class="panel-body">
<h3 class="panel-title"> <form:form id="inputForm" modelAttribute="materialRequisition"
<a class="panelButton" href="${ctx}/warehouse/materialrequisition/materialRequisition"><i class="ti-angle-left"></i> 返回</a> action="${ctx}/warehouse/materialrequisition/materialRequisition/save" method="post"
</h3> class="form-horizontal">
</div> <form:hidden path="id"/>
<div class="panel-body"> <h3 class="物资领用表"></h3>
<form:form id="inputForm" modelAttribute="materialRequisition" action="${ctx}/warehouse/materialrequisition/materialRequisition/save" method="post" class="form-horizontal"> <table class="table table-bordered main-table">
<form:hidden path="id"/> <tr>
<div class="form-group"> <td> <font color="red">*</font>领用单号</td>
<label class="col-sm-2 control-label">领用单号:</label> <td>
<div class="col-sm-10"> <form:input path="number" htmlEscape="false" readonly="true" class="form-control required"/>
<form:input path="number" htmlEscape="false" class="form-control "/> </td>
</div> <td><font color="red">*</font>操作人</td>
</div> <td>
<div class="form-group"> <sys:userselect id="operator" name="operator.id"
<label class="col-sm-2 control-label">操作人:</label> value="${materialRequisition.operator.id}" labelName="operator.name"
<div class="col-sm-10"> labelValue="${materialRequisition.operator.name}" disabled="disabled"
<div class="col-sm-10"> cssClass="form-control required"/>
<sys:userselect id="operator" name="operator.id" value="${materialRequisition.operator.id}" labelName="operator.name" labelValue="${materialRequisition.operator.name}" </td>
cssClass="form-control "/> </tr>
</div> <tr>
<%-- <form:input path="operator" htmlEscape="false" class="form-control "/>--%> <td><font color="red">*</font>领用机构</td>
</div> <td>
</div> <sys:treeselect id="office" name="office.id" value="${materialRequisition.office.id}"
labelName="" labelValue="${materialRequisition.office.name}"
<div class="form-group"> title="部门" url="/sys/office/treeData?type=2" cssClass="form-control required"
<label class="col-sm-2 control-label">领用机构:</label> allowClear="true" notAllowSelectParent="true"/>
<div class="col-sm-10"> </td>
<sys:treeselect id="office" name="office.id" value="${materialRequisition.office.id}" labelName="" labelValue="${materialRequisition.office.name}" <td><font color="red">*</font>领用时间</td>
title="部门" url="/sys/office/treeData?type=2" cssClass="form-control " allowClear="true" notAllowSelectParent="true"/> <td>
</div> <div class='input-group form_datetime' id='time'>
</div> <input type='text' name="time" class="form-control "
<div class="form-group"> value="<fmt:formatDate value="${materialRequisition.time}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
<label class="col-sm-2 control-label">领用时间:</label> <span class="input-group-addon">
<div class="col-sm-10"> <span class="glyphicon glyphicon-calendar"></span>
<div class='input-group form_datetime' id='time'> </span>
<input type='text' name="time" class="form-control " value="<fmt:formatDate value="${materialRequisition.time}" pattern="yyyy-MM-dd HH:mm:ss"/>"/> </div>
<span class="input-group-addon"> </td>
<span class="glyphicon glyphicon-calendar"></span> </tr>
</span> <tr>
</div> <td>备注</td>
</div> <td>
</div> <form:textarea path="remarks" htmlEscape="false" rows="4" class="form-control "/>
<div class="form-group"> </td>
<label class="col-sm-2 control-label">备注信息:</label> </tr>
<div class="col-sm-10"> </table>
<form:textarea path="remarks" htmlEscape="false" rows="4" class="form-control "/> <div class="tabs-container">
</div> <ul class="nav nav-tabs">
</div> <li class="active"><a data-toggle="tab" href="#tab-1"
<div class="tabs-container"> aria-expanded="true">领用明细表:</a>
<ul class="nav nav-tabs"> </li>
<li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">领用明细表:</a> </ul>
</li> <div class="tab-content">
</ul> <div id="tab-1" class="tab-pane fade in active">
<div class="tab-content"> <a class="btn btn-white btn-sm"
<div id="tab-1" class="tab-pane fade in active"> onclick="addRow('#materialRequisitionInfoList', materialRequisitionInfoRowIdx, materialRequisitionInfoTpl);materialRequisitionInfoRowIdx = materialRequisitionInfoRowIdx + 1;"
<a class="btn btn-white btn-sm" onclick="addRow('#materialRequisitionInfoList', materialRequisitionInfoRowIdx, materialRequisitionInfoTpl);materialRequisitionInfoRowIdx = materialRequisitionInfoRowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a> title="新增"><i class="fa fa-plus"></i> 新增</a>
<table class="table table-striped table-bordered table-condensed"> <table class="table table-striped table-bordered table-condensed">
<thead> <thead>
<tr> <tr>
<th class="hide"></th> <th class="hide"></th>
<th>物资领用主表ID</th> <th>物资领用主表ID</th>
<th>物资台账明细ID</th> <th>物资台账明细ID</th>
<th>领用人</th> <th>领用人</th>
<th>备注信息</th> <th>备注信息</th>
<th width="10">&nbsp;</th> <th width="10">&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody id="materialRequisitionInfoList"> <tbody id="materialRequisitionInfoList">
</tbody> </tbody>
</table> </table>
<script type="text/template" id="materialRequisitionInfoTpl">//<!-- <script type="text/template" id="materialRequisitionInfoTpl">//<!--
<tr id="materialRequisitionInfoList{{idx}}"> <tr id="materialRequisitionInfoList{{idx}}">
<td class="hide"> <td class="hide">
<input id="materialRequisitionInfoList{{idx}}_id" name="materialRequisitionInfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/> <input id="materialRequisitionInfoList{{idx}}_id" name="materialRequisitionInfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
...@@ -164,35 +113,56 @@ ...@@ -164,35 +113,56 @@
{{#delBtn}}<span class="close" onclick="delRow(this, '#materialRequisitionInfoList{{idx}}')" title="删除">&times;</span>{{/delBtn}} {{#delBtn}}<span class="close" onclick="delRow(this, '#materialRequisitionInfoList{{idx}}')" title="删除">&times;</span>{{/delBtn}}
</td> </td>
</tr>//--> </tr>//-->
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
var materialRequisitionInfoRowIdx = 0, materialRequisitionInfoTpl = $("#materialRequisitionInfoTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,""); var materialRequisitionInfoRowIdx = 0,
$(document).ready(function() { materialRequisitionInfoTpl = $("#materialRequisitionInfoTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
var data = ${fns:toJson(materialRequisition.materialRequisitionInfoList)}; $(document).ready(function () {
for (var i=0; i<data.length; i++){ var data = ${fns:toJson(materialRequisition.materialRequisitionInfoList)};
addRow('#materialRequisitionInfoList', materialRequisitionInfoRowIdx, materialRequisitionInfoTpl, data[i]); for (var i = 0; i < data.length; i++) {
materialRequisitionInfoRowIdx = materialRequisitionInfoRowIdx + 1; addRow('#materialRequisitionInfoList', materialRequisitionInfoRowIdx, materialRequisitionInfoTpl, data[i]);
} materialRequisitionInfoRowIdx = materialRequisitionInfoRowIdx + 1;
}); }
</script> });
</div> </script>
</div> </div>
</div> </div>
<c:if test="${mode == 'add' || mode=='edit'}"> </div>
<div class="col-lg-3"></div> <c:if test="${mode == 'add' || mode=='edit'}">
<div class="col-lg-6"> <div class="col-lg-3"></div>
<div class="form-group text-center"> <div class="col-lg-6">
<div> <div class="form-group text-center">
<button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button> <div>
</div> <button class="btn btn-primary btn-block btn-lg btn-parsley"
</div> data-loading-text="正在提交...">提 交
</div> </button>
</c:if> </div>
</form:form> </div>
</div> </div>
</div> </c:if>
</div> </form:form>
</div> </div>
</div>
</div>
</div>
</div> </div>
<script type="text/javascript">
$(document).ready(function() {
jp.ajaxForm("#inputForm",function(data){
if(data.success){
jp.success(data.msg);
jp.go("${ctx}/warehouse/materialrequisition/materialRequisition");
}else{
jp.error(data.msg);
$("#inputForm").find("button:submit").button("reset");
}
});
$('#time').datetimepicker({
format: "YYYY-MM-DD HH:mm:ss"
});
});
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -242,21 +242,21 @@ $(document).ready(function() { ...@@ -242,21 +242,21 @@ $(document).ready(function() {
$('#materialRequisitionTable').bootstrapTable('refresh'); $('#materialRequisitionTable').bootstrapTable('refresh');
} }
function add(){ function add(){
jp.go("${ctx}/warehouse/materialrequisition/materialRequisition/form/add"); jp.openSaveDialog("新增物资领用","${ctx}/warehouse/materialrequisition/materialRequisition/form/add",'1200','800');
} }
function edit(id){ function edit(id){
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.go("${ctx}/warehouse/materialrequisition/materialRequisition/form/edit?id=" + id); jp.openSaveDialog("编辑物资领用","${ctx}/warehouse/materialrequisition/materialRequisition/form/edit?id=" + id, '1200','800');
} }
function view(id){//没有权限时,不显示确定按钮 function view(id){//没有权限时,不显示确定按钮
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.go("${ctx}/warehouse/materialrequisition/materialRequisition/form/view?id=" + id); jp.openViewDialog("查看物资领用","${ctx}/warehouse/materialrequisition/materialRequisition/form/view?id=" + id,'1200','800');
} }
......
...@@ -284,6 +284,7 @@ $(document).ready(function() { ...@@ -284,6 +284,7 @@ $(document).ready(function() {
data1[i].jsonStr = JSON.stringify(data1[i]); data1[i].jsonStr = JSON.stringify(data1[i]);
data1[i].isNotStorage = data1[i].state === '1'; data1[i].isNotStorage = data1[i].state === '1';
data1[i].isStorage = data1[i].state === '2'; data1[i].isStorage = data1[i].state === '2';
data1[i].mainRowIndex = index;
addRow('#storageChild-'+row.id+'-1-List', storageChild1RowIdx, storageChild1Tpl, data1[i]); addRow('#storageChild-'+row.id+'-1-List', storageChild1RowIdx, storageChild1Tpl, data1[i]);
storageChild1RowIdx = storageChild1RowIdx + 1; storageChild1RowIdx = storageChild1RowIdx + 1;
} }
...@@ -300,7 +301,7 @@ $(document).ready(function() { ...@@ -300,7 +301,7 @@ $(document).ready(function() {
})); }));
} }
function onStorage(countStorage, goodsInfoId){ function onStorage(countStorage, goodsInfoId, rowIndex){
var main = JSON.parse(countStorage); var main = JSON.parse(countStorage);
jp.get("${ctx}/warehouse/storage/storage/findInfoBycountStorage?goodsInfo.id="+goodsInfoId+"&storage="+main.storageId, function (res){ jp.get("${ctx}/warehouse/storage/storage/findInfoBycountStorage?goodsInfo.id="+goodsInfoId+"&storage="+main.storageId, function (res){
var data = res.body.storageInfoList; var data = res.body.storageInfoList;
...@@ -330,12 +331,16 @@ $(document).ready(function() { ...@@ -330,12 +331,16 @@ $(document).ready(function() {
var qrId$ = $("<input type='hidden' name='ledgerInfoList["+index+"].qr.id' value='"+item.qrCode.id+"' />"); var qrId$ = $("<input type='hidden' name='ledgerInfoList["+index+"].qr.id' value='"+item.qrCode.id+"' />");
var shelvesId$ = $("<input type='hidden' name='ledgerInfoList["+index+"].shelves.id' value='"+item.shelves.id+"' />"); var shelvesId$ = $("<input type='hidden' name='ledgerInfoList["+index+"].shelves.id' value='"+item.shelves.id+"' />");
var code$ = $("<input type='hidden' name='ledgerInfoList["+index+"].code' value='"+item.qrCode.code+"' />"); var code$ = $("<input type='hidden' name='ledgerInfoList["+index+"].code' value='"+item.qrCode.code+"' />");
$("#ledgerForm").append(delFlag$).append(name$).append(typeId$).append(batchNum$).append(model$).append(goodsInfoId$).append(qrId$).append(shelvesId$).append(code$); $("#ledgerForm").append(id$).append(delFlag$).append(name$).append(typeId$).append(batchNum$).append(model$).append(goodsInfoId$).append(qrId$).append(shelvesId$).append(code$);
}) })
jp.loading('入库中...'); jp.loading('入库中...');
jp.post("${ctx}/warehouse/ledger/ledger/save", $("#ledgerForm").serialize(), function (res){ jp.post("${ctx}/warehouse/ledger/ledger/save", $("#ledgerForm").serialize(), function (res){
if(res.success){ if(res.success){
jp.success('入库成功!'); jp.success('入库成功!');
$('#storageTable').bootstrapTable('collapseRow', rowIndex);
setTimeout(function (){
$('#storageTable').bootstrapTable('expandRow', rowIndex);
},0)
}else { }else {
jp.error('入库失败!'); jp.error('入库失败!');
} }
...@@ -396,7 +401,7 @@ $(document).ready(function() { ...@@ -396,7 +401,7 @@ $(document).ready(function() {
</td> </td>
{{#row.isNotStorage}} {{#row.isNotStorage}}
<td> <td>
<a href="javascript:void(0);" onclick="onStorage('{{row.jsonStr}}','{{row.goodsInfo.id}}')">入库</a> <a href="javascript:void(0);" onclick="onStorage('{{row.jsonStr}}','{{row.goodsInfo.id}}',{{row.mainRowIndex}})">入库</a>
</td> </td>
{{/row.isNotStorage}} {{/row.isNotStorage}}
{{#row.isStorage}} {{#row.isStorage}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment