Commit a79bdb41 by anxiaohe

bug修改

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