Commit f1c0fb50 by 胡懿

修改出库报错的问题,升级poi,

parent 036d7ff7
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<jdk.version>1.8</jdk.version> <jdk.version>1.8</jdk.version>
<tomcat.version>2.2</tomcat.version> <tomcat.version>2.2</tomcat.version>
<jetty.version>7.6.14.v20131031</jetty.version> <jetty.version>7.6.14.v20131031</jetty.version>
<webserver.port>8081</webserver.port> <webserver.port>8083</webserver.port>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<downloadSources>true</downloadSources> <downloadSources>true</downloadSources>
......
...@@ -164,6 +164,7 @@ public class MaterialRequisitionService extends CrudService<MaterialRequisitionM ...@@ -164,6 +164,7 @@ public class MaterialRequisitionService extends CrudService<MaterialRequisitionM
}*/ }*/
outboundInfo.setId(""); outboundInfo.setId("");
outboundInfo.setOutbound(outbound); outboundInfo.setOutbound(outbound);
outboundInfo.setRemarks(one.getRemarks());
outboundInfo.setLedgerInfo(one.getLedgerInfo()); outboundInfo.setLedgerInfo(one.getLedgerInfo());
outboundInfoList.add(outboundInfo); outboundInfoList.add(outboundInfo);
} }
......
...@@ -77,9 +77,9 @@ var pageConfig = { ...@@ -77,9 +77,9 @@ var pageConfig = {
// 页长 // 页长
draw_h: 72.5, draw_h: 72.5,
// 横向位置 // 横向位置
Image_x: 0, Image_x: 3,
// 纵向位置 // 纵向位置
Image_y: 0, Image_y: 4,
// 图片宽度 // 图片宽度
Image_w: 84, Image_w: 84,
// 图片高度 // 图片高度
......
...@@ -22,10 +22,13 @@ ...@@ -22,10 +22,13 @@
var selector = "#detail_table"; var selector = "#detail_table";
function initTable() { function initTable() {
var info = ${fns:toJson(materialRequisition)};
console.log(info)
var data = ${fns:toJson(materialRequisition.materialRequisitionInfoList)}; var data = ${fns:toJson(materialRequisition.materialRequisitionInfoList)};
if(data.length){ if(data.length){
data = data.map(function(item){ data = data.map(function(item){
item.delFlag = 0; item.delFlag = 0;
item.canUse = info.status !== '2';
item.remarks = jp.escapeHtml(item.remarks); item.remarks = jp.escapeHtml(item.remarks);
item.infoSum = new Big(item.ledgerInfo.num).times(item.ledgerInfo.amount).toNumber(); item.infoSum = new Big(item.ledgerInfo.num).times(item.ledgerInfo.amount).toNumber();
return item; return item;
...@@ -156,6 +159,7 @@ ...@@ -156,6 +159,7 @@
field: '', field: '',
title: '操作', title: '操作',
formatter: function (value, row, index) { formatter: function (value, row, index) {
if (!row.canUse) return '';
var text = row.delFlag == 1 ? '撤销删除' : '删除'; var text = row.delFlag == 1 ? '撤销删除' : '删除';
var result = ["<a href='javascript:void(0);' onclick=\"removeRow(" + index + ", '" + row.id + "', '" + row.delFlag + "')\">" + text + "</a>"] var result = ["<a href='javascript:void(0);' onclick=\"removeRow(" + index + ", '" + row.id + "', '" + row.delFlag + "')\">" + text + "</a>"]
return result.join(''); return result.join('');
...@@ -242,7 +246,8 @@ ...@@ -242,7 +246,8 @@
delFlag: 0, delFlag: 0,
remarks: '', remarks: '',
ledgerInfo: Object.assign({}, item), ledgerInfo: Object.assign({}, item),
sortId: item.code + '_' + index sortId: item.code + '_' + index,
canUse: true
} }
}) })
newTableData = newTableData.concat(list); newTableData = newTableData.concat(list);
...@@ -265,7 +270,8 @@ ...@@ -265,7 +270,8 @@
delFlag: 0, delFlag: 0,
remarks: '', remarks: '',
ledgerInfo: Object.assign({}, item), ledgerInfo: Object.assign({}, item),
sortId: item.code + '_' + index sortId: item.code + '_' + index,
canUse: true
} }
}); });
newTableData.splice.apply(newTableData, [endIndex, 0].concat(newAddList)); newTableData.splice.apply(newTableData, [endIndex, 0].concat(newAddList));
...@@ -276,7 +282,8 @@ ...@@ -276,7 +282,8 @@
delFlag: 0, delFlag: 0,
remarks: '', remarks: '',
ledgerInfo: Object.assign({}, item), ledgerInfo: Object.assign({}, item),
sortId: item.code + '_' + index sortId: item.code + '_' + index,
canUse: true
} }
}); });
newTableData = newTableData.concat(newAddList); newTableData = newTableData.concat(newAddList);
...@@ -665,7 +672,9 @@ ...@@ -665,7 +672,9 @@
{{#row.receiver}} {{#row.receiver}}
<div class="sign-result"> <div class="sign-result">
<img src="{{row.receiver}}" alt="签名" width="100%" onclick="viewImage('{{row.receiver}}')" /> <img src="{{row.receiver}}" alt="签名" width="100%" onclick="viewImage('{{row.receiver}}')" />
{{#row.canUse}}
<span class="del-sign" onclick="delSign(this, '{{idx}}')">&times;</span> <span class="del-sign" onclick="delSign(this, '{{idx}}')">&times;</span>
{{/row.canUse}}
</div> </div>
{{/row.receiver}} {{/row.receiver}}
{{^row.receiver}} {{^row.receiver}}
...@@ -673,8 +682,15 @@ ...@@ -673,8 +682,15 @@
{{/row.receiver}} {{/row.receiver}}
</script> </script>
<script id="remarksTpl" type="text/html"> <script id="remarksTpl" type="text/html">
{{#row.canUse}}
<textarea id="materialRequisitionInfoList{{idx}}_remarks" name="materialRequisitionInfoList[{{idx}}].remarks" rows="2" <textarea id="materialRequisitionInfoList{{idx}}_remarks" name="materialRequisitionInfoList[{{idx}}].remarks" rows="2"
onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea> onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control ">{{row.remarks}}</textarea>
{{/row.canUse}}
{{^row.canUse}}
<textarea id="materialRequisitionInfoList{{idx}}_remarks" name="materialRequisitionInfoList[{{idx}}].remarks" rows="2"
onchange="onInputChange('{{idx}}', this, 'remarks')" class="form-control " readonly>{{row.remarks}}</textarea>
{{/row.canUse}}
</script> </script>
<script id="scanResultTpl" type="text/html"> <script id="scanResultTpl" type="text/html">
......
...@@ -125,7 +125,8 @@ ...@@ -125,7 +125,8 @@
if(!isValidate){ if(!isValidate){
return false; return false;
}else{ }else{
var hasDetails = getTableData().filter(function (e) { return e.delFlag != 1 }).length == 0; var list = getTableData().filter(function (e) { return e.delFlag != 1 });
var hasDetails = list.length == 0;
if(hasDetails){ if(hasDetails){
jp.warning('请填写领用物资!'); jp.warning('请填写领用物资!');
return; return;
...@@ -133,10 +134,10 @@ ...@@ -133,10 +134,10 @@
var hasReceiver = getTableData().every(function(item){ var hasReceiver = getTableData().every(function(item){
return item.receiver return item.receiver
}) })
// if(!hasReceiver){ if(!hasReceiver){
// jp.warning('领用人必填!'); jp.warning('领用人必填!');
// return; return;
// } }
jp.loading(); jp.loading();
jp.post($("#inputForm").attr('action'),$('#inputForm').serialize(),function(data){ jp.post($("#inputForm").attr('action'),$('#inputForm').serialize(),function(data){
if(data.success){ if(data.success){
......
...@@ -162,9 +162,19 @@ ...@@ -162,9 +162,19 @@
$('#materialRequisitionTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' + $('#materialRequisitionTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
'check-all.bs.table uncheck-all.bs.table', function () { 'check-all.bs.table uncheck-all.bs.table', function () {
$('#remove').prop('disabled', ! $('#materialRequisitionTable').bootstrapTable('getSelections').length);
$('#view,#edit').prop('disabled', $('#materialRequisitionTable').bootstrapTable('getSelections').length!=1); var list = $('#materialRequisitionTable').bootstrapTable('getSelections');
$('#delivery').prop('disabled', !($('#materialRequisitionTable').bootstrapTable('getSelections').length==1 && $('#materialRequisitionTable').bootstrapTable('getSelections')[0].status == '1')); var canUseList = list.filter(function (item) {
return item.status != '2';
})
$("#remove").prop('disabled', !canUseList.length);
$("#edit").prop('disabled', canUseList.length !== 1);
$("#view").prop('disabled', list.length !== 1);
$('#delivery').prop('disabled', !(list.length === 1 && list[0].status == '1'));
// $('#remove').prop('disabled', ! $('#materialRequisitionTable').bootstrapTable('getSelections').length);
// $('#view,#edit').prop('disabled', $('#materialRequisitionTable').bootstrapTable('getSelections').length!=1);
// $('#delivery').prop('disabled', !($('#materialRequisitionTable').bootstrapTable('getSelections').length==1 && $('#materialRequisitionTable').bootstrapTable('getSelections')[0].status == '1'));
}); });
$("#btnImport").click(function(){ $("#btnImport").click(function(){
...@@ -235,10 +245,27 @@ function getIdSelections() { ...@@ -235,10 +245,27 @@ function getIdSelections() {
} }
function deleteAll(){ function deleteAll(){
var list = $("#materialRequisitionTable").bootstrapTable('getSelections');
jp.confirm('确认要删除该物资领用记录吗?', function(){ var canDelList = list.filter(function (e) {
return e.status != '2';
})
var canNotDelList = list.filter(function (e) {
return e.status == '2';
})
var ids = canDelList.map(function (e) {
return e.id;
})
if (!ids.length) {
jp.alert('所选数据为已出库数据,不可删除');
return;
}
var text = '确认要删除该物资领用记录吗?';
if (canNotDelList.length) {
text = '所选数据有已出库数据,将删除未出库数据,确认要删除该物资领用记录吗?';
}
jp.confirm(text, function(){
jp.loading(); jp.loading();
jp.get("${ctx}/warehouse/materialrequisition/materialRequisition/deleteAll?ids=" + getIdSelections(), function(data){ jp.get("${ctx}/warehouse/materialrequisition/materialRequisition/deleteAll?ids=" + ids, function(data){
if(data.success){ if(data.success){
$('#materialRequisitionTable').bootstrapTable('refresh'); $('#materialRequisitionTable').bootstrapTable('refresh');
jp.success(data.msg); jp.success(data.msg);
......
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