提交 19aee635 authored 作者: chengye's avatar chengye

抄表单详情添加电表倍率,以及计算用电量

上级 b5993cc3
......@@ -118,7 +118,7 @@
</label>
<div class="layui-input-inline">
<input type="text" id="current_numb" name="current_numb"
lay-verify="required" autocomplete="off" class="layui-input" oninput="sliceDom(this,15)" lay-verType="tips"
lay-verify="required" autocomplete="off" class="layui-input" disabled="disabled" lay-verType="tips"
value="">
</div>
<div class="layui-form-mid layui-word-aux">
......
......@@ -58,6 +58,17 @@
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
倍率
</label>
<div class="layui-input-inline">
<input type="text" id="rate" name="rate" autocomplete="off"
class="layui-input" value="{$em.rate}" disabled="disabled">
</div>
</div>
</div>
</div>
</div>
</div>
......@@ -126,6 +137,17 @@
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
用电量
</label>
<div class="layui-input-inline">
<input type="text" id="repo_numb" name="repo_numb" autocomplete="off" class="layui-input" value="" disabled="disabled">
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
......@@ -214,6 +236,18 @@
});
return false;
});
var rn = $('#repo_numb');
var lNv = Number($('#last_numb').val());
var cNv = Number($('#current_numb').val());
if(cNv > lNv){
var reN = (cNv - lNv)*Number($('#rate').val());
rn.val(reN)
} else {
rn.val('')
}
});
</script>
{/block}
\ No newline at end of file
......@@ -58,6 +58,17 @@
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
倍率
</label>
<div class="layui-input-inline">
<input type="text" id="rate" name="rate" autocomplete="off"
class="layui-input" value="{$em.rate}" disabled="disabled">
</div>
</div>
</div>
</div>
</div>
</div>
......@@ -106,7 +117,7 @@
</label>
<div class="layui-input-inline">
<input type="text" id="current_numb" name="current_numb"
lay-verify="required" autocomplete="off" class="layui-input" lay-verType="tips"
lay-verify="required" autocomplete="off" class="layui-input" lay-verType="tips"
value="{$useage.current_sum_numb}" disabled="disabled">
</div>
<div class="layui-form-mid layui-word-aux">
......@@ -126,6 +137,17 @@
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
用电量
</label>
<div class="layui-input-inline">
<input type="text" id="repo_numb" name="repo_numb" autocomplete="off" class="layui-input" value="" disabled="disabled">
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
......@@ -233,6 +255,16 @@
});
return false;
});
var rn = $('#repo_numb');
var lNv = Number($('#last_numb').val());
var cNv = Number($('#current_numb').val());
if(cNv > lNv){
var reN = (cNv - lNv)*Number($('#rate').val());
rn.val(reN)
} else {
rn.val('')
}
});
</script>
{/block}
\ No newline at end of file
......@@ -64,8 +64,8 @@
倍率
</label>
<div class="layui-input-inline">
<input type="text" name="project_number" autocomplete="off"
class="layui-input" value="{$em.rate|default=1}" disabled="disabled">
<input type="text" id="rate" name="project_number" autocomplete="off"
class="layui-input" value="{$em.rate}" disabled="disabled">
</div>
</div>
</div>
......@@ -119,7 +119,7 @@
</label>
<div class="layui-input-inline">
<input type="text" id="last_numb" name="last_numb"
autocomplete="off" class="layui-input" disabled="disabled" value="{$em.last_sum_numb}">
autocomplete="off" class="layui-input" disabled="disabled" value="{$em.last_sum_numb}" >
</div>
</div>
</div>
......@@ -136,17 +136,6 @@
</div>
</div>
<!-- <div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
<span class="x-red">*</span>缴费金额
</label>
<div class="layui-input-inline">
<input type="text" id="amount" name="amount"
autocomplete="off" class="layui-input" value="">
</div>
</div>
</div> -->
<div class="layui-col-md5">
<div class="layui-form-item">
......@@ -313,8 +302,26 @@
$sum.val($sum_numb);
})
});
var ln = $('#last_numb');
var cn = $('#current_numb');
ln.change(function(){
calRn()
})
cn.change(function(){
calRn()
})
function calRn(){
var rn = $('#repo_numb');
var lNv = Number($('#last_numb').val());
var cNv = Number($('#current_numb').val());
if(cNv > lNv){
var reN = (cNv - lNv)*Number($('#rate').val());
rn.val(reN)
} else {
rn.val('')
}
}
});
</script>
{/block}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论