Commit f1c0fb50 by 胡懿

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

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