app/views/educode_sales/assessments/new.html.erb in educode_sales-0.8.4 vs app/views/educode_sales/assessments/new.html.erb in educode_sales-0.8.5
- old
+ new
@@ -30,137 +30,155 @@
<div class="layui-input-inline">
<input type="text" class="layui-input" id="add_assessments_year" name="assessment_year" autocomplete="off" lay-verify="required">
</div>
</div>
<div class="layui-inline">
- <label class="layui-form-label">业务目标</label>
+<!-- <div class="label1 layui-input-inline" >(万)</div>-->
+<!-- <div class="label2 layui-input-inline layui-hide">(个)</div>-->
+ <label class="label1 layui-form-label">业务目标(万)</label>
+ <label class="label2 layui-form-label layui-hide ">业务目标(次)</label>
+ <label class="label3 layui-form-label layui-hide ">业务目标(个)</label>
<div class="layui-input-inline">
- <input type="text" class="layui-input" disabled value="" name="annual" autocomplete="off" placeholder="自动计算" id="annual">
+ <input type="text" class="layui-input layui-disabled" style="color: #0C0C0C;border:1px solid #a6aebf;" value="" name="annual" autocomplete="off" placeholder="自动计算" id="annual">
</div>
- <div class="label1 layui-input-inline">万</div>
- <div class="label2 layui-input-inline layui-hide">个</div>
</div>
</div>
<div class="layui-form-item" style="padding: 25px">
<!-- 根据考核要求更换单位-->
<div class="layui-row " >
<div class="layui-col-md3">
<div class="layui-input-inline">
<label class="label1 layui-form-label ">第一季度(万)</label>
- <label class="label2 layui-form-label layui-hide">第一季度(个)</label>
+ <label class="label2 layui-form-label layui-hide">第一季度(次)</label>
+ <label class="label3 layui-form-label layui-hide">第一季度(个)</label>
<div class="layui-input-block " style="width: 200px;">
- <input type="text" name="first_quarter" value="" autocomplete="off" class="layui-input" placeholder="自动计算" disabled id="quarter1" >
+ <input type="text" name="first_quarter" style="color: #0C0C0C;border:1px solid #a6aebf;" value="" autocomplete="off" class="layui-input layui-disabled" placeholder="自动计算" disabled id="quarter1" >
</div>
</div>
<div class="layui-input-inline ">
<label class="label1 layui-form-label ">1月(万)</label>
- <label class="label2 layui-form-label layui-hide">1月(个)</label>
+ <label class="label2 layui-form-label layui-hide">1月(次)</label>
+ <label class="label3 layui-form-label layui-hide">1月(个)</label>
<div class="layui-input-block" style="width: 200px;">
<input type="text" name="january" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month1" onkeyup="sum()">
</div>
</div>
<div class="layui-input-inline">
<label class="label1 layui-form-label ">2月(万)</label>
- <label class="label2 layui-form-label layui-hide">2月(个)</label>
+ <label class="label2 layui-form-label layui-hide">2月(次)</label>
+ <label class="label3 layui-form-label layui-hide">2月(个)</label>
<div class="layui-input-block" style="width: 200px;">
<input type="text" name="february" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month2" onkeyup="sum()" >
</div>
</div>
<div class="layui-input-inline">
<label class="label1 layui-form-label ">3月(万)</label>
- <label class="label2 layui-form-label layui-hide">3月(个)</label>
+ <label class="label2 layui-form-label layui-hide">3月(次)</label>
+ <label class="label3 layui-form-label layui-hide">3月(个)</label>
<div class="layui-input-block" style="width: 200px;">
<input type="text" name="march" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month3" onkeyup="sum()">
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-input-inline">
<label class="label1 layui-form-label ">第二季度(万)</label>
- <label class="label2 layui-form-label layui-hide">第二季度(个)</label>
+ <label class="label2 layui-form-label layui-hide">第二季度(次)</label>
+ <label class="label3 layui-form-label layui-hide">第二季度(个)</label>
<div class="layui-input-block" style="width: 200px;">
- <input type="text" name="second_quarter" value="" autocomplete="off" class="layui-input" placeholder="自动计算" disabled id="quarter2" onkeyup="sum()" >
+ <input type="text" name="second_quarter" style="color: #0C0C0C;border:1px solid #a6aebf;" value="" autocomplete="off" class="layui-input layui-disabled" placeholder="自动计算" disabled id="quarter2" onkeyup="sum()" >
</div>
</div>
<div class="layui-input-inline">
<label class="label1 layui-form-label ">4月(万)</label>
- <label class="label2 layui-form-label layui-hide">4月(个)</label>
+ <label class="label2 layui-form-label layui-hide">4月(次)</label>
+ <label class="label3 layui-form-label layui-hide">4月(个)</label>
<div class="layui-input-block" style="width: 200px;">
<input type="text" name="april" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month4" onkeyup="sum()">
</div>
</div>
<div class="layui-input-inline">
<label class="label1 layui-form-label ">5月(万)</label>
- <label class="label2 layui-form-label layui-hide">5月(个)</label>
+ <label class="label2 layui-form-label layui-hide">5月(次)</label>
+ <label class="label3 layui-form-label layui-hide">5月(个)</label>
<div class="layui-input-block" style="width: 200px;">
- <input type="text" name="may" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month5" onkeyup="sum()">
+ <input type="text" name="may" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month5" onkeyup="sum()">
</div>
</div>
<div class="layui-input-inline">
<label class="label1 layui-form-label ">6月(万)</label>
- <label class="label2 layui-form-label layui-hide">6月(个)</label>
+ <label class="label2 layui-form-label layui-hide">6月(次)</label>
+ <label class="label3 layui-form-label layui-hide">6月(个)</label>
<div class="layui-input-block" style="width: 200px;">
<input type="text" name="june" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month6" onkeyup="sum()">
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-input-inline">
<label class="label1 layui-form-label ">第三季度(万)</label>
- <label class="label2 layui-form-label layui-hide">第三季度(个)</label>
+ <label class="label2 layui-form-label layui-hide">第三季度(次)</label>
+ <label class="label3 layui-form-label layui-hide">第三季度(个)</label>
<div class="layui-input-block" style="width: 200px;">
- <input type="text" name="third_quarter" value="" autocomplete="off" class="layui-input" placeholder="自动计算" disabled id="quarter3" onkeyup="sum()">
+ <input type="text" name="third_quarter" style="color: #0C0C0C;border:1px solid #a6aebf;" value="" autocomplete="off" class="layui-input layui-disabled" placeholder="自动计算" disabled id="quarter3" onkeyup="sum()">
</div>
</div>
<div class="layui-input-inline">
<label class="label1 layui-form-label ">7月(万)</label>
- <label class="label2 layui-form-label layui-hide">7月(个)</label>
+ <label class="label2 layui-form-label layui-hide">7月(次)</label>
+ <label class="label3 layui-form-label layui-hide">7月(个)</label>
<div class="layui-input-block" style="width: 200px;">
<input type="text" name="july" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month7" onkeyup="sum()">
</div>
</div>
<div class="layui-input-inline">
<label class="label1 layui-form-label ">8月(万)</label>
- <label class="label2 layui-form-label layui-hide">8月(个)</label>
+ <label class="label2 layui-form-label layui-hide">8月(次)</label>
+ <label class="label3 layui-form-label layui-hide">8月(个)</label>
<div class="layui-input-block" style="width: 200px;">
<input type="text" name="august" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month8" onkeyup="sum()">
</div>
</div>
<div class="layui-input-inline">
<label class="label1 layui-form-label ">9月(万)</label>
- <label class="label2 layui-form-label layui-hide">9月(个)</label>
+ <label class="label2 layui-form-label layui-hide">9月(次)</label>
+ <label class="label3 layui-form-label layui-hide">9月(个)</label>
<div class="layui-input-block" style="width: 200px;">
<input type="text" name="september" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month9" onkeyup="sum()">
</div>
</div>
</div>
<div class="layui-col-md3">
<div class="layui-input-inline">
<label class="label1 layui-form-label ">第四季度(万)</label>
- <label class="label2 layui-form-label layui-hide">第四季度(个)</label>
+ <label class="label2 layui-form-label layui-hide">第四季度(次)</label>
+ <label class="label3 layui-form-label layui-hide">第四季度(个)</label>
<div class="layui-input-block" style="width: 200px;">
- <input type="text" name="fourth_quarter" value="" autocomplete="off" class="layui-input" placeholder="自动计算" disabled id="quarter4" onkeyup="sum()">
+ <input type="text" name="fourth_quarter" style="color: #0C0C0C;border:1px solid #a6aebf;" value="" autocomplete="off" class="layui-input layui-disabled" placeholder="自动计算" disabled id="quarter4" onkeyup="sum()">
</div>
</div>
<div class="layui-input-inline">
<label class="label1 layui-form-label ">10月(万)</label>
- <label class="label2 layui-form-label layui-hide">10月(个)</label>
+ <label class="label2 layui-form-label layui-hide">10月(次)</label>
+ <label class="label3 layui-form-label layui-hide">10月(个)</label>
<div class="layui-input-block" style="width: 200px;">
<input type="text" name="october" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month10" onkeyup="sum()">
</div>
</div>
<div class="layui-input-inline">
<label class="label1 layui-form-label ">11月(万)</label>
- <label class="label2 layui-form-label layui-hide">11月(个)</label>
+ <label class="label2 layui-form-label layui-hide">11月(次)</label>
+ <label class="label3 layui-form-label layui-hide">11月(个)</label>
<div class="layui-input-block" style="width: 200px;">
<input type="text" name="november" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month11" onkeyup="sum()" >
</div>
</div>
<div class="layui-input-inline">
<label class="label1 layui-form-label ">12月(万)</label>
- <label class="label2 layui-form-label layui-hide">12月(个)</label>
+ <label class="label2 layui-form-label layui-hide">12月(次)</label>
+ <label class="label3 layui-form-label layui-hide">12月(个)</label>
<div class="layui-input-block" style="width: 200px;">
<input type="text" name="december" value="" autocomplete="off" class="layui-input" lay-verify="number|data" id="month12" onkeyup="sum()">
</div>
</div>
</div>
@@ -208,105 +226,81 @@
$ = layui.$;
// 自定义校验数据
- form.verify({
- data: function (value,item){
- if (parseFloat(value) < 0 ){
- console.log(value);
- return "数据不能小于零"
- }
- }
- })
+ // form.verify({
+ // data: function (value,item){
+ // if (parseFloat(value) < 0 ){
+ // console.log(value);
+ // return "数据不能小于零"
+ // }else if (parseFloat(value) > 100000000) {
+ // console.log(value);
+ // return "数据不能大于一亿"
+ // }
+ // }
+ // })
- // time
- laydate.render({
- elem: '#add_assessments_year',
- type: 'year',
- value: <%=Time.now.year %>
- });
+ //laydate.render({
+ // elem: '#add_assessments_year',
+ // type: 'year',
+ // value: <%=Time.now.year %>
+ //});
- form.on('submit(add_task_assessment)', function (data) {
- console.log(data)
- console.log(data.field)
- // console.log($("#demo1").val())
- var staffs_selectArr = staffs.getValue();
- if ( staffs_selectArr.length === 0 ) {
- alert("请选择员工!!!");
- } else {
- request.authPost("missions/assessments", data.field, function (res) {
- if (res.success == false) {
- layer.alert(res.msg)
- } else {
- layer.closeAll();
- layer.alert("添加成功");
- table.reload("assessments");
- table.reload("progressTable");
- }
- });
- return false;
- }
- });
+ // form.on('submit(add_task_assessment)', function (data) {
+ // console.log(data.field)
+ // var staffs_selectArr = staffs.getValue();
+ // if ( data.field.assessment === '0' || staffs_selectArr.length === 0 ) {
+ // if (data.field.assessment === '0'){
+ // alert("请选择考核指标!!!");
+ // }else {
+ // alert("请选择员工!!!");
+ // }
+ // return false;
+ // } else {
+ // request.authPost("missions/assessments", data.field, function (res) {
+ // if (res.success == false) {
+ // layer.alert(res.msg)
+ // } else {
+ // layer.closeAll();
+ // layer.alert("添加成功");
+ // table.reload("assessments");
+ // // 重新加载后 progressTable错位
+ // // table.reload("progressTable");
+ // }
+ // });
+ // }
+ // });
+
// 根据考核要求更换单位
- form.on('select(new_assessment_id)', function (data){
- console.log(data.value)
- // 默认 签单金额 回款金额
- if (data.value in ["2 ","1","0"]) {
- // 默认 签单金额 回款金额
- $(".label1").removeClass('layui-hide')
- $(".label2").addClass('layui-hide')
- } else {
- // 新增商机 拜访量
- $(".label1").addClass('layui-hide')
- $(".label2").removeClass('layui-hide')
- }
- })
+ // form.on('select(new_assessment_id)', function (data){
+ // console.log(data.value)
+ // // 默认 签单金额 回款金额
+ // if (data.value in ["2 ","1","0"]) {
+ // // 默认 签单金额 回款金额
+ // $(".label1").removeClass('layui-hide')
+ // $(".label2").addClass('layui-hide')
+ // } else {
+ // // 新增商机 拜访量
+ // $(".label1").addClass('layui-hide')
+ // $(".label2").removeClass('layui-hide')
+ // }
+ // })
});
</script>
-
-
<!--要写在这下面-->
<script type="application/javascript">
- function sum2(){undefined
- var month1 = $("#month1").val();
- console.log(month1+"==========================");
- var month2 = $("#month2").val();
- var month3 = $("#month3").val();
- var month4 = $("#month4").val();
- var month5 = $("#month5").val();
- var month6 = $("#month6").val();
- var month7 = $("#month7").val();
- var month8 = $("#month8").val();
- var month9 = $("#month9").val();
- var month10 = $("#month10").val();
- var month11= $("#month11").val();
- var month12 = $("#month12").val();
- var quarter1 = parseInt(month1)+parseInt(month2)+parseInt(month3);
- console.log(quarter1);
- var quarter2 = parseInt(month4)+parseInt(month6)+parseInt(month5);
- var quarter3 = parseInt(month7)+parseInt(month8)+parseInt(month9);
- var quarter4 = parseInt(month10)+parseInt(month11)+parseInt(month12);
- $("#quarter1").val(quarter1);
- $("#quarter2").val(quarter2);
- $("#quarter3").val(quarter3);
- $("#quarter4").val(quarter4);
- var annual = parseInt(quarter1)+parseInt(quarter2)+parseInt(quarter3)+parseInt(quarter4);
- $("#annual").val(annual);
- }
-
-
function sum(){
var month1 = document.getElementById('month1').value;
var month2 = document.getElementById('month2').value;
var month3 = document.getElementById('month3').value;
var month4 = document.getElementById('month4').value;
@@ -328,15 +322,20 @@
if ( month8 === ""){ month8 = 0 ;}
if ( month9 === ""){ month9 = 0 ;}
if ( month10 === ""){ month10 = 0 ;}
if ( month11 === ""){ month11 = 0 ;}
if ( month12 === ""){ month12 = 0 ;}
- document.getElementById('quarter1').value = parseInt(month1)+parseInt(month2)+parseInt(month3)
- document.getElementById('quarter2').value = parseInt(month4)+parseInt(month5)+parseInt(month6)
- document.getElementById('quarter3').value = parseInt(month7)+parseInt(month8)+parseInt(month9)
- document.getElementById('quarter4').value = parseInt(month10)+parseInt(month11)+parseInt(month12)
- document.getElementById('annual').value = parseInt(month1)+parseInt(month2)+parseInt(month3)+parseInt(month4)+
- parseInt(month5)+parseInt(month6)+parseInt(month7)+parseInt(month8)+parseInt(month9)+parseInt(month10)+parseInt(month11)+parseInt(month12)
+ var quarter1 = parseFloat(month1)+parseFloat(month2)+parseFloat(month3)
+ var quarter2 = parseFloat(month4)+parseFloat(month5)+parseFloat(month6)
+ var quarter3 = parseFloat(month7)+parseFloat(month8)+parseFloat(month9)
+ var quarter4 = parseFloat(month10)+parseFloat(month11)+parseFloat(month12)
+ var annual = parseFloat(month1)+parseFloat(month2)+parseFloat(month3)+parseFloat(month4)+
+ parseFloat(month5)+parseFloat(month6)+parseFloat(month7)+parseFloat(month8)+parseFloat(month9)+parseFloat(month10)+parseFloat(month11)+parseFloat(month12)
+ document.getElementById('quarter1').value = quarter1.toFixed(2)
+ document.getElementById('quarter2').value = quarter2.toFixed(2)
+ document.getElementById('quarter3').value = quarter3.toFixed(2)
+ document.getElementById('quarter4').value = quarter4.toFixed(2)
+ document.getElementById('annual').value = annual.toFixed(2)
}
\ No newline at end of file