Commit 8ad7d0d8 by zhanglt

Merge branch 'master' of http://gitlab.yqdchina.com/huyi/warehouse into zlt

parents afc02f47 6134ed62
...@@ -90,6 +90,9 @@ ...@@ -90,6 +90,9 @@
<if test="dbName == 'mssql'">'%'+#{code}+'%'</if> <if test="dbName == 'mssql'">'%'+#{code}+'%'</if>
<if test="dbName == 'mysql'">concat('%',#{code},'%')</if> <if test="dbName == 'mysql'">concat('%',#{code},'%')</if>
</if> </if>
<if test="qr != null and qr.id != null and qr.id != ''">
AND a.qr_id = #{qr.id}
</if>
</where> </where>
<choose> <choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''"> <when test="page !=null and page.orderBy != null and page.orderBy != ''">
......
...@@ -106,6 +106,13 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> { ...@@ -106,6 +106,13 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
return super.findPage(page, ledger); return super.findPage(page, ledger);
} }
public Page<LedgerInfo> findInfoPage(Page<LedgerInfo> page, LedgerInfo ledgerInfo) {
dataRuleFilter(ledgerInfo);
ledgerInfo.setPage(page);
page.setList(ledgerInfoMapper.findList(ledgerInfo));
return page;
}
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void save(Ledger ledger) { public void save(Ledger ledger) {
Ledger oldLeger = mapper.findByTypeAndModel(ledger); Ledger oldLeger = mapper.findByTypeAndModel(ledger);
...@@ -174,4 +181,14 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> { ...@@ -174,4 +181,14 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
ledgerInfoMapper.delete(new LedgerInfo(ledger)); ledgerInfoMapper.delete(new LedgerInfo(ledger));
} }
@Transactional(readOnly = false)
public LedgerInfo findByQrOrCode(LedgerInfo ledgerInfo) {
List<LedgerInfo> ledgerInfoList = ledgerInfoMapper.findList(ledgerInfo);
if (null != ledgerInfoList && ledgerInfoList.size() > 0) {
return ledgerInfoList.get(0);
} else {
return null;
}
}
} }
\ No newline at end of file
...@@ -12,6 +12,8 @@ import javax.servlet.http.HttpServletRequest; ...@@ -12,6 +12,8 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException; import javax.validation.ConstraintViolationException;
import com.jeeplus.modules.warehouse.ledger.entity.LedgerInfo;
import com.jeeplus.modules.warehouse.qrcode.entity.QrCode;
import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -174,6 +176,8 @@ public class LedgerController extends BaseController { ...@@ -174,6 +176,8 @@ public class LedgerController extends BaseController {
return ledgerService.get(id); return ledgerService.get(id);
} }
@ResponseBody
@RequestMapping(value = "countLedger")
public Ledger countLedger(String id) { public Ledger countLedger(String id) {
return ledgerService.countLedger(id); return ledgerService.countLedger(id);
} }
...@@ -235,4 +239,45 @@ public class LedgerController extends BaseController { ...@@ -235,4 +239,45 @@ public class LedgerController extends BaseController {
} }
@ResponseBody
@RequestMapping(value = "infoDate")
public Map<String, Object> infoDate(LedgerInfo ledgerInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<LedgerInfo> page = ledgerService.findInfoPage(new Page<LedgerInfo>(request, response), ledgerInfo);
return getBootstrapData(page);
}
/**
* 根据二维码id或者物资编码返货台账明细信息
* @param qrId
* @param code
* @return
*/
@ResponseBody
@RequestMapping(value = "findByQrOrCode")
public AjaxJson findByQrOrCode(String qrId, String code) {
AjaxJson j = new AjaxJson();
boolean b = false;
if (StringUtils.isNotBlank(qrId)) {
b = true;
}
if (StringUtils.isNotBlank(code)) {
b = true;
}
if (b) {
LedgerInfo temLi = new LedgerInfo();
QrCode qrCode = new QrCode();
qrCode.setId(qrId);
temLi.setQr(qrCode);
temLi.setCode(code);
LedgerInfo ledgerInfo = ledgerService.findByQrOrCode(temLi);
j.put("ledgerInfo", ledgerInfo);
j.setSuccess(true);
j.setMsg("查询成功");
} else {
j.setSuccess(false);
j.setMsg("查询失败");
}
return j;
}
} }
\ No newline at end of file
...@@ -22,7 +22,8 @@ public class CountStorageInfo extends DataEntity<StorageInfo> { ...@@ -22,7 +22,8 @@ public class CountStorageInfo extends DataEntity<StorageInfo> {
private GoodsInfo goodsInfo; // 货品明细id private GoodsInfo goodsInfo; // 货品明细id
private Shelves shelves; // 货架id private Shelves shelves; // 货架id
private Warehouse warehouse; // 仓库外键 private Warehouse warehouse; // 仓库外键
private BigDecimal sum; // 单价 private BigDecimal sum; // 总价
private BigDecimal amount; // 单价
private int num; // 数量 private int num; // 数量
private String state; // 入库状态 private String state; // 入库状态
...@@ -132,4 +133,12 @@ public class CountStorageInfo extends DataEntity<StorageInfo> { ...@@ -132,4 +133,12 @@ public class CountStorageInfo extends DataEntity<StorageInfo> {
public void setState(String state) { public void setState(String state) {
this.state = state; this.state = state;
} }
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
} }
...@@ -202,6 +202,7 @@ ...@@ -202,6 +202,7 @@
type.name AS "type.name", type.name AS "type.name",
a.model AS "model", a.model AS "model",
sum(a.amount) AS "sum", sum(a.amount) AS "sum",
a.amount AS "amount",
a.goods_info_id AS "goodsInfo.id", a.goods_info_id AS "goodsInfo.id",
a.shelves_id AS "shelves.id", a.shelves_id AS "shelves.id",
s.name AS "shelves.name", s.name AS "shelves.name",
...@@ -221,7 +222,7 @@ ...@@ -221,7 +222,7 @@
AND a.storage_id = #{storage.id} AND a.storage_id = #{storage.id}
</if> </if>
</where> </where>
GROUP BY a.goods_info_id,a.shelves_id,qr.state GROUP BY a.goods_info_id,a.shelves_id,qr.state,a.amount
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -90,6 +90,7 @@ public class StorageService extends CrudService<StorageMapper, Storage> { ...@@ -90,6 +90,7 @@ public class StorageService extends CrudService<StorageMapper, Storage> {
csi.setName(c.getName()); csi.setName(c.getName());
csi.setType(c.getType()); csi.setType(c.getType());
csi.setState(c.getState()); csi.setState(c.getState());
csi.setAmount(c.getAmount());
} }
if (i != list.size() - 1) { if (i != list.size() - 1) {
shelvesNames = shelvesNames + c.getShelves().getName() + ","; shelvesNames = shelvesNames + c.getShelves().getName() + ",";
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
var data = ${fns:toJson(ledger.ledgerInfoList)}; var data = ${fns:toJson(ledger.ledgerInfoList)};
$(selector).bootstrapTable({ $(selector).bootstrapTable({
data: data, data: data,
columns:[{checkbox: true}, columns:[
{ {
field: 'no', field: 'no',
title: '序号', title: '序号',
...@@ -183,6 +183,10 @@ ...@@ -183,6 +183,10 @@
<input id="ledgerInfoList{{idx}}_batchNum" name="ledgerInfoList[{{idx}}].batchNum" type="text" value="{{row.batchNum}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/> <input id="ledgerInfoList{{idx}}_batchNum" name="ledgerInfoList[{{idx}}].batchNum" type="text" value="{{row.batchNum}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script> </script>
<script id="shelvesTpl" type="text/html">
<input id="ledgerInfoList{{idx}}_shelvesName" name="ledgerInfoList[{{idx}}].shelves.name" type="text" value="{{row.shelves.name}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
<script id="codeTpl" type="text/html"> <script id="codeTpl" type="text/html">
<input id="ledgerInfoList{{idx}}_code" name="ledgerInfoList[{{idx}}].code" type="text" value="{{row.code}}" readonly class="form-control" /> <input id="ledgerInfoList{{idx}}_code" name="ledgerInfoList[{{idx}}].code" type="text" value="{{row.code}}" readonly class="form-control" />
</script> </script>
...@@ -124,10 +124,10 @@ $(document).ready(function() { ...@@ -124,10 +124,10 @@ $(document).ready(function() {
} }
,{ ,{
field: 'shelvesIds', field: 'sum',
title: '货架id集合', title: '总价',
sortable: true, sortable: true,
sortName: 'shelvesIds' sortName: 'sum'
} }
,{ ,{
...@@ -138,10 +138,10 @@ $(document).ready(function() { ...@@ -138,10 +138,10 @@ $(document).ready(function() {
} }
,{ ,{
field: 'remarks', field: 'createDate',
title: '备注信息', title: '创建时间',
sortable: true, sortable: true,
sortName: 'remarks' sortName: 'createDate'
} }
] ]
...@@ -275,9 +275,9 @@ $(document).ready(function() { ...@@ -275,9 +275,9 @@ $(document).ready(function() {
var html = Mustache.render(htmltpl, { var html = Mustache.render(htmltpl, {
idx:row.id idx:row.id
}); });
$.get("${ctx}/warehouse/ledger/ledger/detail?id="+row.id, function(ledger){ $.get("${ctx}/warehouse/ledger/ledger/countLedger?id="+row.id, function(ledger){
var ledgerChild1RowIdx = 0, ledgerChild1Tpl = $("#ledgerChild1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,""); var ledgerChild1RowIdx = 0, ledgerChild1Tpl = $("#ledgerChild1Tpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
var data1 = ledger.ledgerInfoList; var data1 = ledger.countLedgerInfoList;
for (var i=0; i<data1.length; i++){ for (var i=0; i<data1.length; i++){
data1[i].dict = {}; data1[i].dict = {};
addRow('#ledgerChild-'+row.id+'-1-List', ledgerChild1RowIdx, ledgerChild1Tpl, data1[i]); addRow('#ledgerChild-'+row.id+'-1-List', ledgerChild1RowIdx, ledgerChild1Tpl, data1[i]);
...@@ -312,7 +312,7 @@ $(document).ready(function() { ...@@ -312,7 +312,7 @@ $(document).ready(function() {
<th>型号</th> <th>型号</th>
<th>批次号</th> <th>批次号</th>
<th>货架</th> <th>货架</th>
<th>物资编码</th> <th>仓库</th>
</tr> </tr>
</thead> </thead>
<tbody id="ledgerChild-{{idx}}-1-List"> <tbody id="ledgerChild-{{idx}}-1-List">
...@@ -327,7 +327,7 @@ $(document).ready(function() { ...@@ -327,7 +327,7 @@ $(document).ready(function() {
{{row.name}} {{row.name}}
</td> </td>
<td> <td>
{{row.type.code}} {{row.type.name}}
</td> </td>
<td> <td>
{{row.model}} {{row.model}}
...@@ -336,22 +336,12 @@ $(document).ready(function() { ...@@ -336,22 +336,12 @@ $(document).ready(function() {
{{row.batchNum}} {{row.batchNum}}
</td> </td>
<td> <td>
{{row.ledger.id}} {{row.shelvesNames}}
</td>
<td>
{{row.goodsInfo.id}}
</td>
<td>
{{row.qr.id}}
</td>
<td>
{{row.shelves.name}}
</td>
<td>
{{row.code}}
</td> </td>
<td> <td>
{{row.remarks}} {{row.warehouseNames}}
</td> </td>
</tr>//--> </tr>//-->
</script> </script>
<%--
Created by IntelliJ IDEA.
User: yangzi
Date: 2023/2/21
Time: 10:29
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/webpage/include/taglib.jsp" %>
<div id="toolbar" class="text-left">
<c:if test="${mode == 'add' || mode == 'edit'}">
<a class="btn btn-primary btn-sm" onclick="addDetail('#detail_table')" title="新增"><i class="fa fa-plus"></i> 手动添加</a>
<a class="btn btn-primary btn-sm" onclick="addScan('#detail_table')" title="新增"><i class="fa fa-plus"></i> 扫码添加</a>
<a id="editAll" class="btn btn-primary btn-sm" onclick="addShelve('#detail_table')" title="新增"><i class="fa fa-plus"></i> 批量编辑货架</a>
</c:if>
</div>
<table id="detail_table" data-toolbar="#toolbar"></table>
<script>
var selector = "#detail_table";
function initTable(){
var data = ${fns:toJson(materialRequisition.materialRequisitionInfoList)};
$(selector).bootstrapTable({
data: data,
columns:[{checkbox: true},
{
field: 'no',
title: '序号',
align: 'center',
width: 60,
formatter: function (value, row, index){
var tpl = $("#hideTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
var html = Mustache.render(tpl, {
idx: index,
row: row
})
return html + '<span>'+(index+1)+'</span>'
}
},
{
field: 'name',
title: '名称',
formatter: function (value,row,index){
return Mustache.render($("#nameTpl").html(),{
row: row,
idx: index
})
}
},
{
field: 'type.name',
title: '类型',
formatter: function (value,row,index){
return Mustache.render($("#typeTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: 'remarks',
title: '备注',
formatter: function (value,row,index){
return Mustache.render($("#remarksTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""),{
row: row,
idx: index
})
}
},
{
field: '',
title: '操作',
formatter: function (value,row,index){
var text = row.delFlag == 1 ? '撤销删除' : '删除';
var result = ["<a href='javascript:void(0);' onclick=\"removeRow(" + index + ", '" + row.id + "', '" + row.delFlag + "')\">"+text+"</a>" ]
return result.join('');
}
}
]
});
$(selector).on('check.bs.table uncheck.bs.table load-success.bs.table ' +
'check-all.bs.table uncheck-all.bs.table', function () {
$('#editAll').prop('disabled', !getSelections().length);
});
}
function getSelections(){
return $(selector).bootstrapTable('getSelections');
}
/**
* 手动添加明细
* @param selector
*/
function addDetail(selector){
// 选择该批次号下的货品明细
if(!$("#batchNum").val()){
jp.warning('请选择批次号!');
return;
}
jp.openStorageSelectDialog({batchNum:$("#batchNum").val(),state: 0, isMultiSelect: true },function (items){
if(Array.isArray(items)){
var data = items.map(function (item){
if(item.goodsInfo && !item.goodsInfo.amount){
item.goodsInfo.amount = 0;
}
return {
id: '',
delFlag: 0,
remarks: '',
...item
}
})
$(selector).bootstrapTable('append', data)
}
})
}
function removeRow(index, rowId, rowDelFlag){
if(rowId){
var delFlag = rowDelFlag === 1 ? 0 : 1
updateRow(index, {
delFlag: delFlag
})
}else{
$(selector).bootstrapTable("remove", {
field: '$index',
values: [index]
})
}
}
function updateRow(index, row){
$(selector).bootstrapTable('updateRow', {
index: index,
row: row
})
}
function onInputChange(rowIndex, elem , field){
var obj = {};
obj[field] = $(elem).val()
var timer = null;
clearTimeout(timer);
timer = setTimeout(function (){
updateRow(rowIndex, obj)
}, 0)
}
function onSelectType(nodes, rowIndex){
if(Array.isArray(nodes) && nodes.length === 1){
var node = nodes[0];
var obj = {
type: {
id: node.id,
name: node.text
}
};
updateRow(rowIndex, obj)
}
}
/**
* 获取所有明细数据
* @returns {*|jQuery}
*/
function getTableData(){
return $(selector).bootstrapTable('getData');
}
function addShelve(){
jp.openShelvesSelectDialog(function (items){
var Shelve = items[0];
// TODO: 获取选中的明细下标
getSelections().forEach(function (item){
var index = getTableData().findIndex(function (current){
return current.qrCode.id === item.qrCode.id;
})
updateRow(index,{
shelves: {
id: Shelve.id,
name: Shelve.name
},
warehouse: Shelve.warehouse
})
})
})
}
/**
* 点击扫码显示扫码窗口
*/
function addScan(){
layer.open({
type: 1,
title: '扫码',
auto: true,
area: ['500','300'],
content: $("#scanResultTpl").html(),
success: function (){
$("#scanResult").focus();
},
btn:['关闭']
})
}
/**
* 扫码
* 一、获取扫码结果
* 二、请求后台接口获取结果
* 三、增一条明细数据
* 四、清空扫码结果
* @param elem
*/
function onScanChange(elem){
try{
var json = JSON.parse($(elem).val());
var qrCodeId = json.code;
var goodsInfoId = json.infoId;
jp.get('${ctx}/warehouse/goods/goods/getGIAndQCByTwoId?goodsInfoId='+goodsInfoId+"&qrCodeId="+qrCodeId, function (res){
var qrCode = res.body.qrCode;
$(selector).bootstrapTable('append',[
{
qrCode: qrCode,
goodsInfo: qrCode.goodsInfo,
...qrCode.goodsInfo,
id: '',
delFlag: 0,
remarks: ''
}
]);
$(elem).val('').focus();
})
}catch (e){
console.log(e);
}
}
</script>
<script id="hideTpl" type="text/html">
<input id="materialRequisitionInfoList{{idx}}_id" name="materialRequisitionInfoList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
<input id="materialRequisitionInfoList{{idx}}_delFlag" name="materialRequisitionInfoList[{{idx}}].delFlag" type="hidden" value="{{row.delFlag}}"/>
<input id="materialRequisitionInfoList{{idx}}_materialRequisition" name="materialRequisitionInfoList[{{idx}}].materialRequisition.id" type="hidden" value="{{row.materialRequisition.id}}"/>
</script>
<script id="ledgerInfoTpl" type="text/html">//<!--
<sys:gridselect url="${ctx}/warehouse/ledger/ledger/data" id="materialRequisitionInfoList{{idx}}_ledgerInfo" name="materialRequisitionInfoList[{{idx}}].ledgerInfo.id" value="{{row.ledgerInfo.id}}" labelName="materialRequisitionInfoList[{{idx}}].ledgerInfo.name" labelValue="{{row.ledgerInfo.name}}"
title="选择物资" cssClass="form-control required" fieldLabels="物资名称|物资编号" fieldKeys="name|code" searchLabels="仓库名称|仓库编号" searchKeys="name|code" ></sys:gridselect>//-->
</script>
<script id="typeTpl" type="text/html">//<!--
<sys:treeselect id="storageInfoList{{idx}}_type" name="storageInfoList[{{idx}}].type.id" value="{{row.type.id}}" labelName="storageInfoList{{idx}}.type.name" labelValue="{{row.type.name}}"
title="类型" url="/warehouse/materialtype/materialType/treeData" cssClass="form-control " disabled="disabled" allowClear="true" allowSearch="true" callback="onSelectType" />//-->
</script>
<script id="modelTpl" type="text/html">
<input id="storageInfoList{{idx}}_model" name="storageInfoList[{{idx}}].model" type="text" value="{{row.model}}" readonly onchange="onInputChange('{{idx}}', this, 'model')" class="form-control "/>
</script>
<script id="shelvesTpl" type="text/html">
<input id="storageInfoList{{idx}}_shelvesName" name="storageInfoList[{{idx}}].shelves.name" type="text" value="{{row.shelves.name}}" readonly class="form-control" />
</script>
<script id="remarksTpl" type="text/html">
<textarea id="storageInfoList{{idx}}_remarks" name="storageInfoList[{{idx}}].remarks" rows="2" onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
</script>
<script id="scanResultTpl" type="text/html">
<br>
<div class="container-fluid">
<div class="row">
<div class="col-xs-2 text-right">
<label>扫码结果:</label>
</div>
<div class="col-xs-10">
<input type="text" id="scanResult" class="form-control" onchange="onScanChange(this)">
<span class="text-danger">请切换英文输入法</span>
</div>
</div>
</div>
<br>
</script>
\ No newline at end of file
...@@ -242,21 +242,21 @@ $(document).ready(function() { ...@@ -242,21 +242,21 @@ $(document).ready(function() {
$('#materialRequisitionTable').bootstrapTable('refresh'); $('#materialRequisitionTable').bootstrapTable('refresh');
} }
function add(){ function add(){
jp.go("${ctx}/warehouse/materialrequisition/materialRequisition/form/add"); jp.openSaveDialog("新增物资领用","${ctx}/warehouse/materialrequisition/materialRequisition/form/add",'1200','800');
} }
function edit(id){ function edit(id){
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.go("${ctx}/warehouse/materialrequisition/materialRequisition/form/edit?id=" + id); jp.openSaveDialog("编辑物资领用","${ctx}/warehouse/materialrequisition/materialRequisition/form/edit?id=" + id, '1200','800');
} }
function view(id){//没有权限时,不显示确定按钮 function view(id){//没有权限时,不显示确定按钮
if(id == undefined){ if(id == undefined){
id = getIdSelections(); id = getIdSelections();
} }
jp.go("${ctx}/warehouse/materialrequisition/materialRequisition/form/view?id=" + id); jp.openViewDialog("查看物资领用","${ctx}/warehouse/materialrequisition/materialRequisition/form/view?id=" + id,'1200','800');
} }
......
...@@ -284,6 +284,7 @@ $(document).ready(function() { ...@@ -284,6 +284,7 @@ $(document).ready(function() {
data1[i].jsonStr = JSON.stringify(data1[i]); data1[i].jsonStr = JSON.stringify(data1[i]);
data1[i].isNotStorage = data1[i].state === '1'; data1[i].isNotStorage = data1[i].state === '1';
data1[i].isStorage = data1[i].state === '2'; data1[i].isStorage = data1[i].state === '2';
data1[i].mainRowIndex = index;
addRow('#storageChild-'+row.id+'-1-List', storageChild1RowIdx, storageChild1Tpl, data1[i]); addRow('#storageChild-'+row.id+'-1-List', storageChild1RowIdx, storageChild1Tpl, data1[i]);
storageChild1RowIdx = storageChild1RowIdx + 1; storageChild1RowIdx = storageChild1RowIdx + 1;
} }
...@@ -300,7 +301,7 @@ $(document).ready(function() { ...@@ -300,7 +301,7 @@ $(document).ready(function() {
})); }));
} }
function onStorage(countStorage, goodsInfoId){ function onStorage(countStorage, goodsInfoId, rowIndex){
var main = JSON.parse(countStorage); var main = JSON.parse(countStorage);
jp.get("${ctx}/warehouse/storage/storage/findInfoBycountStorage?goodsInfo.id="+goodsInfoId+"&storage="+main.storageId, function (res){ jp.get("${ctx}/warehouse/storage/storage/findInfoBycountStorage?goodsInfo.id="+goodsInfoId+"&storage="+main.storageId, function (res){
var data = res.body.storageInfoList; var data = res.body.storageInfoList;
...@@ -330,12 +331,16 @@ $(document).ready(function() { ...@@ -330,12 +331,16 @@ $(document).ready(function() {
var qrId$ = $("<input type='hidden' name='ledgerInfoList["+index+"].qr.id' value='"+item.qrCode.id+"' />"); var qrId$ = $("<input type='hidden' name='ledgerInfoList["+index+"].qr.id' value='"+item.qrCode.id+"' />");
var shelvesId$ = $("<input type='hidden' name='ledgerInfoList["+index+"].shelves.id' value='"+item.shelves.id+"' />"); var shelvesId$ = $("<input type='hidden' name='ledgerInfoList["+index+"].shelves.id' value='"+item.shelves.id+"' />");
var code$ = $("<input type='hidden' name='ledgerInfoList["+index+"].code' value='"+item.qrCode.code+"' />"); var code$ = $("<input type='hidden' name='ledgerInfoList["+index+"].code' value='"+item.qrCode.code+"' />");
$("#ledgerForm").append(delFlag$).append(name$).append(typeId$).append(batchNum$).append(model$).append(goodsInfoId$).append(qrId$).append(shelvesId$).append(code$); $("#ledgerForm").append(id$).append(delFlag$).append(name$).append(typeId$).append(batchNum$).append(model$).append(goodsInfoId$).append(qrId$).append(shelvesId$).append(code$);
}) })
jp.loading('入库中...'); jp.loading('入库中...');
jp.post("${ctx}/warehouse/ledger/ledger/save", $("#ledgerForm").serialize(), function (res){ jp.post("${ctx}/warehouse/ledger/ledger/save", $("#ledgerForm").serialize(), function (res){
if(res.success){ if(res.success){
jp.success('入库成功!'); jp.success('入库成功!');
$('#storageTable').bootstrapTable('collapseRow', rowIndex);
setTimeout(function (){
$('#storageTable').bootstrapTable('expandRow', rowIndex);
},0)
}else { }else {
jp.error('入库失败!'); jp.error('入库失败!');
} }
...@@ -396,7 +401,7 @@ $(document).ready(function() { ...@@ -396,7 +401,7 @@ $(document).ready(function() {
</td> </td>
{{#row.isNotStorage}} {{#row.isNotStorage}}
<td> <td>
<a href="javascript:void(0);" onclick="onStorage('{{row.jsonStr}}','{{row.goodsInfo.id}}')">入库</a> <a href="javascript:void(0);" onclick="onStorage('{{row.jsonStr}}','{{row.goodsInfo.id}}',{{row.mainRowIndex}})">入库</a>
</td> </td>
{{/row.isNotStorage}} {{/row.isNotStorage}}
{{#row.isStorage}} {{#row.isStorage}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment