Commit da3c02e5 by anxiaohe

盘盈盘亏

parent 91cf88d6
...@@ -85,7 +85,7 @@ var pageConfig = { ...@@ -85,7 +85,7 @@ var pageConfig = {
// 图片高度 // 图片高度
Image_h: 63, Image_h: 63,
// 图片阈值 // 图片阈值
Image_Threshold: 170, Image_Threshold: 220,
// 图片打印模式 // 图片打印模式
Image_style_let: 3, Image_style_let: 3,
} }
...@@ -154,6 +154,18 @@ function printImage (url) { ...@@ -154,6 +154,18 @@ function printImage (url) {
] ]
} }
console.log(pack) console.log(pack)
var str = JSON.stringify(pack, null, 2);
var blob = new Blob([str], {
type: "application/json"
});
var url = URL.createObjectURL(blob);
var a = document.createElement('a');
a.href = url;
a.download = 'a.json';
a.click();
a.remove();
on_link_device(pack, onBack); on_link_device(pack, onBack);
}) })
......
...@@ -44,30 +44,30 @@ ...@@ -44,30 +44,30 @@
} }
}, },
{ {
field: 'ledgerInfo.name', field: 'ledgerInfo.code',
title: '物资名称', title: '物资编码',
formatter: function (value, row, index) { formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoNameTpl").html(), { return Mustache.render($("#ledgerInfoCodeTpl").html(), {
row: row, row: row,
idx: index idx: index
}) })
} }
}, },
{ {
field: 'ledgerInfo.code', field: 'ledgerInfo.type.name',
title: '物资编码', title: '品名',
formatter: function (value, row, index) { formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoCodeTpl").html(), { return Mustache.render($("#ledgerInfoTypeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row, row: row,
idx: index idx: index
}) })
} }
}, },
{ {
field: 'ledgerInfo.type.name', field: 'ledgerInfo.type.code',
title: '品名代码', title: '代码',
formatter: function (value, row, index) { formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoTypeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), { return Mustache.render($("#ledgerInfoTypeCodeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row, row: row,
idx: index idx: index
}) })
...@@ -94,6 +94,16 @@ ...@@ -94,6 +94,16 @@
} }
}, },
{ {
field: 'ledgerInfo.type.unit',
title: '单位',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoTypeUnitTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
}
},
{
field: 'ledgerInfo.batchNum', field: 'ledgerInfo.batchNum',
title: '批次号', title: '批次号',
formatter: function (value, row, index) { formatter: function (value, row, index) {
...@@ -246,6 +256,16 @@ ...@@ -246,6 +256,16 @@
<sys:treeselect id="materialLossInfoList{{idx}}_ledgerInfoType" name="materialLossInfoList[{{idx}}].ledgerInfo.type.id" value="{{row.ledgerInfo.type.id}}" labelName="materialLossInfoList{{idx}}.ledgerInfo.type.name" labelValue="{{row.ledgerInfo.type.name}}" <sys:treeselect id="materialLossInfoList{{idx}}_ledgerInfoType" name="materialLossInfoList[{{idx}}].ledgerInfo.type.id" value="{{row.ledgerInfo.type.id}}" labelName="materialLossInfoList{{idx}}.ledgerInfo.type.name" labelValue="{{row.ledgerInfo.type.name}}"
title="品名代码" url="/warehouse/materialtype/materialType/treeData" cssClass="form-control " disabled="disabled" allowClear="true"/>//--> title="品名代码" url="/warehouse/materialtype/materialType/treeData" cssClass="form-control " disabled="disabled" allowClear="true"/>//-->
</script> </script>
<script id="ledgerInfoTypeCodeTpl" type="text/html">
<input id="materialLossInfoList{{idx}}_ledgerInfoTypeCode"
name="materialLossInfoList[{{idx}}].ledgerInfo.type.code" type="text" class="form-control" readonly
value="{{row.ledgerInfo.type.code}}"/>
</script>
<script id="ledgerInfoTypeUnitTpl" type="text/html">
<input id="materialLossInfoList{{idx}}_ledgerInfoTypeUnit"
name="materialLossInfoList[{{idx}}].ledgerInfo.type.unit" type="text" class="form-control" readonly
value="{{row.ledgerInfo.type.unit}}"/>
</script>
<script id="ledgerInfoModelTpl" type="text/html"> <script id="ledgerInfoModelTpl" type="text/html">
<input id="materialLossInfoList{{idx}}_ledgerInfoModel" <input id="materialLossInfoList{{idx}}_ledgerInfoModel"
name="materialLossInfoList[{{idx}}].ledgerInfo.model" type="text" class="form-control" readonly name="materialLossInfoList[{{idx}}].ledgerInfo.model" type="text" class="form-control" readonly
......
...@@ -289,11 +289,13 @@ $(document).ready(function() { ...@@ -289,11 +289,13 @@ $(document).ready(function() {
<table class="ani table"> <table class="ani table">
<thead> <thead>
<tr> <tr>
<th>物资名称</th>
<th>物资编号</th> <th>物资编号</th>
<th>品名代码</th> <th>品名</th>
<th>代码</th>
<th>型号</th> <th>型号</th>
<th>单价</th> <th>单价</th>
<th>单位</th>
<th>批次号</th> <th>批次号</th>
<th>货架</th> <th>货架</th>
<th>仓库</th> <th>仓库</th>
...@@ -308,9 +310,7 @@ $(document).ready(function() { ...@@ -308,9 +310,7 @@ $(document).ready(function() {
</script> </script>
<script type="text/template" id="materialLossChild1Tpl">//<!-- <script type="text/template" id="materialLossChild1Tpl">//<!--
<tr> <tr>
<td>
{{row.ledgerInfo.name}}
</td>
<td> <td>
{{row.ledgerInfo.code}} {{row.ledgerInfo.code}}
</td> </td>
...@@ -318,12 +318,18 @@ $(document).ready(function() { ...@@ -318,12 +318,18 @@ $(document).ready(function() {
{{row.ledgerInfo.type.name}} {{row.ledgerInfo.type.name}}
</td> </td>
<td> <td>
{{row.ledgerInfo.type.code}}
</td>
<td>
{{row.ledgerInfo.model}} {{row.ledgerInfo.model}}
</td> </td>
<td> <td>
{{row.ledgerInfo.amount}} {{row.ledgerInfo.amount}}
</td> </td>
<td> <td>
{{row.ledgerInfo.type.unit}}
</td>
<td>
{{row.ledgerInfo.batchNum}} {{row.ledgerInfo.batchNum}}
</td> </td>
<td> <td>
......
...@@ -321,16 +321,16 @@ function addRow(list, idx, tpl, row){ ...@@ -321,16 +321,16 @@ function addRow(list, idx, tpl, row){
</script> </script>
<script type="text/template" id="outboundChild1Tpl">//<!-- <script type="text/template" id="outboundChild1Tpl">//<!--
<tr> <tr>
<td>
{{row.ledgerInfo.code}}
</td>
<td> <td>
{{row.ledgerInfo.type.name}} {{row.ledgerInfo.type.name}}
</td> </td>
<td> <td>
{{row.ledgerInfo.type.code}} {{row.ledgerInfo.type.code}}
</td> </td>
<td>
{{row.ledgerInfo.code}}
</td>
<td> <td>
{{row.ledgerInfo.type.unit}} {{row.ledgerInfo.type.unit}}
</td> </td>
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
function initTable(){ function initTable(){
var data = ${fns:toJson(profitWarehousing.profitWarehousingInfoList)}; var data = ${fns:toJson(profitWarehousing.profitWarehousingInfoList)};
if(data.length){ if(data.length){
debugger
data = data.map(function(item){ data = data.map(function(item){
item.delFlag = 0; item.delFlag = 0;
item.readonly = item.qrCode && item.qrCode.state === '2' item.readonly = item.qrCode && item.qrCode.state === '2'
...@@ -44,21 +45,51 @@ ...@@ -44,21 +45,51 @@
return html + '<span>'+(index+1)+'</span>' return html + '<span>'+(index+1)+'</span>'
} }
}, },
// {
// field: 'name',
// title: '名称',
// formatter: function (value,row,index){
// return Mustache.render($("#nameTpl").html(),{
// row: row,
// idx: index
// })
// }
// },
{ {
field: 'name', field: 'type.name',
title: '名称', title: '品名',
formatter: function (value,row,index){ formatter: function (value,row,index){
return Mustache.render($("#nameTpl").html(),{ return Mustache.render($("#typeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row, row: row,
idx: index idx: index
}) })
} }
}, },
{ {
field: 'type.name', field: 'type.code',
title: '品名代码', title: '代码',
formatter: function (value,row,index) {
return Mustache.render($("#typeCodeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'amount',
title: '单价',
formatter: function (value,row,index){ formatter: function (value,row,index){
return Mustache.render($("#typeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{ return Mustache.render($("#amountTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'type.unit',
title: '单位',
formatter: function (value,row,index){
return Mustache.render($("#unitTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row, row: row,
idx: index idx: index
}) })
...@@ -75,7 +106,17 @@ ...@@ -75,7 +106,17 @@
} }
}, },
{ {
field: 'shelves.name', field: 'num',
title: '数量',
formatter: function (value,row,index){
return Mustache.render($("#numTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'shelvesIds',
title: '货架', title: '货架',
formatter: function (value,row,index){ formatter: function (value,row,index){
return Mustache.render($("#shelvesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{ return Mustache.render($("#shelvesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
...@@ -85,10 +126,10 @@ ...@@ -85,10 +126,10 @@
} }
}, },
{ {
field: 'amount', field: 'warehouseIds',
title: '单价', title: '仓库',
formatter: function (value,row,index){ formatter: function (value,row,index){
return Mustache.render($("#amountTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{ return Mustache.render($("#warehouseTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row, row: row,
idx: index idx: index
}) })
...@@ -175,10 +216,48 @@ ...@@ -175,10 +216,48 @@
* @param elem 元素 * @param elem 元素
* @param field 属性 * @param field 属性
*/ */
// function onInputChange(rowIndex, elem , field){
// var obj = {};
// obj[field] = $(elem).val()
// updateRow(rowIndex, obj)
// if(field === 'amount' && obj[field]) {
// // 正则表达式验证可以带小数点的数字
// // 不是数字
// if(!/^(?:[1-9]\d*|0)(?:\.\d{1,2})?$/.test(obj[field])) {
// jp.warning("输入正确的金额");
// $(elem).val('')
// return
// }
// setSumPrice();
// }
// }
function onInputChange(rowIndex, elem , field){ function onInputChange(rowIndex, elem , field){
var obj = {}; var obj = {};
obj[field] = $(elem).val() obj[field] = $(elem).val();
updateRow(rowIndex, obj) debugger
// 校验数量与单价
if(field === 'num' && obj[field]){
// 正则表达式验证可以带小数点的数字
var reg = new RegExp("^[0-9]+(.[0-9]{1,2})?$");
// 不是数字
if(!reg.test(obj[field])){
jp.warning("必须是数字");
$(elem).val('')
return
}
if (Number(obj[field]) <= 0) {
jp.warning("数量不能小于等于0");
$(elem).val('');
return;
}
if ($("#profitWarehousingInfoList" + rowIndex + "_amount").val()) {
obj.infoSum = new Big($("#profitWarehousingInfoList" + rowIndex + "_amount").val()).times(obj[field]).toNumber();
}
}
if(field === 'amount' && obj[field]) { if(field === 'amount' && obj[field]) {
// 正则表达式验证可以带小数点的数字 // 正则表达式验证可以带小数点的数字
// 不是数字 // 不是数字
...@@ -187,15 +266,35 @@ ...@@ -187,15 +266,35 @@
$(elem).val('') $(elem).val('')
return return
} }
if ($("#profitWarehousingInfoList" + rowIndex + "_num").val()) {
obj.infoSum = new Big($("#profitWarehousingInfoList" + rowIndex + "_num").val()).times(obj[field]).toNumber();
}
}
updateRow(rowIndex, obj);
if((field === 'num' && obj[field]) || (field === 'amount' && obj[field])) {
setSumPrice(); setSumPrice();
} }
} }
// function setSumPrice(){
// var data = $(selector).bootstrapTable('getData');
// var sum = data.reduce(function (sum, current){
// if(current.delFlag != 1 && current.amount){
// return new Big(current.amount).plus(sum);
// }
// return new Big(sum);
// },0)
// $("#sum").val(sum);
// }
function setSumPrice(){ function setSumPrice(){
var data = $(selector).bootstrapTable('getData'); var data = $(selector).bootstrapTable('getData');
var sum = data.reduce(function (sum, current){ var sum = data.reduce(function (sum, current){
if(current.delFlag != 1 && current.amount){ if(current.delFlag != 1 && current.amount && current.num){
return new Big(current.amount).plus(sum); var total = new Big(current.amount).times(current.num).toNumber();
return new Big(sum).plus(total);
} }
return new Big(sum); return new Big(sum);
},0) },0)
...@@ -207,32 +306,62 @@ ...@@ -207,32 +306,62 @@
* @param nodes 选中数据 * @param nodes 选中数据
* @param rowIndex 行下标 * @param rowIndex 行下标
*/ */
function onSelectType(nodes, rowIndex){ // function onSelectType(nodes, rowIndex){
if(Array.isArray(nodes) && nodes.length === 1){ // if(Array.isArray(nodes) && nodes.length === 1){
var node = nodes[0]; // var node = nodes[0];
var obj = { // var obj = {
type: { // type: {
id: node.id, // id: node.id,
name: node.text // name: node.text
} // }
}; // };
updateRow(rowIndex, obj) // updateRow(rowIndex, obj)
} // }
} // }
function onSelectShelves(nodes, rowIndex){ function onSelectShelves(nodes, rowIndex){
if(Array.isArray(nodes) && nodes.length === 1){ if(Array.isArray(nodes)){
var node = nodes[0];
var obj = { var obj = {
shelves: { shelvesIds: '',
id: node.id, warehouseIds: '',
name: node.name shelvesNames: '',
}, warehouseNames: ''
warehouse: node.warehouse
}; };
var warehouseIdMap = {};
nodes.forEach(function (item) {
obj.shelvesIds += item.id + ',';
obj.shelvesNames += item.name + ',';
if (!warehouseIdMap[item.warehouse.id]) {
obj.warehouseIds += item.warehouse.id + ',';
obj.warehouseNames += item.warehouse.name + ',';
warehouseIdMap[item.warehouse.id] = true;
}
})
// var node = nodes[0];
// var obj = {
// shelves: {
// id: node.id,
// name: node.name
// },
// warehouse: node.warehouse
// };
updateRow(rowIndex, obj) updateRow(rowIndex, obj)
} }
} }
// function onSelectShelves(nodes, rowIndex){
// if(Array.isArray(nodes) && nodes.length === 1){
// var node = nodes[0];
// var obj = {
// shelves: {
// id: node.id,
// name: node.name
// },
// warehouse: node.warehouse
// };
// updateRow(rowIndex, obj)
// }
// }
/** /**
* 获取所有明细数据 * 获取所有明细数据
...@@ -246,21 +375,62 @@ ...@@ -246,21 +375,62 @@
* 批量添加货架 * 批量添加货架
*/ */
function addShelve(){ function addShelve(){
// jp.openShelvesSelectDialog(function (items){
// var Shelve = items[0]; // 货架对象
//
// getTableData().forEach(function (item,index){
// if(item[0]){
// updateRow(index,{
// shelves: {
// id: Shelve.id,
// name: Shelve.name
// },
// warehouse: Shelve.warehouse
// })
// }
// })
// })
jp.openShelvesSelectDialog(function (items){ jp.openShelvesSelectDialog(function (items){
var Shelve = items[0]; // 货架对象 setTimeout(function(){
// var Shelve = items[0]; // 货架对象
getTableData().forEach(function (item,index){ var obj = {
if(item[0]){ shelvesIds: '',
updateRow(index,{ warehouseIds: '',
shelves: { shelvesNames: '',
id: Shelve.id, warehouseNames: ''
name: Shelve.name };
}, var warehouseIdMap = {};
warehouse: Shelve.warehouse items.forEach(function (item) {
}) obj.shelvesIds += item.id + ',';
} obj.shelvesNames += item.name + ',';
}) if (!warehouseIdMap[item.warehouse.id]) {
}) obj.warehouseIds += item.warehouse.id + ',';
obj.warehouseNames += item.warehouse.name + ',';
warehouseIdMap[item.warehouse.id] = true;
}
})
// var realSelections = []; // 保存真实选中的数据
var allSelections = getSelections(); // 保存所有选中的数据(含分页)
var currentPageData = getTableData(true); // 保存当前分页数据
// allSelections.forEach(function(item){
// var finded = currentPageData.find(function(value){
// return value.qrCode.id === item.qrCode.id
// });
// if(finded){
// realSelections.push(item);
// }
// });
allSelections.forEach(function (item, index){
// var index = getTableData().findIndex(function (current){
// return current.qrCode.id === item.qrCode.id;
// }); // 需更新的行的下标
updateRow(index, Object.assign({}, obj));
})
},200)
}, true);
} }
function addDetail(){ function addDetail(){
...@@ -284,6 +454,51 @@ ...@@ -284,6 +454,51 @@
} }
$(selector).bootstrapTable('append',[row]) $(selector).bootstrapTable('append',[row])
} }
function onSelectType(nodes, rowIndex){
if(Array.isArray(nodes) && nodes.length === 1){
var node = nodes[0];
var obj = {
type: {
id: node.id,
name: node.text,
code: node.original.code,
unit: node.original.unit
},
amount: node.original.amount,
};
if ($("#profitWarehousingInfoList" + rowIndex + "_num").val()) {
obj.infoSum = new Big($("#profitWarehousingInfoList" + rowIndex + "_num").val()).times(obj.amount).toNumber();
}
updateRow(rowIndex, obj)
}
}
function delType (idName, id) {
var name = $("#" + idName + 'Id').attr('name');
var str1 = name.split('.')[0];
var startNum = str1.indexOf('[') + 1;
var str2 = str1.substring(startNum);
var endNum = str2.length - 1;
var num = str2.substring(0, endNum);
var key = "#profitWarehousingInfoList" + num;
$(key + "_typeCode").val('');
$(key + "_amount").val('');
$(key + "_unit").val('');
$(key + "_infoSum").val('');
var obj = {
type: {
id: '',
name: '',
code: '',
unit: ''
},
amount: '',
infoSum: ''
};
updateRow(num, obj);
setSumPrice();
}
</script> </script>
<script id="hideTpl" type="text/html"> <script id="hideTpl" type="text/html">
...@@ -308,10 +523,12 @@ ...@@ -308,10 +523,12 @@
{{/row.readonly}} {{/row.readonly}}
{{^row.readonly}} {{^row.readonly}}
<sys:treeselect id="profitWarehousingInfoList{{idx}}_type" name="profitWarehousingInfoList[{{idx}}].type.id" value="{{row.type.id}}" labelName="profitWarehousingInfoList{{idx}}.type.name" labelValue="{{row.type.name}}" <sys:treeselect id="profitWarehousingInfoList{{idx}}_type" name="profitWarehousingInfoList[{{idx}}].type.id" value="{{row.type.id}}" labelName="profitWarehousingInfoList{{idx}}.type.name" labelValue="{{row.type.name}}"
title="品名代码" url="/warehouse/materialtype/materialType/treeData" notAllowSelectParent="true" cssClass="form-control required" allowClear="true" allowSearch="true" callback="onSelectType" /> title="品名代码" url="/warehouse/materialtype/materialType/treeData" notAllowSelectParent="true" cssClass="form-control required" allowClear="true" allowSearch="true" callback="onSelectType" delCallback="delType" />
{{/row.readonly}}//--> {{/row.readonly}}//-->
</script> </script>
<script id="typeCodeTpl" type="text/html">
<input id="profitWarehousingInfoList{{idx}}_typeCode" name="profitWarehousingInfoList[{{idx}}].type.code" type="text" value="{{row.type.code}}" readonly class="form-control required"/>
</script>
<script id="modelTpl" type="text/html"> <script id="modelTpl" type="text/html">
{{#row.readonly}} {{#row.readonly}}
<input id="profitWarehousingInfoList{{idx}}_marking" name="profitWarehousingInfoList[{{idx}}].marking" type="text" value="{{row.marking}}" readonly class="form-control "/> <input id="profitWarehousingInfoList{{idx}}_marking" name="profitWarehousingInfoList[{{idx}}].marking" type="text" value="{{row.marking}}" readonly class="form-control "/>
...@@ -321,21 +538,27 @@ ...@@ -321,21 +538,27 @@
{{/row.readonly}} {{/row.readonly}}
</script> </script>
<script id="amountTpl" type="text/html"> <script id="amountTpl" type="text/html">
{{#row.readonly}} <input id="profitWarehousingInfoList{{idx}}_amount" name="profitWarehousingInfoList[{{idx}}].amount" type="text" value="{{row.amount}}" readonly onchange="onInputChange('{{idx}}', this, 'amount')" class="form-control required"/>
<input id="profitWarehousingInfoList{{idx}}_amount" name="profitWarehousingInfoList[{{idx}}].amount" type="text" value="{{row.amount}}" readonly class="form-control "/> </script>
{{/row.readonly}} <script id="unitTpl" type="text/html">
{{^row.readonly}} <input id="profitWarehousingInfoList{{idx}}_unit" name="profitWarehousingInfoList[{{idx}}].type.unit" type="text" value="{{row.type.unit}}" readonly onchange="onInputChange('{{idx}}', this, 'type.unit')" class="form-control required"/>
<input id="profitWarehousingInfoList{{idx}}_amount" name="profitWarehousingInfoList[{{idx}}].amount" type="text" value="{{row.amount}}" onchange="onInputChange('{{idx}}', this, 'amount')" class="form-control "/> </script>
{{/row.readonly}} <script id="numTpl" type="text/html">
<input id="profitWarehousingInfoList{{idx}}_num" name="profitWarehousingInfoList[{{idx}}].num" type="text" value="{{row.num}}" onchange="onInputChange('{{idx}}', this, 'num')" class="form-control required"/>
</script>
<script id="warehouseTpl" type="text/html">
<input id="profitWarehousingInfoList{{idx}}_warehouseName" type="text" value="{{row.warehouseNames}}" readonly class="form-control "/>
<input id="profitWarehousingInfoList{{idx}}_warehouseIds" name="profitWarehousingInfoList[{{idx}}].warehouseIds" type="hidden" value="{{row.warehouseIds}}" readonly class="form-control "/>
<input type="hidden" id="profitWarehousingInfoList{{idx}}_shelvesIds" name="profitWarehousingInfoList[{{idx}}].shelvesIds" value="{{row.shelvesIds}}">
</script> </script>
<script id="shelvesTpl" type="text/html">//<!-- <script id="shelvesTpl" type="text/html">//<!--
{{#row.readonly}} {{#row.readonly}}
<sys:shelvesselect id="profitWarehousingInfoList{{idx}}_shelves" name="profitWarehousingInfoList[{{idx}}].shelves.id" value="{{row.shelves.id}}" labelName="profitWarehousingInfoList[{{idx}}].shelves.name" labelValue="{{row.shelves.name}}" <sys:shelvesselect id="profitWarehousingInfoList{{idx}}_shelves" name="profitWarehousingInfoList[{{idx}}].shelvesIds" value="{{row.shelvesIds}}" labelName="profitWarehousingInfoList[{{idx}}].shelvesNames" labelValue="{{row.shelvesNames}}"
cssClass="form-control required" iframeUrl="/warehouse/profitwarehousing/profitWarehousing/form" disabled="disabled"></sys:shelvesselect> cssClass="form-control required" iframeUrl="/warehouse/profitwarehousing/profitWarehousing/form" disabled="disabled" />
{{/row.readonly}} {{/row.readonly}}
{{^row.readonly}} {{^row.readonly}}
<sys:shelvesselect id="profitWarehousingInfoList{{idx}}_shelves" name="profitWarehousingInfoList[{{idx}}].shelves.id" value="{{row.shelves.id}}" labelName="profitWarehousingInfoList[{{idx}}].shelves.name" labelValue="{{row.shelves.name}}" <sys:shelvesselect id="profitWarehousingInfoList{{idx}}_shelves" name="profitWarehousingInfoList[{{idx}}].shelvesIds" value="{{row.shelvesIds}}" labelName="profitWarehousingInfoList[{{idx}}].shelvesNames" labelValue="{{row.shelvesNames}}"
cssClass="form-control required" iframeUrl="/warehouse/profitwarehousing/profitWarehousing/form" callback="onSelectShelves"></sys:shelvesselect> cssClass="form-control required" iframeUrl="/warehouse/profitwarehousing/profitWarehousing/form" callback="onSelectShelves" isMultiSelected="true" />
{{/row.readonly}}//--> {{/row.readonly}}//-->
</script> </script>
<script id="remarksTpl" type="text/html"> <script id="remarksTpl" type="text/html">
...@@ -361,4 +584,4 @@ ...@@ -361,4 +584,4 @@
</div> </div>
</div> </div>
<br> <br>
</script> </script>
\ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" %> <%@ page contentType="text/html;charset=UTF-8" %>
<script> <script>
var LODOP; var LODOP;
$(document).ready(function() { $(document).ready(function() {
$('#profitWarehousingTable').bootstrapTable({ $('#profitWarehousingTable').bootstrapTable({
//请求方法 //请求方法
method: 'post', method: 'post',
//类型json //类型json
dataType: "json", dataType: "json",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
//显示检索按钮 //显示检索按钮
showSearch: true, showSearch: true,
//显示刷新按钮 //显示刷新按钮
showRefresh: true, showRefresh: true,
//显示切换手机试图按钮 //显示切换手机试图按钮
showToggle: true, showToggle: true,
//显示 内容列下拉框 //显示 内容列下拉框
showColumns: true, showColumns: true,
//显示到处按钮 //显示到处按钮
showExport: true, showExport: true,
//显示切换分页按钮 //显示切换分页按钮
showPaginationSwitch: true, showPaginationSwitch: true,
//显示详情按钮 //显示详情按钮
detailView: true, detailView: true,
//显示详细内容函数 //显示详细内容函数
detailFormatter: "detailFormatter", detailFormatter: "detailFormatter",
//最低显示2行 //最低显示2行
minimumCountColumns: 2, minimumCountColumns: 2,
//是否显示行间隔色 //是否显示行间隔色
striped: true, striped: true,
//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*) //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
cache: false, cache: false,
//是否显示分页(*) //是否显示分页(*)
pagination: true, pagination: true,
//排序方式 //排序方式
sortOrder: "asc", sortOrder: "asc",
//初始化加载第一页,默认第一页 //初始化加载第一页,默认第一页
pageNumber:1, pageNumber:1,
//每页的记录行数(*) //每页的记录行数(*)
pageSize: 10, pageSize: 10,
//可供选择的每页的行数(*) //可供选择的每页的行数(*)
pageList: [10, 25, 50, 100], pageList: [10, 25, 50, 100],
//这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据 //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
url: "${ctx}/warehouse/profitwarehousing/profitWarehousing/data", url: "${ctx}/warehouse/profitwarehousing/profitWarehousing/data",
//默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
//queryParamsType:'', //queryParamsType:'',
////查询参数,每次调用是会带上这个参数,可自定义 ////查询参数,每次调用是会带上这个参数,可自定义
queryParams : function(params) { queryParams : function(params) {
var searchParam = $("#searchForm").serializeJSON(); var searchParam = $("#searchForm").serializeJSON();
searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1; searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
searchParam.pageSize = params.limit === undefined? -1 : params.limit; searchParam.pageSize = params.limit === undefined? -1 : params.limit;
searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+ params.order; searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+ params.order;
return searchParam; return searchParam;
}, },
//分页方式:client客户端分页,server服务端分页(*) //分页方式:client客户端分页,server服务端分页(*)
sidePagination: "server", sidePagination: "server",
contextMenuTrigger:"right",//pc端 按右键弹出菜单 contextMenuTrigger:"right",//pc端 按右键弹出菜单
contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。 contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
contextMenu: '#context-menu', contextMenu: '#context-menu',
onContextMenuItem: function(row, $el){ onContextMenuItem: function(row, $el){
if($el.data("item") == "edit"){ if($el.data("item") == "edit"){
edit(row.id); edit(row.id);
}else if($el.data("item") == "view"){ }else if($el.data("item") == "view"){
view(row.id); view(row.id);
} else if($el.data("item") == "delete"){ } else if($el.data("item") == "delete"){
jp.confirm('确认要删除该盘盈入库单记录吗?', function(){ jp.confirm('确认要删除该盘盈入库单记录吗?', function(){
jp.loading(); jp.loading();
jp.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/delete?id="+row.id, function(data){ jp.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/delete?id="+row.id, function(data){
if(data.success){ if(data.success){
$('#profitWarehousingTable').bootstrapTable('refresh'); $('#profitWarehousingTable').bootstrapTable('refresh');
jp.success(data.msg); jp.success(data.msg);
}else{ }else{
jp.error(data.msg); jp.error(data.msg);
} }
}) })
}); });
}
},
onClickRow: function(row, $el){
},
onShowSearch: function () {
$("#search-collapse").slideToggle();
},
columns: [{
checkbox: true
}
,{
field: 'number',
title: '单号',
sortable: true,
sortName: 'number'
,formatter:function(value, row , index){
value = jp.unescapeHTML(value);
return "<a href='javascript:view(\""+row.id+"\")'>"+value+"</a>";
}
}
,{
field: 'operator.name',
title: '操作人',
sortable: true,
sortName: 'operator.name'
}
,{
field: 'time',
title: '时间',
sortable: true,
sortName: 'time'
},{
field: 'sum',
title: '总价',
sortable: true,
sortName: 'sum'
}
,{
field: 'remarks',
title: '备注信息',
sortable: true,
sortName: 'remarks'
}
]
});
if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
$('#profitWarehousingTable').bootstrapTable("toggleView");
}
$('#profitWarehousingTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
'check-all.bs.table uncheck-all.bs.table', function () {
$('#remove').prop('disabled', ! $('#profitWarehousingTable').bootstrapTable('getSelections').length);
$('#view,#edit').prop('disabled', $('#profitWarehousingTable').bootstrapTable('getSelections').length!=1);
});
$("#btnImport").click(function(){
jp.open({
type: 2,
area: [500, 200],
auto: true,
title:"导入数据",
content: "${ctx}/tag/importExcel" ,
btn: ['下载模板','确定', '关闭'],
btn1: function(index, layero){
jp.downloadFile('${ctx}/warehouse/profitwarehousing/profitWarehousing/import/template');
},
btn2: function(index, layero){
var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
iframeWin.contentWindow.importExcel('${ctx}/warehouse/profitwarehousing/profitWarehousing/import', function (data) {
if(data.success){
jp.success(data.msg);
refresh();
}else{
jp.error(data.msg);
}
jp.close(index);
});//调用保存事件
return false;
},
btn3: function(index){
jp.close(index);
}
});
});
$("#export").click(function(){//导出Excel文件
var searchParam = $("#searchForm").serializeJSON();
searchParam.pageNo = 1;
searchParam.pageSize = -1;
var sortName = $('#profitWarehousingTable').bootstrapTable("getOptions", "none").sortName;
var sortOrder = $('#profitWarehousingTable').bootstrapTable("getOptions", "none").sortOrder;
var values = "";
for(var key in searchParam){
values = values + key + "=" + searchParam[key] + "&";
} }
if(sortName != undefined && sortOrder != undefined){ },
values = values + "orderBy=" + sortName + " "+sortOrder;
onClickRow: function(row, $el){
},
onShowSearch: function () {
$("#search-collapse").slideToggle();
},
columns: [{
checkbox: true
}
,{
field: 'number',
title: '单号',
sortable: true,
sortName: 'number'
,formatter:function(value, row , index){
value = jp.unescapeHTML(value);
return "<a href='javascript:view(\""+row.id+"\")'>"+value+"</a>";
}
}
,{
field: 'operator.name',
title: '操作人',
sortable: true,
sortName: 'operator.name'
} }
,{
field: 'time',
title: '时间',
sortable: true,
sortName: 'time'
},{
field: 'sum',
title: '总价',
sortable: true,
sortName: 'sum'
}
,{
field: 'remarks',
title: '备注信息',
sortable: true,
sortName: 'remarks'
}
]
});
if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
jp.downloadFile('${ctx}/warehouse/profitwarehousing/profitWarehousing/export?'+values);
}) $('#profitWarehousingTable').bootstrapTable("toggleView");
}
$("#search").click("click", function() {// 绑定查询按扭
$('#profitWarehousingTable').bootstrapTable('refresh'); $('#profitWarehousingTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
}); 'check-all.bs.table uncheck-all.bs.table', function () {
$('#remove').prop('disabled', ! $('#profitWarehousingTable').bootstrapTable('getSelections').length);
$("#reset").click("click", function() {// 绑定查询按扭 $('#view,#edit').prop('disabled', $('#profitWarehousingTable').bootstrapTable('getSelections').length!=1);
$("#searchForm input").val(""); });
$("#searchForm select").val("");
$("#searchForm .select-item").html(""); $("#btnImport").click(function(){
$('#profitWarehousingTable').bootstrapTable('refresh'); jp.open({
}); type: 2,
area: [500, 200],
$('#beginTime').datetimepicker({ auto: true,
format: "YYYY-MM-DD HH:mm:ss" title:"导入数据",
}); content: "${ctx}/tag/importExcel" ,
$('#endTime').datetimepicker({ btn: ['下载模板','确定', '关闭'],
format: "YYYY-MM-DD HH:mm:ss" btn1: function(index, layero){
}); jp.downloadFile('${ctx}/warehouse/profitwarehousing/profitWarehousing/import/template');
},
}); btn2: function(index, layero){
var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
function getIdSelections() { iframeWin.contentWindow.importExcel('${ctx}/warehouse/profitwarehousing/profitWarehousing/import', function (data) {
return $.map($("#profitWarehousingTable").bootstrapTable('getSelections'), function (row) { if(data.success){
return row.id jp.success(data.msg);
refresh();
}else{
jp.error(data.msg);
}
jp.close(index);
});//调用保存事件
return false;
},
btn3: function(index){
jp.close(index);
}
}); });
});
$("#export").click(function(){//导出Excel文件
var searchParam = $("#searchForm").serializeJSON();
searchParam.pageNo = 1;
searchParam.pageSize = -1;
var sortName = $('#profitWarehousingTable').bootstrapTable("getOptions", "none").sortName;
var sortOrder = $('#profitWarehousingTable').bootstrapTable("getOptions", "none").sortOrder;
var values = "";
for(var key in searchParam){
values = values + key + "=" + searchParam[key] + "&";
}
if(sortName != undefined && sortOrder != undefined){
values = values + "orderBy=" + sortName + " "+sortOrder;
}
jp.downloadFile('${ctx}/warehouse/profitwarehousing/profitWarehousing/export?'+values);
})
$("#search").click("click", function() {// 绑定查询按扭
$('#profitWarehousingTable').bootstrapTable('refresh');
});
$("#reset").click("click", function() {// 绑定查询按扭
$("#searchForm input").val("");
$("#searchForm select").val("");
$("#searchForm .select-item").html("");
$('#profitWarehousingTable').bootstrapTable('refresh');
});
$('#beginTime').datetimepicker({
format: "YYYY-MM-DD HH:mm:ss"
});
$('#endTime').datetimepicker({
format: "YYYY-MM-DD HH:mm:ss"
});
});
function getIdSelections() {
return $.map($("#profitWarehousingTable").bootstrapTable('getSelections'), function (row) {
return row.id
});
}
function deleteAll(){
jp.confirm('确认要删除该盘盈入库单记录吗?', function(){
jp.loading();
jp.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/deleteAll?ids=" + getIdSelections(), function(data){
if(data.success){
$('#profitWarehousingTable').bootstrapTable('refresh');
jp.success(data.msg);
}else{
jp.error(data.msg);
}
})
})
}
//刷新列表
function refresh(){
$('#profitWarehousingTable').bootstrapTable('refresh');
}
function add(){
jp.openSaveDialog("新增盘盈入库单","${ctx}/warehouse/profitwarehousing/profitWarehousing/form/add",'1200','800');
}
function edit(id){
if(id == undefined){
id = getIdSelections();
} }
jp.openSaveDialog("编辑盘盈入库单","${ctx}/warehouse/profitwarehousing/profitWarehousing/form/edit?id=" + id,'1200','800');
function deleteAll(){ }
jp.confirm('确认要删除该盘盈入库单记录吗?', function(){ function view(id){//没有权限时,不显示确定按钮
jp.loading(); if(id == undefined){
jp.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/deleteAll?ids=" + getIdSelections(), function(data){ id = getIdSelections();
if(data.success){ }
$('#profitWarehousingTable').bootstrapTable('refresh'); jp.openViewDialog("查看盘盈入库单","${ctx}/warehouse/profitwarehousing/profitWarehousing/form/view?id=" + id,'1200','800');
jp.success(data.msg); }
}else{
jp.error(data.msg);
}
})
}) function detailFormatter(index, row) {
} var htmltpl = $("#profitWarehousingChildrenTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
var html = Mustache.render(htmltpl, {
//刷新列表 idx:row.id
function refresh(){ });
$('#profitWarehousingTable').bootstrapTable('refresh'); $.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/detail?id="+row.id, function(profitWarehousing){
} var profitWarehousingChild1RowIdx = 0, profitWarehousingChild1Tpl = $("#profitWarehousingChild1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
function add(){ var data1 = profitWarehousing.profitWarehousingInfoList;
jp.openSaveDialog("新增盘盈入库单","${ctx}/warehouse/profitwarehousing/profitWarehousing/form/add",'1200','800'); for (var i=0; i<data1.length; i++){
} data1[i].dict = {};
data1[i].qrCodeStr = data1[i].qrCode && JSON.stringify(data1[i].qrCode);
function edit(id){ data1[i].status = data1[i].qrCode && data1[i].qrCode.state === '2'; // 已入库
if(id == undefined){ data1[i].status2 = data1[i].qrCode && data1[i].qrCode.state === '3'; // 已出库
id = getIdSelections(); data1[i].status3 = !data1[i].qrCode || (data1[i].qrCode && data1[i].qrCode.state !== '2' && data1[i].qrCode.state !== '3');
} data1[i].hasQr = data1[i].qrCode;
jp.openSaveDialog("编辑盘盈入库单","${ctx}/warehouse/profitwarehousing/profitWarehousing/form/edit?id=" + id,'1200','800'); data1[i].mainRowIndex = index;
} addRow('#profitWarehousingChild-'+row.id+'-1-List', profitWarehousingChild1RowIdx, profitWarehousingChild1Tpl, data1[i]);
profitWarehousingChild1RowIdx = profitWarehousingChild1RowIdx + 1;
function view(id){//没有权限时,不显示确定按钮 }
if(id == undefined){ })
id = getIdSelections();
} return html;
jp.openViewDialog("查看盘盈入库单","${ctx}/warehouse/profitwarehousing/profitWarehousing/form/view?id=" + id,'1200','800'); }
}
function addRow(list, idx, tpl, row){
$(list).append(Mustache.render(tpl, {
idx: idx, delBtn: true, row: row
}));
}
function detailFormatter(index, row) {
var htmltpl = $("#profitWarehousingChildrenTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,""); function initLodop(){
var html = Mustache.render(htmltpl, { LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
idx:row.id }
});
$.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/detail?id="+row.id, function(profitWarehousing){ function printQr_(id, qrCodeStr, rowIndex) {
var profitWarehousingChild1RowIdx = 0, profitWarehousingChild1Tpl = $("#profitWarehousingChild1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,""); try{
var data1 = profitWarehousing.profitWarehousingInfoList; if(!LODOP){
for (var i=0; i<data1.length; i++){ initLodop();
data1[i].dict = {}; }
data1[i].qrCodeStr = data1[i].qrCode && JSON.stringify(data1[i].qrCode); if(LODOP){
data1[i].status = data1[i].qrCode && data1[i].qrCode.state === '2'; // 已入库 if(qrCodeStr){
data1[i].status2 = data1[i].qrCode && data1[i].qrCode.state === '3'; // 已出库 var qrCode = JSON.parse(qrCodeStr);
data1[i].status3 = !data1[i].qrCode || (data1[i].qrCode && data1[i].qrCode.state !== '2' && data1[i].qrCode.state !== '3'); preview_LODOP(qrCode);
data1[i].hasQr = data1[i].qrCode; jp.close();
data1[i].mainRowIndex = index; }else{
addRow('#profitWarehousingChild-'+row.id+'-1-List', profitWarehousingChild1RowIdx, profitWarehousingChild1Tpl, data1[i]); jp.loading('loading...');
profitWarehousingChild1RowIdx = profitWarehousingChild1RowIdx + 1; jp.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/printQr?profitWarehousingInfoId="+id, function (res) {
} if(res.success){
}) var profitWarehousingInfo = res.body.profitWarehousingInfo;
preview_LODOP(profitWarehousingInfo.qrCode);
return html; $('#profitWarehousingTable').bootstrapTable('collapseRow', rowIndex);
setTimeout(function (){
$('#profitWarehousingTable').bootstrapTable('expandRow', rowIndex);
},0)
}else {
jp.warning(res.msg);
}
jp.close();
})
}
}else{
jp.close();
}
}catch (e){
console.error('异常!')
}
}
function printQr (id) {
jp.loading('loading...');
jp.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/printQr?profitWarehousingInfoId="+id, function (res) {
if (res.success) {
var row = res.body.goodsInfo.qrCode;
var imgUrl = "${ctxPath}/" + row.url;
// jp.showPic(imgUrl);
_thermal_Image_print_(imgUrl);
}
jp.close();
})
}
function preview_LODOP(qrCode){
if(qrCode && qrCode.url){
LODOP.PRINT_INIT("打印货品");
LODOP.SET_PRINT_PAGESIZE(1,400,600,0)
var imgUrl = "${ctxPath}/" + qrCode.url;
LODOP.ADD_PRINT_IMAGE('0%',"0%","100%","100%","<img width='150' border='0' src='"+imgUrl+"' />");
LODOP.PREVIEW();
}else{
jp.error('二维码不存在!')
} }
}
function addRow(list, idx, tpl, row){
$(list).append(Mustache.render(tpl, {
idx: idx, delBtn: true, row: row
}));
}
function initLodop(){
LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
}
function printQr(id, qrCodeStr, rowIndex) {
try{
if(!LODOP){
initLodop();
}
if(LODOP){
if(qrCodeStr){
var qrCode = JSON.parse(qrCodeStr);
preview_LODOP(qrCode);
jp.close();
}else{
jp.loading('loading...');
jp.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/printQr?profitWarehousingInfoId="+id, function (res) {
if(res.success){
var profitWarehousingInfo = res.body.profitWarehousingInfo;
preview_LODOP(profitWarehousingInfo.qrCode);
$('#profitWarehousingTable').bootstrapTable('collapseRow', rowIndex);
setTimeout(function (){
$('#profitWarehousingTable').bootstrapTable('expandRow', rowIndex);
},0)
}else {
jp.warning(res.msg);
}
jp.close();
})
}
}else{
jp.close();
}
}catch (e){
console.error('异常!')
}
}
function preview_LODOP(qrCode){
if(qrCode && qrCode.url){
LODOP.PRINT_INIT("打印货品");
LODOP.SET_PRINT_PAGESIZE(1,400,600,0)
var imgUrl = "${ctxPath}/" + qrCode.url;
LODOP.ADD_PRINT_IMAGE('0%',"0%","100%","100%","<img width='150' border='0' src='"+imgUrl+"' />");
LODOP.PREVIEW();
}else{
jp.error('二维码不存在!')
}
}
/** /**
* 清除二维码 * 清除二维码
* @param id 明细id * @param id 明细id
*/ */
function cleanQr(id,rowIndex) { function cleanQr(id,rowIndex) {
jp.confirm('确认清除二维码吗?', function (){ jp.confirm('确认清除二维码吗?', function (){
jp.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/cleanQr?profitWarehousingInfoId="+id, function (res) { jp.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/cleanQr?profitWarehousingInfoId="+id, function (res) {
res.success && jp.success('清除二维码成功!'); res.success && jp.success('清除二维码成功!');
$('#profitWarehousingTable').bootstrapTable('collapseRow', rowIndex); $('#profitWarehousingTable').bootstrapTable('collapseRow', rowIndex);
setTimeout(function (){ setTimeout(function (){
$('#profitWarehousingTable').bootstrapTable('expandRow', rowIndex); $('#profitWarehousingTable').bootstrapTable('expandRow', rowIndex);
},0) },0)
}) })
}) })
} }
/** /**
* 入库 * 入库
* @param id 明细id * @param id 明细id
* @param rowIndex 主表下标 * @param rowIndex 主表下标
*/ */
function inLedgerInfo(id, rowIndex ){ function inLedgerInfo(id, rowIndex ){
jp.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/inLedgerInfo?profitWarehousingInfoId="+ id, function (res){ jp.get("${ctx}/warehouse/profitwarehousing/profitWarehousing/inLedgerInfo?profitWarehousingInfoId="+ id, function (res){
if(res.success){ if(res.success){
jp.success(res.msg); jp.success(res.msg);
$('#profitWarehousingTable').bootstrapTable('collapseRow', rowIndex); $('#profitWarehousingTable').bootstrapTable('collapseRow', rowIndex);
setTimeout(function (){ setTimeout(function (){
$('#profitWarehousingTable').bootstrapTable('expandRow', rowIndex); $('#profitWarehousingTable').bootstrapTable('expandRow', rowIndex);
},0) },0)
}else{ }else{
jp.error(res.msg); jp.error(res.msg);
} }
}) })
} }
</script> </script>
<script type="text/template" id="profitWarehousingChildrenTpl">//<!-- <script type="text/template" id="profitWarehousingChildrenTpl">//<!--
<div class="tabs-container"> <div class="tabs-container">
...@@ -384,12 +397,14 @@ $(document).ready(function() { ...@@ -384,12 +397,14 @@ $(document).ready(function() {
<table class="ani table"> <table class="ani table">
<thead> <thead>
<tr> <tr>
<th>名称</th> <th>品名</th>
<th>品名代码</th> <th>代码</th>
<th>型号</th> <th>型号</th>
<th>数量</th>
<th>单价</th>
<th>单位</th>
<th>仓库</th> <th>仓库</th>
<th>货架</th> <th>货架</th>
<th>单价</th>
<th>备注</th> <th>备注</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
...@@ -399,28 +414,34 @@ $(document).ready(function() { ...@@ -399,28 +414,34 @@ $(document).ready(function() {
</table> </table>
</div> </div>
</div>//--> </div>//-->
</script> </script>
<script type="text/template" id="profitWarehousingChild1Tpl">//<!-- <script type="text/template" id="profitWarehousingChild1Tpl">//<!--
<tr> <tr>
<td> <td>
{{row.name}}
</td>
<td>
{{row.type.name}} {{row.type.name}}
</td> </td>
<td> <td>
{{row.marking}} {{row.type.code}}
</td> </td>
<td> <td>
{{row.shelves.name}} {{row.model}}
</td> </td>
<td> <td>
{{row.warehouse.name}} {{row.num}}
</td> </td>
<td> <td>
{{row.amount}} {{row.amount}}
</td> </td>
<td> <td>
{{row.type.unit}}
</td>
<td>
{{row.shelves.name}}
</td>
<td>
{{row.warehouse.name}}
</td>
<td>
{{row.remarks}} {{row.remarks}}
</td> </td>
<td> <td>
...@@ -445,4 +466,4 @@ $(document).ready(function() { ...@@ -445,4 +466,4 @@ $(document).ready(function() {
{{/row.status3}} {{/row.status3}}
</td> </td>
</tr>//--> </tr>//-->
</script> </script>
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<meta name="decorator" content="ani"/> <meta name="decorator" content="ani"/>
<%@ include file="/webpage/include/bootstraptable.jsp"%> <%@ include file="/webpage/include/bootstraptable.jsp"%>
<%@include file="/webpage/include/treeview.jsp" %> <%@include file="/webpage/include/treeview.jsp" %>
<%@include file="./../goods/logic.js"%>
<%@include file="profitWarehousingList.js" %> <%@include file="profitWarehousingList.js" %>
</head> </head>
<body> <body>
...@@ -113,4 +114,4 @@ ...@@ -113,4 +114,4 @@
</div> </div>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
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