xuhy
2025-01-09 712f70b2936079a131ecb1e63c6d337171618cad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
@layout("/common/_container.html"){
<style>
    .newWidth, .single-line{
        max-width:150px !important;display: initial !important;
    }
    .lab{
        display: block;
        width: 150px;
        height: 45px;
        text-align: center;
        line-height: 45px;
        cursor: pointer;
        font-size: 16px;
        background-color: #F8F8F8;
        margin: 0;
    }
    .lab:hover{
        background-color: #F3F4F5;
    }
    .checked{
        background-color: #FFF !important;
        border-left: 10px solid #077CCB;
    }
    .shareSeatPriceSetting>div>label{
        text-align: center;
        height: 35px;
        line-height: 35px;
        width: 200px;
        border: 1px solid #E4E4E4;
    }
    .shareSeatPriceSetting .people, .shareSeatPriceSetting .carpool{
        text-align: center;
        border: 1px solid #377CCD;
        color: #377CCD;
    }
</style>
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="form-horizontal" id="specialPriceInfoForm">
 
            <div class="row">
                <div class="col-sm-11">
 
 
                    <div class="form-group waitFee">
                        <label class="col-sm-2 control-label">计费方式:</label>
 
                        <div class="col-sm-10">
                            起步价为&nbsp;
                            <input type="text" onblur="checkIsYuan(this)" value='${json.num1!}' name="num1" id="num1" class="form-control newWidth" placeholder="最多3位数"/>
                            元,起步包含<input type="text" onblur="checkIsGongLi(this)" name="num2" id="num2" value='${json.num2!}' class="form-control newWidth" placeholder="最多3位数"/>
                            公里,不足基价公里按基价公里收费</br></br>
                            超过起步里程后每公里加收  <input type="text" onblur="checkIsYuan(this)" name="num3" id="num3" value='${json.num3!}' class="form-control newWidth" placeholder="最多3位数"/>元
<!--                            <span id="min">,<input type="text" onblur="checkIsMinute(this)" name="num5" id="num5" class="form-control newWidth" placeholder="最多3位数"/>-->
<!--                            分钟</span>-->
                        </div>
                    </div>
                    <div class="form-group waitFee">
                        <label class="col-sm-2 control-label">空驶费设置:</label>
                        <div class="col-sm-10">
                            单程载客行驶
                            <input type="text" onblur="checkIsGongLi(this)" name="num4" id="num4"  value='${json.num4!}' class="form-control newWidth" placeholder="最多3位数" oninput="change(this)"/>
                            (不含<input type="text" id="buhan" value="${json.num4!}" disabled style="border: none;width:45px;text-align:center">公里)超出部分收取空驶费,每公里加收<input type="text" onblur="checkIsYuan(this)" name="num5" id="num5"  value='${json.num5!}' class="form-control newWidth" placeholder="最多3位数"/>元
                        </div>
                    </div>
                    <div class="form-group waitFee">
                        <label class="col-sm-2 control-label">夜间行驶费用设置:</label>
                        <div class="col-sm-10">
                            <input type="text" name="num6" id="num6" class="form-control newWidth"  value='${json.num6!}' placeholder="选择时间"/>&nbsp;点为夜间行驶时间,
                            起步价变为<input type="text" onblur="checkIsYuan(this)"  value='${json.num7!}' name="num7" id="num7" class="form-control newWidth" placeholder="最多3位数"/>元,
                            起步包含<input type="text" onblur="checkIsGongLi(this)" name="num8"   value='${json.num8!}' id="num8" class="form-control newWidth" placeholder="最多3位数"/>
                            公里,不足基价公里按基价公里收费
                            ,超过起步里程后每公里加收<input type="text" onblur="checkIsYuan(this)" name="num9"  value='${json.num9!}' id="num9" class="form-control newWidth" placeholder="最多3位数"/>元
 
                        </div>
                    </div>
<!--                    <div class="form-group waitFee">-->
<!--                        <div class="col-sm-10">-->
<!--                            司机到达预约地点-->
<!--&lt;!&ndash;                            <input type="text" onblur="checkIsMinute(this)" name="num8" id="num8" class="form-control newWidth" placeholder="最多3位数"/>&ndash;&gt;-->
<!--                            分钟后开始收取等待费,为-->
<!--&lt;!&ndash;                            <input type="text" onblur="checkIsMinute(this)" name="num9" id="num9" class="form-control newWidth" placeholder="最多3位数"/>&ndash;&gt;-->
<!--                            元/分,不足一分钟按一分钟计算-->
<!--                        </div>-->
<!--                    </div>-->
 
                </div>
            </div>
 
            <div class="row btn-group-m-t">
                <div class="col-sm-10 col-sm-offset-5">
                    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="addTaxiSubmit()"/>
<!--                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TSystemPriceInfoDlg.close()"/>-->
                </div>
            </div>
        </div>
 
    </div>
</div>
<script src="${ctxPath}/static/modular/system/tSystemPrice/tSystemPrice_info.js"></script>
<script type="text/javascript">
 
    function change(obj) {
 
        $("#buhan").val($("#num4").val())
    }
 
    function addTaxiSubmit() {
 
        var b = false;
        var waitFee = '{';
        // waitFee = waitFee + '"num1":"'+$("#num1").val()+'",';
        $('.waitFee input[type="text"]').each(function(){
            var value = $(this).val();
            if('' == value){
                b = true;
                Feng.info("请填写完整配置");
                return
            }
            waitFee = waitFee + '"'+$(this)[0].name+'":"'+value+'",';
        });
        waitFee = waitFee.substring(0,waitFee.length-1);
        waitFee += '}';
        console.log(waitFee);
 
 
 
        //提交信息
        var ajax = new $ax(Feng.ctxPath + "/tSystemPrice/taxiSet", function(data){
            if (500 == data.code){
                Feng.error(data.message);
                return;
            }else{
                Feng.success("添加成功!");
                window.parent.TSystemPrice.table.refresh();
                TSystemPriceInfoDlg.close();
            }
        },function(data){
            Feng.error("添加失败!" + data.responseJSON.message + "!");
        });
        ajax.setData({
            content: waitFee
        })
        ajax.start();
    }
 
    laydate.render({
        elem: '.col-sm-10 #num6'
        ,type: 'time'
        ,range: '-'
        ,format: 'HH:mm'
    });
    function checkbox1() {
        var checkbox1 = $('#num1').val();
        if (checkbox1 == 1){
            $("#times").hide()
            $("#thanMin").show()
            $("#min").show()
        } else {
            $("#times").show()
            $("#thanMin").hide()
            $("#min").hide()
        }
    }
    var regDouble = /^(0|[1-9]\d{0,2})(\.\d{1,2})?$/;
    var regInt = /^[0-9]{0,3}$/;
    function checkIsYuan(obj){
        var num = $(obj).val();
        if(!regDouble.test(num)){
            layer.msg("【元】输入框不能超过3位数,保留两位小数");
            $(obj).val('');
        }
    }
    function checkIsGongLi(obj, clazz){
        var num = $(obj).val();
        if(!regDouble.test(num)){
            layer.msg("【公里】输入框不能超过3位数,保留两位小数");
            $(obj).val('');
        }
        if (obj.id == "num7"){
            $("." + clazz + " #num9").val(num);
        }else if (obj.id == "num10"){
            $("." + clazz + " #num12").val(num);
        }
    }
    function checkIsMinute(obj){
        var num = $(obj).val();
        if(!regInt.test(num)){
            layer.msg("【分钟】输入框不能超过3位数");
            $(obj).val('');
        }
    }
 
</script>
@}