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: 'warehouseNames', field: "type.unit",
title: '仓库', title: '单位'
align: 'center' },
{
field: 'model',
title: '型号',
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);
}) })
} }
...@@ -234,4 +285,4 @@ ...@@ -234,4 +285,4 @@
<button id="batchPrintBtn" class="btn btn-primary" onclick="onPrint()" disabled>批量打印</button> <button id="batchPrintBtn" class="btn btn-primary" onclick="onPrint()" disabled>批量打印</button>
<table id="table"></table> <table id="table"></table>
</div> </div>
</script> </script>
\ No newline at end of file
...@@ -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}}
...@@ -418,4 +471,4 @@ ...@@ -418,4 +471,4 @@
</div> </div>
</div> </div>
<br> <br>
</script> </script>
\ No newline at end of file
...@@ -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;
...@@ -146,4 +147,4 @@ ...@@ -146,4 +147,4 @@
} }
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -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>//-->
......
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