Commit a79bdb41 by anxiaohe

bug修改

parent 713298ff
...@@ -751,6 +751,14 @@ function delRow(obj, prefix){ ...@@ -751,6 +751,14 @@ function delRow(obj, prefix){
getFrameWindow: function (URL) { getFrameWindow: function (URL) {
return this.getFrame(URL)[0].contentWindow return this.getFrame(URL)[0].contentWindow
}, },
escapeHtml: function (s) {
s = s ? s.toString() : '';
return s.replace(/&/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&quot;/g, '"')
.replace(/&#39;/g, "'");
}
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
if(data.length){ if(data.length){
data = data.map(function(item){ data = data.map(function(item){
item.delFlag = 0; item.delFlag = 0;
item.remarks = jp.escapeHtml(item.remarks);
return item; return item;
}) })
} }
......
...@@ -93,6 +93,10 @@ ...@@ -93,6 +93,10 @@
$('#time').datetimepicker({ $('#time').datetimepicker({
format: "YYYY-MM-DD HH:mm:ss" format: "YYYY-MM-DD HH:mm:ss"
}); });
if ("${mode}" !== 'add') {
$("#remarks").val(jp.escapeHtml($("#remarks").val()));
}
}); });
function save() { function save() {
var isValidate = jp.validateForm('#inputForm');//校验表单 var isValidate = jp.validateForm('#inputForm');//校验表单
......
...@@ -19,10 +19,12 @@ ...@@ -19,10 +19,12 @@
function initTable() { function initTable() {
var data = ${fns:toJson(materialLoss.materialLossInfoList)}; var data = ${fns:toJson(materialLoss.materialLossInfoList)};
console.log(data)
if(data.length){ if(data.length){
data = data.map(function(item){ data = data.map(function(item){
item.delFlag = 0; item.delFlag = 0;
item.ledgerInfo.shelvesNames = item.ledgerInfo.shelvesList.map(function (e) { return e.name }).join(',') + ',';
item.ledgerInfo.warehouseNames = item.ledgerInfo.warehouseList.map(function (e) { return e.name }).join(',') + ',';
item.remarks = jp.escapeHtml(item.remarks);
return item; return item;
}) })
} }
...@@ -115,7 +117,17 @@ ...@@ -115,7 +117,17 @@
} }
}, },
{ {
field: 'ledgerInfo.shelves.name', field: 'ledgerInfo.warehouseNames',
title: '仓库',
formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoWarehouseTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
row: row,
idx: index
})
}
},
{
field: 'ledgerInfo.shelvesNames',
title: '货架', title: '货架',
formatter: function (value, row, index) { formatter: function (value, row, index) {
return Mustache.render($("#ledgerInfoShelvesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), { return Mustache.render($("#ledgerInfoShelvesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, ""), {
...@@ -160,8 +172,8 @@ ...@@ -160,8 +172,8 @@
title: '选择物资台账明细', title: '选择物资台账明细',
isMultiSelect: true, isMultiSelect: true,
url: "${ctx}/warehouse/ledger/ledger/findByQrOrCode", url: "${ctx}/warehouse/ledger/ledger/findByQrOrCode",
fieldLabels: "物资编码|物资名称|品名代码|型号|批次号|单价", fieldLabels: "物资编码|品名|品名代码|型号|批次号|单价|数量|单位",
fieldKeys: "code|name|type.name|model|batchNum|amount", fieldKeys: "code|type.name|type.code|model|batchNum|amount|num|type.unit",
searchLabels: "物资编码", searchLabels: "物资编码",
searchKeys: "code", searchKeys: "code",
}, function (items) { }, function (items) {
...@@ -186,10 +198,12 @@ ...@@ -186,10 +198,12 @@
id: '', id: '',
delFlag: 0, delFlag: 0,
remarks: '', remarks: '',
ledgerInfo: item ledgerInfo: Object.assign({}, item, {
'shelvesNames': item.shelvesList.map(function (e) { return e.name }).join(',') + ',',
'warehouseNames': item.warehouseList.map(function (e) { return e.name }).join(',') + ',',
})
} }
}) })
console.log(data)
$(selector).bootstrapTable('append', data) $(selector).bootstrapTable('append', data)
} }
}) })
...@@ -278,11 +292,19 @@ ...@@ -278,11 +292,19 @@
name="materialLossInfoList[{{idx}}].ledgerInfo.amount" type="text" readonly class="form-control" name="materialLossInfoList[{{idx}}].ledgerInfo.amount" type="text" readonly class="form-control"
value="{{row.ledgerInfo.amount}}"/> value="{{row.ledgerInfo.amount}}"/>
</script> </script>
<script id="ledgerInfoWarehouseTpl" type="text/html">
<input id="materialLossInfoList{{idx}}_ledgerInfoWarehouse"
name="materialLossInfoList[{{idx}}].ledgerInfo.warehouseNames" type="text" readonly class="form-control"
value="{{row.ledgerInfo.warehouseNames}}"/>
<input type="hidden" name="materialLossInfoList[{{idx}}].ledgerInfo.warehouseIds" value="{{row.ledgerInfo.warehouseIds}}">
</script>
<script id="ledgerInfoShelvesTpl" type="text/html"> <script id="ledgerInfoShelvesTpl" type="text/html">
<input id="materialLossInfoList{{idx}}_ledgerInfoShelves" <input id="materialLossInfoList{{idx}}_ledgerInfoShelves"
name="materialLossInfoList[{{idx}}].ledgerInfo.shelves.name" type="text" readonly class="form-control" name="materialLossInfoList[{{idx}}].ledgerInfo.shelvesNames" type="text" readonly class="form-control"
value="{{row.ledgerInfo.shelves.name}}"/> value="{{row.ledgerInfo.shelvesNames}}"/>
<input type="hidden" name="materialLossInfoList[{{idx}}].ledgerInfo.shelvesIds" value="{{row.ledgerInfo.shelvesIds}}">
</script> </script>
<%----%>
<script id="ledgerInfoBatchNumTpl" type="text/html"> <script id="ledgerInfoBatchNumTpl" type="text/html">
<input id="materialLossInfoList{{idx}}_ledgerInfoBatchNum" <input id="materialLossInfoList{{idx}}_ledgerInfoBatchNum"
name="materialLossInfoList[{{idx}}].ledgerInfo.batchNum" type="text" readonly class="form-control" name="materialLossInfoList[{{idx}}].ledgerInfo.batchNum" type="text" readonly class="form-control"
......
...@@ -68,13 +68,16 @@ ...@@ -68,13 +68,16 @@
$('#time').datetimepicker({ $('#time').datetimepicker({
format: "YYYY-MM-DD HH:mm:ss" format: "YYYY-MM-DD HH:mm:ss"
}); });
if ("${mode}" !== 'add') {
$("#remarks").val(jp.escapeHtml($("#remarks").val()));
}
}); });
function save() { function save() {
var isValidate = jp.validateForm('#inputForm');//校验表单 var isValidate = jp.validateForm('#inputForm');//校验表单
if(!isValidate){ if(!isValidate){
return false; return false;
}else{ }else{
var hasDetails = getTableData().length == 0; var hasDetails = getTableData().filter(function (e) { return e.delFlag != 1 }).length == 0;
if(hasDetails){ if(hasDetails){
jp.warning('请填写明细!'); jp.warning('请填写明细!');
return; return;
......
...@@ -273,6 +273,8 @@ $(document).ready(function() { ...@@ -273,6 +273,8 @@ $(document).ready(function() {
} }
function addRow(list, idx, tpl, row){ function addRow(list, idx, tpl, row){
row.ledgerInfo.shelvesNames = row.ledgerInfo.shelvesList.map(function (e) { return e.name }).join(',') + ',';
row.ledgerInfo.warehouseNames = row.ledgerInfo.warehouseList.map(function (e) { return e.name }).join(',') + ',';
$(list).append(Mustache.render(tpl, { $(list).append(Mustache.render(tpl, {
idx: idx, delBtn: true, row: row idx: idx, delBtn: true, row: row
})); }));
...@@ -333,10 +335,10 @@ $(document).ready(function() { ...@@ -333,10 +335,10 @@ $(document).ready(function() {
{{row.ledgerInfo.batchNum}} {{row.ledgerInfo.batchNum}}
</td> </td>
<td> <td>
{{row.ledgerInfo.shelves.name}} {{row.ledgerInfo.shelvesNames}}
</td> </td>
<td> <td>
{{row.ledgerInfo.shelves.warehouse.name}} {{row.ledgerInfo.warehouseNames}}
</td> </td>
<td> <td>
{{row.remarks}} {{row.remarks}}
......
...@@ -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.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;
}) })
...@@ -428,6 +429,7 @@ ...@@ -428,6 +429,7 @@
btn: ['确定', '关闭'], btn: ['确定', '关闭'],
success: function () { success: function () {
// $("#scanResult").focus(); // $("#scanResult").focus();
debugger
scanStart(); scanStart();
renderScanTable(); renderScanTable();
}, },
...@@ -443,10 +445,14 @@ ...@@ -443,10 +445,14 @@
jp.alert('选择的数据必须填写选择数量'); jp.alert('选择的数据必须填写选择数量');
return false; return false;
} }
scanStop();
selectDetailHandle($(selector), selectTableData); selectDetailHandle($(selector), selectTableData);
layer.close(index); layer.close(index);
}, },
cancel () { btn2: function () {
scanStop();
},
cancel: function () {
scanStop(); scanStop();
} }
}) })
......
...@@ -112,7 +112,9 @@ ...@@ -112,7 +112,9 @@
$("#inputForm").find("button:submit").button("reset"); $("#inputForm").find("button:submit").button("reset");
} }
}); });
if ("${mode}" !== 'add') {
$("#remarks").val(jp.escapeHtml($("#remarks").val()));
}
$('#time').datetimepicker({ $('#time').datetimepicker({
format: "YYYY-MM-DD HH:mm:ss" format: "YYYY-MM-DD HH:mm:ss"
}); });
...@@ -123,7 +125,7 @@ ...@@ -123,7 +125,7 @@
if(!isValidate){ if(!isValidate){
return false; return false;
}else{ }else{
var hasDetails = getTableData().length == 0; var hasDetails = getTableData().filter(function (e) { return e.delFlag != 1 }).length == 0;
if(hasDetails){ if(hasDetails){
jp.warning('请填写领用物资!'); jp.warning('请填写领用物资!');
return; return;
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
if(data.length){ if(data.length){
data = data.map(function(item){ data = data.map(function(item){
item.delFlag = 0; item.delFlag = 0;
item.remarks = jp.escapeHtml(item.remarks);
return item; return item;
}) })
} }
......
...@@ -76,6 +76,9 @@ ...@@ -76,6 +76,9 @@
$('#outboundTime').datetimepicker({ $('#outboundTime').datetimepicker({
format: "YYYY-MM-DD HH:mm:ss" format: "YYYY-MM-DD HH:mm:ss"
}); });
if ("${mode}" !== 'add') {
$("#remarks").val(jp.escapeHtml($("#remarks").val()));
}
}); });
function save() { function save() {
var isValidate = jp.validateForm('#inputForm');//校验表单 var isValidate = jp.validateForm('#inputForm');//校验表单
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
function initTable(){ function initTable(){
var data = ${fns:toJson(profitWarehousing.profitWarehousingInfoList)}; var data = ${fns:toJson(profitWarehousing.profitWarehousingInfoList)};
if(data.length){ if(data.length){
debugger
data = data.map(function(item){ data = data.map(function(item){
item.delFlag = 0; item.delFlag = 0;
item.remarks = jp.escapeHtml(item.remarks);
item.readonly = item.qrCode && item.qrCode.state === '2' item.readonly = item.qrCode && item.qrCode.state === '2'
return item; return item;
}) })
......
...@@ -79,13 +79,16 @@ ...@@ -79,13 +79,16 @@
$('#time').datetimepicker({ $('#time').datetimepicker({
format: "YYYY-MM-DD HH:mm:ss" format: "YYYY-MM-DD HH:mm:ss"
}); });
if ("${mode}" !== 'add') {
$("#remarks").val(jp.escapeHtml($("#remarks").val()));
}
}); });
function save() { function save() {
var isValidate = jp.validateForm('#inputForm');//校验表单 var isValidate = jp.validateForm('#inputForm');//校验表单
if(!isValidate){ if(!isValidate){
return false; return false;
}else{ }else{
var hasDetails = getTableData().length == 0; var hasDetails = getTableData().filter(function (e) { return e.delFlag != 1 }).length == 0;
if(hasDetails){ if(hasDetails){
jp.warning('请填写明细!'); jp.warning('请填写明细!');
return; return;
......
...@@ -73,5 +73,12 @@ ...@@ -73,5 +73,12 @@
</div> </div>
</div> </div>
</div> </div>
<script>
$(document).ready(function () {
if ("${mode}" !== 'add') {
$("#remarks").val(jp.escapeHtml($("#remarks").val()));
}
})
</script>
</body> </body>
</html> </html>
...@@ -46,6 +46,12 @@ ...@@ -46,6 +46,12 @@
</div> </div>
</div> </div>
<script> <script>
$(document).ready(function () {
if ("${mode}" !== 'add') {
$("#remarks").val(jp.escapeHtml($("#remarks").val()));
}
})
function save() { function save() {
var isValidate = jp.validateForm('#inputForm');//校验表单 var isValidate = jp.validateForm('#inputForm');//校验表单
if(!isValidate){ if(!isValidate){
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
if(data.length){ if(data.length){
data = data.map(function(item){ data = data.map(function(item){
item.delFlag = 0; item.delFlag = 0;
item.remarks = jp.escapeHtml(item.remarks);
item.readonly = item.qrCode && item.qrCode.state === '2'; item.readonly = item.qrCode && item.qrCode.state === '2';
item.infoSum = new Big(item.num).times(item.amount).toNumber(); item.infoSum = new Big(item.num).times(item.amount).toNumber();
item.shelvesNames = item.shelvesList.map(function (e) { item.shelvesNames = item.shelvesList.map(function (e) {
......
...@@ -129,7 +129,9 @@ ...@@ -129,7 +129,9 @@
$("#inputForm").find("button:submit").button("reset"); $("#inputForm").find("button:submit").button("reset");
} }
}); });
if ("${mode}" !== 'add') {
$("#remarks").val(jp.escapeHtml($("#remarks").val()));
}
$('#time').datetimepicker({ $('#time').datetimepicker({
format: "YYYY-MM-DD HH:mm:ss" format: "YYYY-MM-DD HH:mm:ss"
}); });
...@@ -140,7 +142,7 @@ ...@@ -140,7 +142,7 @@
if(!isValidate){ if(!isValidate){
return false; return false;
}else{ }else{
var hasDetails = getTableData().length == 0; var hasDetails = getTableData().filter(function (e) { return e.delFlag != 1 }).length == 0;
if(hasDetails){ if(hasDetails){
jp.warning('请填写明细!'); jp.warning('请填写明细!');
return; return;
......
...@@ -51,7 +51,9 @@ ...@@ -51,7 +51,9 @@
$("#inputForm").find("button:submit").button("reset"); $("#inputForm").find("button:submit").button("reset");
} }
}); });
if ("${mode}" !== 'add') {
$("#remarks").val(jp.escapeHtml($("#remarks").val()));
}
$('#time').datetimepicker({ $('#time').datetimepicker({
format: "YYYY-MM-DD HH:mm:ss" format: "YYYY-MM-DD HH:mm:ss"
}); });
......
...@@ -67,5 +67,12 @@ ...@@ -67,5 +67,12 @@
</div> </div>
</div> </div>
</div> </div>
<script>
$(document).ready(function () {
if ("${mode}" !== 'add') {
$("#remarks").val(jp.escapeHtml($("#remarks").val()));
}
})
</script>
</body> </body>
</html> </html>
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