Commit da858e6d by anxiaohe

入库信息表单

parent 32c60d61
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<%@ attribute name="dataMsgRequired" type="java.lang.String" required="false" description=""%> <%@ attribute name="dataMsgRequired" type="java.lang.String" required="false" description=""%>
<%@ attribute name="callback" type="java.lang.String" required="false" description="回调"%> <%@ attribute name="callback" type="java.lang.String" required="false" description="回调"%>
<%@ attribute name="iframeUrl" type="java.lang.String" required="false" description="iframe窗口"%> <%@ attribute name="iframeUrl" type="java.lang.String" required="false" description="iframe窗口"%>
<%@ attribute name="allowClear" type="java.lang.Boolean" required="false" description="是否允许清除"%>
<input id="${id}Id" class="${cssClass} form-control" type="hidden" value="${value}"/> <input id="${id}Id" class="${cssClass} form-control" type="hidden" value="${value}"/>
<div class="input-group" style="width:100%"> <div class="input-group" style="width:100%">
<input id="${id}Name" ${allowInput?'':'readonly="readonly"'} type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}" <input id="${id}Name" ${allowInput?'':'readonly="readonly"'} type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
...@@ -20,7 +21,9 @@ ...@@ -20,7 +21,9 @@
<span class="input-group-btn"> <span class="input-group-btn">
<button type="button" id="${id}Button" class="btn <c:if test="${fn:contains(cssClass, 'input-sm')}"> btn-sm </c:if><c:if test="${fn:contains(cssClass, 'input-lg')}"> btn-lg </c:if> btn-primary ${disabled} ${hideBtn ? 'hide' : ''}"><i class="fa fa-search"></i> <button type="button" id="${id}Button" class="btn <c:if test="${fn:contains(cssClass, 'input-sm')}"> btn-sm </c:if><c:if test="${fn:contains(cssClass, 'input-lg')}"> btn-lg </c:if> btn-primary ${disabled} ${hideBtn ? 'hide' : ''}"><i class="fa fa-search"></i>
</button> </button>
<c:if test="${allowClear}">
<button type="button" id="${id}DelButton" class="close" data-dismiss="alert" style="position: absolute; top: 5px; right: 53px; z-index: 999; display: block;">×</button> <button type="button" id="${id}DelButton" class="close" data-dismiss="alert" style="position: absolute; top: 5px; right: 53px; z-index: 999; display: block;">×</button>
</c:if>
</span> </span>
</div> </div>
......
...@@ -368,11 +368,15 @@ ...@@ -368,11 +368,15 @@
shelvesNames: '', shelvesNames: '',
warehouseNames: '' warehouseNames: ''
}; };
var warehouseIdMap = {};
items.forEach(function (item) { items.forEach(function (item) {
obj.shelvesIds += item.id + ','; obj.shelvesIds += item.id + ',';
obj.shelvesNames += item.name + ','; obj.shelvesNames += item.name + ',';
if (!warehouseIdMap[item.warehouse.id]) {
obj.warehouseIds += item.warehouse.id + ','; obj.warehouseIds += item.warehouse.id + ',';
obj.warehouseNames += item.warehouse.name + ',' obj.warehouseNames += item.warehouse.name + ',';
warehouseIdMap[item.warehouse.id] = true;
}
}) })
var realSelections = []; // 保存真实选中的数据 var realSelections = []; // 保存真实选中的数据
...@@ -530,11 +534,11 @@ ...@@ -530,11 +534,11 @@
<script id="shelvesTpl" type="text/html">//<!-- <script id="shelvesTpl" type="text/html">//<!--
{{#row.readonly}} {{#row.readonly}}
<sys:shelvesselectNotName id="storageInfoList{{idx}}_shelves" name="storageInfoList[{{idx}}].shelvesIds" value="{{row.shelvesIds}}" labelName="storageInfoList[{{idx}}].shelvesNames" labelValue="{{row.shelvesNames}}" <sys:shelvesselectNotName id="storageInfoList{{idx}}_shelves" name="storageInfoList[{{idx}}].shelvesIds" value="{{row.shelvesIds}}" labelName="storageInfoList[{{idx}}].shelvesNames" labelValue="{{row.shelvesNames}}"
cssClass="form-control required" iframeUrl="/warehouse/storage/storage/form" disabled="disabled" isMultiSelected="true" /> cssClass="form-control required" iframeUrl="/warehouse/storage/storage/form" disabled="disabled" isMultiSelected="true" allowClear="false" />
{{/row.readonly}} {{/row.readonly}}
{{^row.readonly}} {{^row.readonly}}
<sys:shelvesselectNotName id="storageInfoList{{idx}}_shelves" name="storageInfoList[{{idx}}].shelvesIds" value="{{row.shelvesIds}}" labelName="storageInfoList[{{idx}}].shelvesNames" labelValue="{{row.shelvesNames}}" <sys:shelvesselectNotName id="storageInfoList{{idx}}_shelves" name="storageInfoList[{{idx}}].shelvesIds" value="{{row.shelvesIds}}" labelName="storageInfoList[{{idx}}].shelvesNames" labelValue="{{row.shelvesNames}}"
cssClass="form-control required" iframeUrl="/warehouse/storage/storage/form" callback="onSelectShelves" isMultiSelected="true" />//--> cssClass="form-control required" iframeUrl="/warehouse/storage/storage/form" callback="onSelectShelves" isMultiSelected="true" allowClear="false" />//-->
{{/row.readonly}} {{/row.readonly}}
</script> </script>
<script id="remarksTpl" type="text/html"> <script id="remarksTpl" type="text/html">
......
...@@ -142,11 +142,12 @@ ...@@ -142,11 +142,12 @@
/**处理明细隐藏input元素*/ /**处理明细隐藏input元素*/
jp.loading(); jp.loading();
getTableData().forEach(function(item,index){ getTableData().forEach(function(item,index){
$("#inputForm").append(Mustache.render($("#hideTpl").html(),{ $("#inputForm").append("<div class='inputForm-hide-content'>" + Mustache.render($("#hideTpl").html(),{
row: item, row: item,
idx: index idx: index
})) }) + "</div>")
}) })
try {
jp.post($("#inputForm").attr('action'),$('#inputForm').serialize(),function(data){ jp.post($("#inputForm").attr('action'),$('#inputForm').serialize(),function(data){
if(data.success){ if(data.success){
jp.getParent().refresh(); jp.getParent().refresh();
...@@ -156,8 +157,13 @@ ...@@ -156,8 +157,13 @@
}else{ }else{
jp.error(data.msg); jp.error(data.msg);
$(".inputForm-hide-content").remove();
} }
}) })
} catch (e) {
$(".inputForm-hide-content").remove();
}
} }
} }
......
...@@ -273,8 +273,8 @@ $(document).ready(function() { ...@@ -273,8 +273,8 @@ $(document).ready(function() {
data1[i].storageId = row.id; data1[i].storageId = row.id;
data1[i].batchNum = row.batchNum; data1[i].batchNum = row.batchNum;
data1[i].jsonStr = JSON.stringify(data1[i]); data1[i].jsonStr = JSON.stringify(data1[i]);
data1[i].isNotStorage = data1[i].state !== '2'; data1[i].isNotStorage = data1[i].qrCode.state !== '2';
data1[i].isStorage = data1[i].state === '2'; data1[i].isStorage = data1[i].qrCode.state === '2';
data1[i].mainRowIndex = index; data1[i].mainRowIndex = index;
item.infoSum = new Big(item.num).times(item.amount).toNumber(); item.infoSum = new Big(item.num).times(item.amount).toNumber();
item.shelvesNames = item.shelvesList.map(function (e) { item.shelvesNames = item.shelvesList.map(function (e) {
......
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