Commit df05c88c by anxiaohe

出库功能

parent b75fb4fa
...@@ -27,38 +27,49 @@ ...@@ -27,38 +27,49 @@
}, },
{ {
field: 'type.name', field: 'type.name',
title: '品名代码', title: '品名',
align: 'center' sortable: true,
sortName: 'type.name',
}, },
{ {
field: 'model', field: 'type.code',
title: '型号', title: '代码',
align: 'center' sortable: true,
sortName: 'type.code'
},
{
field: 'code',
title: '入库单'
}, },
{ {
field: 'batchNum', field: 'batchNum',
title: '批次号', title: '批次号',
align: 'center'
}, },
{ {
field: 'shelvesNames', field: 'amount',
title: '货架', title: '单价'
align: 'center' },
{
field: "type.unit",
title: '单位'
}, },
{ {
field: 'warehouseNames', field: 'model',
title: '仓库', title: '型号',
align: 'center' sortable: true,
sortName: 'model'
}, },
{ {
field: 'num', field: 'num',
title: '数量', title: '数量'
align: 'center'
}, },
{ {
field: 'sum', field: 'sum',
title: '总价', title: '总价',
align: 'center' sortName: 'sum',
formatter (v, row) {
return new Big(row.num).times(row.amount).toNumber()
}
}, },
{ {
title: '操作', title: '操作',
...@@ -72,7 +83,7 @@ ...@@ -72,7 +83,7 @@
title: '查看明细', title: '查看明细',
type: 1, type: 1,
auto: true, auto: true,
area: ['800', '600'], area: ['1000', '600'],
content: $("#detailTpl").html(), content: $("#detailTpl").html(),
success: function (){ success: function (){
$("#table").bootstrapTable({ $("#table").bootstrapTable({
...@@ -99,12 +110,49 @@ ...@@ -99,12 +110,49 @@
columns: [ columns: [
{checkbox:true}, {checkbox:true},
{field: 'code', title: '物资编码'}, {field: 'code', title: '物资编码'},
{field: 'name', title: '物资名称'}, {
{field: 'type.name', title: '品名代码'}, field: 'type.name',
title: '品名',
},
{
field: 'type.code',
title: '代码',
},
{
field: 'batchNum',
title: '批次号',
},
{
field: 'amount',
title: '单价'
},
{
field: "type.unit",
title: '单位'
},
{
field: 'amount',
title: '单价'
},
{
field: "type.unit",
title: '单位'
},
{field: 'model', title: '型号'}, {field: 'model', title: '型号'},
{field: 'batchNum', title: '批次号'},
{field: 'shelves.name', title: '货架'}, {field: 'shelves.name', title: '货架'},
{field: 'amount', title: '单价'}, // {field: 'amount', title: '单价'},
{
field: 'num',
title: '数量'
},
{
field: 'sum',
title: '总价',
sortName: 'sum',
formatter (v, row) {
return new Big(row.num).times(row.amount).toNumber()
}
},
{ {
field: 'qr.url', field: 'qr.url',
title: '二维码', title: '二维码',
...@@ -135,11 +183,14 @@ ...@@ -135,11 +183,14 @@
} }
} }
} }
] ].map(function (e) {
e.align = 'center';
return e;
})
}); });
jp.get("${ctx}/warehouse/ledger/ledger/countLedger?id=${ledger.id}", function (ledger) { jp.get("${ctx}/warehouse/ledger/ledger/detail?id=${ledger.id}", function (ledger) {
var data = ledger.countLedgerInfoList || []; var data = ledger.ledgerInfoList || [];
$(selector).bootstrapTable('append', data); $(selector).bootstrapTable('append', data);
}) })
} }
......
...@@ -22,17 +22,21 @@ ...@@ -22,17 +22,21 @@
<h3 class="text-center">台账表</h3> <h3 class="text-center">台账表</h3>
<table class="table table-bordered main-table"> <table class="table table-bordered main-table">
<tr> <tr>
<td>物资名称</td> <td>品名</td>
<td>
<form:input path="name" htmlEscape="false" class="form-control "/>
</td>
<td>品名代码</td>
<td> <td>
<sys:treeselect id="type" name="type.id" value="${ledger.type.id}" labelName="type.name" <sys:treeselect id="type" name="type.id" value="${ledger.type.id}" labelName="type.name"
labelValue="${ledger.type.name}" labelValue="${ledger.type.name}"
title="品名代码" url="/warehouse/materialtype/materialType/treeData" title="品名代码" url="/warehouse/materialtype/materialType/treeData"
extId="${ledger.id}" cssClass="form-control " allowClear="true"/> extId="${ledger.id}" cssClass="form-control " allowClear="true"/>
</td> </td>
<td>品名代码</td>
<td>
<%-- <sys:treeselect id="type" name="type.id" value="${ledger.type.id}" labelName="type.name"--%>
<%-- labelValue="${ledger.type.name}"--%>
<%-- title="品名代码" url="/warehouse/materialtype/materialType/treeData"--%>
<%-- extId="${ledger.id}" cssClass="form-control " allowClear="true"/>--%>
<form:input path="type.code" htmlEscape="false" class="form-control "/>
</td>
<td>型号</td> <td>型号</td>
<td> <td>
<form:input path="model" htmlEscape="false" class="form-control "/> <form:input path="model" htmlEscape="false" class="form-control "/>
......
...@@ -240,21 +240,21 @@ function refresh(){ ...@@ -240,21 +240,21 @@ function refresh(){
$('#ledgerTable').bootstrapTable('refresh'); $('#ledgerTable').bootstrapTable('refresh');
} }
function add(){ function add(){
jp.openSaveDialog("新增台账","${ctx}/warehouse/ledger/ledger/form/add", '1200', '800'); jp.openSaveDialog("新增台账","${ctx}/warehouse/ledger/ledger/form/add", '1400', '800');
} }
function edit(id){ function edit(id){
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.openSaveDialog("编辑台账","${ctx}/warehouse/ledger/ledger/form/edit?id=" + id, '1200', '800'); jp.openSaveDialog("编辑台账","${ctx}/warehouse/ledger/ledger/form/edit?id=" + id, '1400', '800');
} }
function view(id){//没有权限时,不显示确定按钮 function view(id){//没有权限时,不显示确定按钮
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.openViewDialog("查看台账","${ctx}/warehouse/ledger/ledger/form/view?id=" + id,'1200', '800'); jp.openViewDialog("查看台账","${ctx}/warehouse/ledger/ledger/form/view?id=" + id,'1400', '800');
} }
...@@ -534,6 +534,7 @@ function scanIptGetFocusStop () { ...@@ -534,6 +534,7 @@ function scanIptGetFocusStop () {
<tr> <tr>
<th>品名</th> <th>品名</th>
<th>代码</th> <th>代码</th>
<th>物资编码</th>
<th>数量</th> <th>数量</th>
<th>单位</th> <th>单位</th>
<th>型号</th> <th>型号</th>
...@@ -542,6 +543,7 @@ function scanIptGetFocusStop () { ...@@ -542,6 +543,7 @@ function scanIptGetFocusStop () {
<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">
...@@ -558,6 +560,7 @@ function scanIptGetFocusStop () { ...@@ -558,6 +560,7 @@ function scanIptGetFocusStop () {
<td> <td>
{{row.type.code}} {{row.type.code}}
</td> </td>
<td>{{row.code}}</td>
<td> <td>
{{row.num}} {{row.num}}
</td> </td>
...@@ -583,6 +586,9 @@ function scanIptGetFocusStop () { ...@@ -583,6 +586,9 @@ function scanIptGetFocusStop () {
<td> <td>
{{row.warehouseNames}} {{row.warehouseNames}}
</td> </td>
<td>
{{row.remarks}}
</td>
</tr>//--> </tr>//-->
</script> </script>
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
if(data.length){ if(data.length){
data = data.map(function(item){ data = data.map(function(item){
item.delFlag = 0; item.delFlag = 0;
item.infoSum = new Big(item.num).times(item.amount).toNumber();
return item; return item;
}) })
} }
...@@ -48,30 +49,50 @@ ...@@ -48,30 +49,50 @@
} }
}, },
{ {
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,
idx: index
})
}
},
{
field: 'ledgerInfo.amount',
title: '单价',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoAmountTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
}
},
{
field: "ledgerInfo.type.unit",
title: '单位',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoTypeUnitTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row, row: row,
idx: index idx: index
}) })
...@@ -88,10 +109,21 @@ ...@@ -88,10 +109,21 @@
} }
}, },
{ {
field: 'ledgerInfo.amount', field: 'num',
title: '单价', title: '数量',
formatter: function (value, row, index) { formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoAmountTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), { return Mustache.render($("#ledgerInfoNumTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
}
},
{
field: 'infoSum',
title: '总价',
sortName: 'infoSum',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoInfoSumTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row, row: row,
idx: index idx: index
}) })
...@@ -170,6 +202,7 @@ ...@@ -170,6 +202,7 @@
}) })
var data = newItems.map(function (item) { var data = newItems.map(function (item) {
item[0] = false; item[0] = false;
item.infoSum = new Big(item.num).times(item.amount).toNumber();
return { return {
id: '', id: '',
delFlag: 0, delFlag: 0,
...@@ -377,6 +410,16 @@ ...@@ -377,6 +410,16 @@
<sys:treeselect id="materialRequisitionInfoList{{idx}}_ledgerInfoType" name="materialRequisitionInfoList[{{idx}}].ledgerInfo.type.id" value="{{row.ledgerInfo.type.id}}" labelName="materialRequisitionInfoList{{idx}}.ledgerInfo.type.name" labelValue="{{row.ledgerInfo.type.name}}" <sys:treeselect id="materialRequisitionInfoList{{idx}}_ledgerInfoType" name="materialRequisitionInfoList[{{idx}}].ledgerInfo.type.id" value="{{row.ledgerInfo.type.id}}" labelName="materialRequisitionInfoList{{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="materialRequisitionInfoList{{idx}}_ledgerInfoTypeCode"
name="materialRequisitionInfoList[{{idx}}].ledgerInfo.type.code" type="text" class="form-control" readonly
value="{{row.ledgerInfo.type.code}}"/>
</script>
<script id="ledgerInfoTypeUnitTpl" type="text/html">
<input id="materialRequisitionInfoList{{idx}}_ledgerInfoTypeUnit
name="materialRequisitionInfoList[{{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="materialRequisitionInfoList{{idx}}_ledgerInfoModel" <input id="materialRequisitionInfoList{{idx}}_ledgerInfoModel"
name="materialRequisitionInfoList[{{idx}}].ledgerInfo.model" type="text" class="form-control" readonly name="materialRequisitionInfoList[{{idx}}].ledgerInfo.model" type="text" class="form-control" readonly
...@@ -387,6 +430,16 @@ ...@@ -387,6 +430,16 @@
name="materialRequisitionInfoList[{{idx}}].ledgerInfo.amount" type="text" readonly class="form-control" name="materialRequisitionInfoList[{{idx}}].ledgerInfo.amount" type="text" readonly class="form-control"
value="{{row.ledgerInfo.amount}}"/> value="{{row.ledgerInfo.amount}}"/>
</script> </script>
<script id="ledgerInfoNumTpl" type="text/html">
<input id="materialRequisitionInfoList{{idx}}_ledgerInfoNum"
name="materialRequisitionInfoList[{{idx}}].ledgerInfo.num" type="text" readonly class="form-control"
value="{{row.ledgerInfo.num}}"/>
</script>
<script id="ledgerInfoInfoSumTpl" type="text/html">
<input id="materialRequisitionInfoList{{idx}}_ledgerInfoInfoSum"
name="materialRequisitionInfoList[{{idx}}].ledgerInfo.infoSum" type="text" readonly class="form-control"
value="{{row.ledgerInfo.infoSum}}"/>
</script>
<script id="receiverTpl" type="text/html"> <script id="receiverTpl" type="text/html">
<input type="hidden" name="materialRequisitionInfoList[{{idx}}].receiver" value="{{row.receiver}}"> <input type="hidden" name="materialRequisitionInfoList[{{idx}}].receiver" value="{{row.receiver}}">
{{#row.receiver}} {{#row.receiver}}
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<link rel="stylesheet" href="${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.css"> <link rel="stylesheet" href="${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.css">
<script type="text/javascript" src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.js"></script> <script type="text/javascript" src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table.min.js"></script>
<script type="text/javascript" src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"></script> <script type="text/javascript" src="${ctxStatic}/plugin/bootstrapTable/bootstrap-table-zh-CN.js"></script>
<script type="text/javascript" src="${ctxStatic}/common/js/big.js"></script>
<style> <style>
.sign-result{ .sign-result{
width: 80px; width: 80px;
......
<%@ page contentType="text/html;charset=UTF-8" %> <%@ page contentType="text/html;charset=UTF-8" %>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('#materialRequisitionTable').bootstrapTable({ $('#materialRequisitionTable').bootstrapTable({
//请求方法 //请求方法
...@@ -119,8 +119,8 @@ $(document).ready(function() { ...@@ -119,8 +119,8 @@ $(document).ready(function() {
sortable: true, sortable: true,
sortName: 'time' sortName: 'time'
} },
,{ {
field: 'status', field: 'status',
title: '出库状态', title: '出库状态',
sortable: true, sortable: true,
...@@ -129,13 +129,25 @@ $(document).ready(function() { ...@@ -129,13 +129,25 @@ $(document).ready(function() {
return jp.getDictLabel(${fns:toJson(fns:getDictList('wh_delivery_status'))}, value, "-"); return jp.getDictLabel(${fns:toJson(fns:getDictList('wh_delivery_status'))}, value, "-");
} }
} },
,{ {
field: 'remarks', field: 'remarks',
title: '备注信息', title: '备注信息',
sortable: true, sortable: true,
sortName: 'remarks' sortName: 'remarks'
},
{
title: '操作',
formatter (v, r) {
if (r.status === '1') {
return "<a class='delivery'>出库</a>"
}
},
events: {
'click .delivery': function (e, v, r) {
onDelivery(r.id);
}
}
} }
] ]
...@@ -216,13 +228,13 @@ $(document).ready(function() { ...@@ -216,13 +228,13 @@ $(document).ready(function() {
}); });
function getIdSelections() { function getIdSelections() {
return $.map($("#materialRequisitionTable").bootstrapTable('getSelections'), function (row) { return $.map($("#materialRequisitionTable").bootstrapTable('getSelections'), function (row) {
return row.id return row.id
}); });
} }
function deleteAll(){ function deleteAll(){
jp.confirm('确认要删除该物资领用记录吗?', function(){ jp.confirm('确认要删除该物资领用记录吗?', function(){
jp.loading(); jp.loading();
...@@ -236,35 +248,35 @@ $(document).ready(function() { ...@@ -236,35 +248,35 @@ $(document).ready(function() {
}) })
}) })
} }
//刷新列表 //刷新列表
function refresh(){ function refresh(){
$('#materialRequisitionTable').bootstrapTable('refresh'); $('#materialRequisitionTable').bootstrapTable('refresh');
} }
function add(){ function add(){
jp.openSaveDialog("新增物资领用","${ctx}/warehouse/materialrequisition/materialRequisition/form/add",'1200','800'); 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.openSaveDialog("编辑物资领用","${ctx}/warehouse/materialrequisition/materialRequisition/form/edit?id=" + id, '1200','800'); 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.openViewDialog("查看物资领用","${ctx}/warehouse/materialrequisition/materialRequisition/form/view?id=" + id,'1200','800'); jp.openViewDialog("查看物资领用","${ctx}/warehouse/materialrequisition/materialRequisition/form/view?id=" + id,'1200','800');
} }
function detailFormatter(index, row) { function detailFormatter(index, row) {
var htmltpl = $("#materialRequisitionChildrenTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,""); var htmltpl = $("#materialRequisitionChildrenTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
var html = Mustache.render(htmltpl, { var html = Mustache.render(htmltpl, {
idx:row.id idx:row.id
...@@ -282,29 +294,32 @@ $(document).ready(function() { ...@@ -282,29 +294,32 @@ $(document).ready(function() {
}) })
return html; return html;
} }
function addRow(list, idx, tpl, row){ function addRow(list, idx, tpl, row){
$(list).append(Mustache.render(tpl, { $(list).append(Mustache.render(tpl, {
idx: idx, delBtn: true, row: row idx: idx, delBtn: true, row: row
})); }));
} }
/** /**
* 出库 * 出库
*/ */
function onDelivery(){ function onDelivery (id) {
if (!id) {
id = getIdSelections();
}
jp.confirm('确认是否出库?', function (){ jp.confirm('确认是否出库?', function (){
jp.get('${ctx}/warehouse/materialrequisition/materialRequisition/delivery?id='+getIdSelections(), function (res){ jp.get('${ctx}/warehouse/materialrequisition/materialRequisition/delivery?id='+ id, function (res){
if(res.success){ if (res.success) {
jp.success(res.msg); jp.success(res.msg);
refresh(); refresh();
}else{ } else {
jp.error(res.msg); jp.error(res.msg);
} }
}) })
}) })
} }
</script> </script>
<script type="text/template" id="materialRequisitionChildrenTpl">//<!-- <script type="text/template" id="materialRequisitionChildrenTpl">//<!--
<div class="tabs-container"> <div class="tabs-container">
...@@ -317,10 +332,16 @@ $(document).ready(function() { ...@@ -317,10 +332,16 @@ $(document).ready(function() {
<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>
<th>备注</th> <th>备注</th>
</tr> </tr>
...@@ -330,29 +351,47 @@ $(document).ready(function() { ...@@ -330,29 +351,47 @@ $(document).ready(function() {
</table> </table>
</div> </div>
</div>//--> </div>//-->
</script> </script>
<script type="text/template" id="materialRequisitionChild1Tpl">//<!-- <script type="text/template" id="materialRequisitionChild1Tpl">//<!--
<tr> <tr>
<td> <td>
{{row.ledgerInfo.code}} {{row.ledgerInfo.code}}
</td> </td>
<td> <td>
{{row.ledgerInfo.name}} {{row.ledgerInfo.type.name}}
</td> </td>
<td> <td>
{{row.ledgerInfo.model}} {{row.ledgerInfo.type.code}}
</td> </td>
<td> <td>
{{row.ledgerInfo.type.name}} {{row.ledgerInfo.num}}
</td>
<td>
{{row.ledgerInfo.type.unit}}
</td>
<td>
{{row.ledgerInfo.model}}
</td> </td>
<td> <td>
{{row.ledgerInfo.amount}} {{row.ledgerInfo.amount}}
</td> </td>
<td> <td>
{{row.ledgerInfo.infoSum}}
</td>
<td>
{{row.ledgerInfo.batchNum}}
</td>
<td>
{{row.shelvesNames}}
</td>
<td>
{{row.warehouseNames}}
</td>
<td>
<img src="{{row.receiver}}" width="80"/> <img src="{{row.receiver}}" width="80"/>
</td> </td>
<td> <td>
{{row.remarks}} {{row.remarks}}
</td> </td>
</tr>//--> </tr>//-->
</script> </script>
...@@ -299,11 +299,18 @@ $(document).ready(function() { ...@@ -299,11 +299,18 @@ $(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>
</tr> </tr>
</thead> </thead>
<tbody id="outboundChild-{{idx}}-1-List"> <tbody id="outboundChild-{{idx}}-1-List">
...@@ -315,21 +322,42 @@ $(document).ready(function() { ...@@ -315,21 +322,42 @@ $(document).ready(function() {
<script type="text/template" id="outboundChild1Tpl">//<!-- <script type="text/template" id="outboundChild1Tpl">//<!--
<tr> <tr>
<td> <td>
{{row.ledgerInfo.name}}
</td>
<td>
{{row.ledgerInfo.code}} {{row.ledgerInfo.code}}
</td> </td>
<td> <td>
{{row.ledgerInfo.type.name}} {{row.ledgerInfo.type.name}}
</td> </td>
<td> <td>
{{row.ledgerInfo.type.code}}
</td>
<td>
{{row.ledgerInfo.num}}
</td>
<td>
{{row.ledgerInfo.type.unit}}
</td>
<td>
{{row.ledgerInfo.model}} {{row.ledgerInfo.model}}
</td> </td>
<td> <td>
{{row.ledgerInfo.amount}} {{row.ledgerInfo.amount}}
</td> </td>
<td> <td>
{{row.ledgerInfo.infoSum}}
</td>
<td>
{{row.ledgerInfo.batchNum}}
</td>
<td>
{{row.shelvesNames}}
</td>
<td>
{{row.warehouseNames}}
</td>
<td>
<img src="{{row.receiver}}" width="80"/>
</td>
<td>
{{row.remarks}} {{row.remarks}}
</td> </td>
</tr>//--> </tr>//-->
......
<%@ page contentType="text/html;charset=UTF-8" %> <%@ page contentType="text/html;charset=UTF-8" %>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('#storageTable').bootstrapTable({ $('#storageTable').bootstrapTable({
//请求方法 //请求方法
...@@ -120,13 +120,13 @@ $(document).ready(function() { ...@@ -120,13 +120,13 @@ $(document).ready(function() {
sortName: 'batchNum' sortName: 'batchNum'
} }
,{ // ,{
field: 'remarks', // field: 'remarks',
title: '备注信息', // title: '备注信息',
sortable: true, // sortable: true,
sortName: 'remarks' // sortName: 'remarks'
//
} // }
] ]
}); });
...@@ -211,13 +211,13 @@ $(document).ready(function() { ...@@ -211,13 +211,13 @@ $(document).ready(function() {
}); });
function getIdSelections() { function getIdSelections() {
return $.map($("#storageTable").bootstrapTable('getSelections'), function (row) { return $.map($("#storageTable").bootstrapTable('getSelections'), function (row) {
return row.id return row.id
}); });
} }
function deleteAll(){ function deleteAll(){
jp.confirm('确认要删除该入库信息记录吗?', function(){ jp.confirm('确认要删除该入库信息记录吗?', function(){
jp.loading(); jp.loading();
...@@ -231,35 +231,35 @@ $(document).ready(function() { ...@@ -231,35 +231,35 @@ $(document).ready(function() {
}) })
}) })
} }
//刷新列表 //刷新列表
function refresh(){ function refresh(){
$('#storageTable').bootstrapTable('refresh'); $('#storageTable').bootstrapTable('refresh');
} }
function add(){ function add(){
jp.openSaveDialog("新增入库单","${ctx}/warehouse/storage/storage/form/add", '1400', '800'); jp.openSaveDialog("新增入库单","${ctx}/warehouse/storage/storage/form/add", '1400', '800');
} }
function edit(id){ function edit(id){
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.openSaveDialog("编辑入库单","${ctx}/warehouse/storage/storage/form/edit?id=" + id, '1400', '800'); jp.openSaveDialog("编辑入库单","${ctx}/warehouse/storage/storage/form/edit?id=" + id, '1400', '800');
} }
function view(id){//没有权限时,不显示确定按钮 function view(id){//没有权限时,不显示确定按钮
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.openViewDialog("查看入库单","${ctx}/warehouse/storage/storage/form/view?id=" + id, '1400', '800'); jp.openViewDialog("查看入库单","${ctx}/warehouse/storage/storage/form/view?id=" + id, '1400', '800');
} }
function detailFormatter(index, row) { function detailFormatter(index, row) {
var htmltpl = $("#storageChildrenTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,""); var htmltpl = $("#storageChildrenTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
var html = Mustache.render(htmltpl, { var html = Mustache.render(htmltpl, {
idx:row.id idx:row.id
...@@ -291,15 +291,15 @@ $(document).ready(function() { ...@@ -291,15 +291,15 @@ $(document).ready(function() {
}) })
return html; return html;
} }
function addRow(list, idx, tpl, row){ function addRow(list, idx, tpl, row){
$(list).append(Mustache.render(tpl, { $(list).append(Mustache.render(tpl, {
idx: idx, delBtn: true, row: row idx: idx, delBtn: true, row: row
})); }));
} }
function onStorage(countStorage, goodsInfoId, rowIndex){ function onStorage(countStorage, goodsInfoId, rowIndex){
debugger debugger
var main = JSON.parse(countStorage); var main = JSON.parse(countStorage);
var data = [main]; var data = [main];
...@@ -332,8 +332,9 @@ $(document).ready(function() { ...@@ -332,8 +332,9 @@ $(document).ready(function() {
var num$ = $("<input type='hidden' name='ledgerInfoList["+index+"].num' value='"+item.num+"' />"); var num$ = $("<input type='hidden' name='ledgerInfoList["+index+"].num' value='"+item.num+"' />");
var shelvesIds$ = $("<input type='hidden' name='ledgerInfoList["+index+"].shelvesIds' value='"+item.shelvesIds+"' />"); var shelvesIds$ = $("<input type='hidden' name='ledgerInfoList["+index+"].shelvesIds' value='"+item.shelvesIds+"' />");
var warehouseIds$ = $("<input type='hidden' name='ledgerInfoList["+index+"].warehouseIds' value='"+item.warehouseIds+"' />"); var warehouseIds$ = $("<input type='hidden' name='ledgerInfoList["+index+"].warehouseIds' value='"+item.warehouseIds+"' />");
var remarks$ = $("<input type='hidden' name='ledgerInfoList["+index+"].remarks' value='"+item.remarks+"' />");
$("#ledgerForm").append(id$).append(delFlag$).append(name$).append(typeId$).append(batchNum$).append(model$).append(num$) $("#ledgerForm").append(id$).append(delFlag$).append(name$).append(typeId$).append(batchNum$).append(model$).append(num$)
.append(goodsInfoId$).append(qrId$).append(code$).append(amount$).append(shelvesIds$).append(warehouseIds$); .append(goodsInfoId$).append(qrId$).append(code$).append(amount$).append(shelvesIds$).append(warehouseIds$).append(remarks$);
}) })
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){
...@@ -353,7 +354,7 @@ $(document).ready(function() { ...@@ -353,7 +354,7 @@ $(document).ready(function() {
// //
// } // }
// }) // })
} }
</script> </script>
<script type="text/template" id="storageChildrenTpl">//<!-- <script type="text/template" id="storageChildrenTpl">//<!--
...@@ -375,6 +376,7 @@ $(document).ready(function() { ...@@ -375,6 +376,7 @@ $(document).ready(function() {
<th>总价</th> <th>总价</th>
<th>仓库</th> <th>仓库</th>
<th>货架</th> <th>货架</th>
<th>备注</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
...@@ -383,8 +385,8 @@ $(document).ready(function() { ...@@ -383,8 +385,8 @@ $(document).ready(function() {
</table> </table>
</div> </div>
</div>//--> </div>//-->
</script> </script>
<script type="text/template" id="storageChild1Tpl">//<!-- <script type="text/template" id="storageChild1Tpl">//<!--
<tr> <tr>
<td> <td>
{{row.type.name}} {{row.type.name}}
...@@ -413,7 +415,9 @@ $(document).ready(function() { ...@@ -413,7 +415,9 @@ $(document).ready(function() {
<td> <td>
{{row.shelvesNames}} {{row.shelvesNames}}
</td> </td>
<td>
{{row.remarks}}
</td>
{{#row.isNotStorage}} {{#row.isNotStorage}}
<td> <td>
<a href="javascript:void(0);" onclick="onStorage('{{row.jsonStr}}','{{row.goodsInfo.id}}',{{row.mainRowIndex}})">入库</a> <a href="javascript:void(0);" onclick="onStorage('{{row.jsonStr}}','{{row.goodsInfo.id}}',{{row.mainRowIndex}})">入库</a>
...@@ -425,4 +429,4 @@ $(document).ready(function() { ...@@ -425,4 +429,4 @@ $(document).ready(function() {
</td> </td>
{{/row.isStorage}} {{/row.isStorage}}
</tr>//--> </tr>//-->
</script> </script>
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