@layout("/common/_container.html"){
|
<style>
|
.newWidth, .single-line{
|
max-width:150px !important;display: initial !important;
|
}
|
.b1{
|
width: 200px;height: 100px;border-color: #0e9aef;background-color:transparent;
|
}
|
.button ,button-primary, button-small {
|
border: 1px solid #0e9aef;
|
width: 200px;height: 100px;
|
text-align: center;
|
line-height: 100px;
|
}
|
.box{
|
display: flex;
|
margin-left: 24px;
|
margin-bottom: 10px;
|
|
|
;
|
}
|
|
</style>
|
<div class="ibox float-e-margins">
|
<div class="ibox-content">
|
|
<div class="form-horizontal" >
|
<div class="row">
|
<div class="col-sm-11">
|
<input type="hidden" id="kcId" name="kcId"
|
@if(isNotEmpty(kcId)){
|
value="${kcId}"
|
@}else{
|
value=""
|
@}
|
>
|
|
<div class="">
|
@if(language==1){
|
<h3>同城快送价格设置:</h3>
|
@}
|
@if(language==2){
|
<h3>City express send price setting:</h3>
|
@}
|
@if(language==3){
|
<h3>Pengaturan harga pengiriman ekspres intra kota:</h3>
|
@}
|
|
|
</div>
|
<br/>
|
<br/>
|
<input type="hidden" id="tcId" name="tcId"
|
@if(isNotEmpty(tcId)){
|
value="${tcId}"
|
@}else{
|
value=""
|
@}
|
>
|
<!-- <div id="but">-->
|
<!-- <button class="('show?b1')" name="SupendButton-one" onclick="changeColor(this)">司机</button> -->
|
<!-- <button class="(show1?'b1')" name="SupendButton-two" onclick="changeColor1(this)">用户</button>-->
|
<!-- </div>-->
|
|
<div class="box">
|
|
<div id="SupendButton-one" type="button" class="button button-primary button-small " onclick=changeColor(this);>
|
@if(language==1){
|
<p>司机</p>
|
@}
|
@if(language==2){
|
<p>driver</p>
|
@}
|
@if(language==3){
|
<p>Pengemudi</p>
|
@}
|
</div>
|
<div id="SupendButton-two" type="button" class="button button-primary button-small " onclick=changeColor1(this);>
|
@if(language==1){
|
<p>用户</p>
|
@}
|
@if(language==2){
|
<p>user</p>
|
@}
|
@if(language==3){
|
<p>pengguna</p>
|
@}
|
</div>
|
</div>
|
|
|
<div class="col-sm-6" style="display: flex;width: 50%;" >
|
|
<div class="input-group">
|
<div class="input-group-btn">
|
<button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
|
@if(language==1){
|
选择城市:
|
@}
|
@if(language==2){
|
Select city:
|
@}
|
@if(language==3){
|
Pilih Kota:
|
@}
|
|
</button>
|
</div>
|
<select class="form-control" id="openCityId" style="width: 300px" onclick="provinceChange(this)">
|
@if(language==1){
|
<option value="">请选择城市</option>
|
@for(obj in openCity){
|
<option value="${obj.id}">${obj.chineseName}</option>
|
@}
|
@}
|
@if(language==2){
|
<option value="">Select city</option>
|
@for(obj in openCity){
|
<option value="${obj.id}">${obj.englishName}</option>
|
@}
|
@}
|
@if(language==3){
|
<option value="">Pilih Kota</option>
|
@for(obj in openCity){
|
<option value="${obj.id}">${obj.indonesianName}</option>
|
@}
|
@}
|
</select>
|
</div>
|
</div>
|
|
|
<div class="form-group">
|
<label class="col-sm-1 control-label"></label>
|
<div class="col-sm-10" style="font-weight: bold">
|
@if(language==1){
|
(根据起点终点距离收费):<br/>
|
@}
|
@if(language==2){
|
(Charge according to the distance from the starting point to the destination point):<br/>
|
@}
|
@if(language==3){
|
(Mengisi sesuai dengan jarak dari titik awal ke titik tujuan):<br/>
|
@}
|
|
</div>
|
</div>
|
|
<div class="form-group">
|
@if(language==1){
|
<label class="col-sm-2 control-label">起步价设置:</label>
|
@}
|
@if(language==2){
|
<label class="col-sm-2 control-label">Setting of starting price:</label>
|
@}
|
@if(language==3){
|
<label class="col-sm-2 control-label">Pengaturan harga mulai:</label>
|
@}
|
|
@if(language==1){
|
<div class="col-sm-10">
|
起步价为
|
<input type="text" oninput="checkIsYuan(this)" name="num1" id="num1" class="form-control newWidth" placeholder="最多5位数"/> Rp,
|
起步包含 <input type="text" oninput="checkIsGongLi(this)" name="num2" id="num2" class="form-control newWidth" placeholder="最多3位数"/> 公里,
|
<input type="text" oninput="checkIsMinute(this)" name="num3" id="num3" class="form-control newWidth" placeholder="最多3位数"/> 分钟
|
<br/>
|
</div>
|
@}
|
@if(language==2){
|
<div class="col-sm-10">
|
The starting price is
|
<input type="text" oninput="checkIsYuan(this)" name="num1" id="num1" class="form-control newWidth" placeholder="Up to 5 digits"/> Rp,
|
and the starting time includes <input type="text" oninput="checkIsGongLi(this)" name="num2" id="num2" class="form-control newWidth" placeholder="Up to 3 digits"/> kilometers,
|
<input type="text" oninput="checkIsMinute(this)" name="num3" id="num3" class="form-control newWidth" placeholder="Up to 3 digits"/> minutes
|
<br/>
|
</div>
|
@}
|
@if(language==3){
|
<div class="col-sm-10">
|
Harga awal adalah
|
<input type="text" oninput="checkIsYuan(this)" name="num1" id="num1" class="form-control newWidth" placeholder="Sehingga 5 digit"/> Rp,
|
dan waktu mulai termasuk <input type="text" oninput="checkIsGongLi(this)" name="num2" id="num2" class="form-control newWidth" placeholder="Sehingga 3 digit"/> kilometer,
|
<input type="text" oninput="checkIsMinute(this)" name="num3" id="num3" class="form-control newWidth" placeholder="Sehingga 3 digit"/> menit
|
<br/>
|
</div>
|
@}
|
</div>
|
|
|
@if(language==1){
|
<div class="form-group">
|
<label class="col-sm-2 control-label">里程费设置:</label>
|
<div class="col-sm-10">
|
超过起步里程后每公里 <input type="text" oninput="checkIsYuan(this)" name="num4" id="num4" class="form-control newWidth" placeholder="最多5位数"/> Rp
|
<br/>
|
</div>
|
</div>
|
@}
|
@if(language==2){
|
<div class="form-group">
|
<label class="col-sm-2 control-label">Mileage fee setting:</label>
|
<div class="col-sm-10">
|
Rp <input type="text" oninput="checkIsYuan(this)" name="num4" id="num4" class="form-control newWidth" placeholder="Up to 5 digits"/> per kilometer after exceeding the starting mileage
|
<br/>
|
</div>
|
</div>
|
@}
|
@if(language==3){
|
<div class="form-group">
|
<label class="col-sm-2 control-label">Pengaturan biaya jarak tempuh:</label>
|
<div class="col-sm-10">
|
Rp <input type="text" oninput="checkIsYuan(this)" name="num4" id="num4" class="form-control newWidth" placeholder="Sehingga 5 digit"/> per kilometer setelah melebihi jarak tempuh awal
|
<br/>
|
</div>
|
</div>
|
@}
|
|
|
@if(language==1){
|
<div class="form-group" id="night">
|
<label class="col-sm-2 control-label">夜间行驶费用设置:</label>
|
<div class="col-sm-10">
|
<input type="text" name="num5" id="num1-1" class="form-control newWidth nightTime" placeholder="选择时间"/> 点为夜间行驶时间,
|
起步价变为 <input type="text" oninput="checkIsYuan(this)" name="num6" id="num6" class="form-control newWidth" placeholder="最多5位数"/> Rp
|
<br>
|
<br>
|
里程费为每公里 <input type="text" oninput="checkIsYuan(this)" name="num7" id="num7" class="form-control newWidth" placeholder="最多5位数"/> Rp
|
<i class="fa fa-plus" onclick="addBox()"></i>
|
<br/>
|
</div>
|
</div>
|
@}
|
@if(language==2){
|
<div class="form-group" id="night">
|
<label class="col-sm-2 control-label">Night driving cost setting:</label>
|
<div class="col-sm-10">
|
<input type="text" name="num5" id="num1-1" class="form-control newWidth nightTime" placeholder="select time"/> is the night driving time, and the starting price will be
|
<input type="text" oninput="checkIsYuan(this)" name="num6" id="num6" class="form-control newWidth" placeholder="Up to 5 digits"/> Rp
|
<br>
|
<br>
|
The mileage fee is <input type="text" oninput="checkIsYuan(this)" name="num7" id="num7" class="form-control newWidth" placeholder="Up to 5 digits "/> Rp
|
<i class="fa fa-plus" onclick="addBox()"></i>
|
<br/>
|
</div>
|
</div>
|
@}
|
@if(language==3){
|
<div class="form-group" id="night">
|
<label class="col-sm-2 control-label">Pengaturan biaya mengemudi malam:</label>
|
<div class="col-sm-10">
|
<input type="text" name="num5" id="num1-1" class="form-control newWidth nightTime" placeholder="Pilih waktu"/> adalah waktu mengemudi malam, dan harga awal akan
|
<input type="text" oninput="checkIsYuan(this)" name="num6" id="num6" class="form-control newWidth" placeholder="Sehingga 5 digit"/> Rp
|
<br>
|
<br>
|
Biaya jarak tempuh adalah <input type="text" oninput="checkIsYuan(this)" name="num7" id="num7" class="form-control newWidth" placeholder="Sehingga 5 digit"/> Rp
|
<i class="fa fa-plus" onclick="addBox()"></i>
|
<br/>
|
</div>
|
</div>
|
@}
|
|
|
|
</div>
|
</div>
|
|
<div class="row btn-group-m-t">
|
<div class="col-sm-10 col-sm-offset-1">
|
@if(language==1){
|
<#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="addSubmit()"/>
|
@}
|
@if(language==2){
|
<#button btnCss="info" name="Submit" id="ensure" icon="fa-check" clickFun="addSubmit()"/>
|
@}
|
@if(language==3){
|
<#button btnCss="info" name="Kirim" id="ensure" icon="fa-check" clickFun="addSubmit()"/>
|
@}
|
|
|
</div>
|
</div>
|
</div>
|
|
|
</div>
|
</div>
|
<!--<script src="${ctxPath}/modular/system/tSystemPrice/tSystemPrice_info.js"></script>-->
|
<script type="text/javascript">
|
|
let language = $("#language").val()
|
function changeColor(obj) {
|
//清空其它同类按钮选中颜色
|
$('div[id^="SupendButton-"]').css("background-color", "transparent");//按钮原来颜色
|
//点击后变色
|
$(obj).val(1);
|
$("#SupendButton-two").val('')
|
$(obj).css("background-color", "#0e9aef")
|
|
|
}
|
function changeColor1(obj) {
|
//清空其它同类按钮选中颜色
|
$('div[id^="SupendButton-"]').css("background-color", "transparent");//按钮原来颜色
|
//点击后变色
|
$(obj).val(2);
|
$("#SupendButton-one").val('')
|
$(obj).css("background-color", "#0e9aef")
|
|
}
|
var regDouble = /^(0|[1-9]\d{0,4})(\.\d{1,2})?$/;
|
var regInt = /^[0-9]{0,3}$/;
|
function checkIsYuan(obj){
|
var num = $(obj).val();
|
if(!regDouble.test(num)){
|
if(language==1){
|
layer.msg("【Rp】输入框不能超过5位数,保留两位小数");
|
}else if(language==2){
|
layer.msg("【Rp】The input field cannot exceed 5 digits. Two decimal places are reserved");
|
}else {
|
layer.msg("【Rp】Kotak masukan tidak dapat melebihi 5 digit, dan dua tempat desimal disimpan");
|
}
|
|
}
|
}
|
function checkIsGongLi(obj){
|
var num = $(obj).val();
|
if(!regDouble.test(num)){
|
if(language==1){
|
layer.msg("【公里】输入框不能超过3位数,保留两位小数");
|
}else if(language==2){
|
layer.msg("【km】The input field cannot exceed 3 digits. Two decimal places are reserved");
|
}else {
|
layer.msg("【km】Kotak masukan tidak dapat melebihi 3 digit, dan dua tempat desimal disimpan");
|
}
|
|
}
|
if (obj.id == "num1"){
|
$("#num3").val(num);
|
}else if (obj.id == "num4"){
|
$("#num6").val(num);
|
}else if (obj.id == "num7"){
|
$("#num9").val(num);
|
}else if (obj.id == "num12"){
|
$("#num14").val(num);
|
}else if (obj.id == "num15"){
|
$("#num17").val(num);
|
}else if (obj.id == "num18"){
|
$("#num20").val(num);
|
}
|
}
|
function checkIsMinute(obj){
|
var num = $(obj).val();
|
if(!regInt.test(num)){
|
if(language==1){
|
layer.msg("【分钟】输入框不能超过3位数");
|
}else if(language==2){
|
layer.msg("【minute】The input field cannot exceed 3 digits");
|
}else {
|
layer.msg("【menit】Kotak masukan tidak dapat melebihi 3 digit");
|
}
|
|
}
|
}
|
|
function provinceChange(e) {
|
var provinceCode=$(e).val();
|
var ajax = new $ax(Feng.ctxPath + "/tSystemPrice/change", function(data){
|
if(data!=null){
|
if(language==1){
|
var content='<option value="">选择市</option>';
|
}else if(language==2){
|
var content='<option value="">Please select a city</option>';
|
}else {
|
var content='<option value="">Pilih Kota</option>';
|
}
|
|
$.each(data, function(k,v) {
|
content += "<option value='"+v.cityId+"'>"+v.cityName+"</option>";
|
});
|
$("#twoId").empty().append(content);
|
}
|
});
|
ajax.set("code",provinceCode);
|
ajax.start();
|
}
|
//提交数据
|
function addSubmit() {
|
//验证数据格式-跨城小件物流价格设置
|
var kcId = $("#kcId").val();
|
var num101 = $("#num101").val();
|
var num102 = $("#num102").val();
|
//验证数据格式-同城小件物流价格设置
|
var tcId = $("#cityId").val();
|
if(tcId==''){
|
if(language==1){
|
Feng.info("请选择城市")
|
}else if(language==2){
|
Feng.info("Please select a city")
|
}else {
|
Feng.info("Pilih Kota")
|
}
|
|
return false;
|
}
|
|
var num1 = $("#num1").val();
|
var num2 = $("#num2").val();
|
var num3 = $("#num3").val();
|
var num4 = $("#num4").val();
|
let num5 = $('input[name="num5"]');
|
let num6 = $('input[name="num6"]');
|
let num7 = $('input[name="num7"]');
|
var b1 = $("#SupendButton-one").val();
|
var b2 = $("#SupendButton-two").val();
|
if(b1=='' && b2==''){
|
if(language==1){
|
Feng.error("【请选择计价对象类型】");
|
}else if(language==2){
|
Feng.error("【Please select the valuation object type】");
|
}else {
|
Feng.error("【Silakan pilih tipe objek penghargaan】");
|
}
|
|
return;
|
}
|
let type =null;
|
if(b1!=''){
|
type=b1
|
}
|
if(b2!=''){
|
type=b2
|
}
|
if ("" == num1 || "" == num2 || "" == num3 || "" == num4 ){
|
if(language==1){
|
Feng.error("【同城快送价格设置】输入框不能为空");
|
}else if(language==2){
|
Feng.error("The input box of [Intra-City Express Delivery Price Setting] cannot be empty");
|
}else {
|
Feng.error("【Kotak input [Pengaturan Harga Pengiriman Ekspres Intra-Kota] tidak dapat kosong");
|
}
|
|
return;
|
}else if (!regDouble.test(num1) || !regDouble.test(num2) || !regDouble.test(num3) || !regDouble.test(num4) ){
|
if(language==1){
|
Feng.error("【同城快送价格设置】输入框格式不正确");
|
}else if(language==2){
|
Feng.error("【Intra-City Express Delivery Price Setting】The format of the input box is incorrect");
|
}else {
|
Feng.error("【Pengaturan Harga Pengiriman Ekspres Intra-Kota】Format kotak masukan tidak benar");
|
}
|
|
return;
|
}
|
//封装数据
|
var json2 = '{"num1":"'+num1+'","num2":"'+num2+'","num3":"'+num3+'","num4":"'+num4+'"}';
|
|
|
|
|
var json1='[';
|
for (let i = 0; i < num5.length; i++) {
|
var arr = '{"num1":"'+$(num5[i]).val()+'","num2":"'+$(num6[i]).val()+'","num3":"'+$(num7[i]).val()+'"}';
|
if(i==num5.length-1){
|
json1 += arr+']'
|
}else {
|
json1 += arr+','
|
}
|
}
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/tSystemPrice/smallSubmit", function(data){
|
if(language==1){
|
Feng.success("操作成功!");
|
}else if(language==2){
|
Feng.success("Operate successfully!");
|
}else {
|
Feng.success("Operasi berhasil!");
|
}
|
|
location.reload();
|
},function(data){
|
if(language==1){
|
if(language==1){
|
Feng.error("操作失败!" + data.responseJSON.message + "!");
|
}else if(language==2){
|
Feng.error("Fail!" + data.responseJSON.message + "!");
|
}else {
|
Feng.error("Gagal!" + data.responseJSON.message + "!");
|
}
|
}else if(language==2){
|
Feng.error("Operation failure!" + data.responseJSON.message + "!");
|
}else {
|
Feng.error("Operasi gagal!" + data.responseJSON.message + "!");
|
}
|
|
});
|
ajax.set("tcId", tcId);
|
ajax.set("json2", json2);
|
ajax.set("type", type);
|
ajax.set("json1", json1);
|
ajax.set("openCityId", $('#openCityId').val());
|
ajax.start();
|
}
|
|
|
function addBox() {
|
var i = $('.nightTime').length + 1;
|
if(language==1){
|
var a =" <div class=\"form-group\">\n" +
|
" <label class=\"col-sm-2 control-label\"></label>\n" +
|
" <div class=\"col-sm-10\">\n" +
|
" <input type=\"text\" name=\"num5\" id=\"num1-" + i + "\" class=\"form-control newWidth nightTime\" placeholder=\"选择时间\"/> 点为夜间行驶时间,\n" +
|
" 起步价变为 <input type=\"text\" oninput=\"checkIsYuan(this)\" name=\"num6\" id=\"num6\" class=\"form-control newWidth\" placeholder=\"最多5位数\"/> Rp\n" +
|
" <br>\n" +
|
" <br>\n" +
|
" 里程费为每公里 <input type=\"text\" oninput=\"checkIsYuan(this)\" name=\"num7\" id=\"num7\" class=\"form-control newWidth\" placeholder=\"最多5位数\"/> Rp\n" +
|
" <i class=\"fa fa-remove\" onclick=\"delBox(this)\"></i>\n" +
|
" <br/>\n" +
|
" </div>\n" +
|
" </div>"
|
}else if(language==2){
|
var a =" <div class=\"form-group\">\n" +
|
" <label class=\"col-sm-2 control-label\"></label>\n" +
|
" <div class=\"col-sm-10\">\n" +
|
" <input type=\"text\" name=\"num5\" id=\"num1-" + i + "\" class=\"form-control newWidth nightTime\" placeholder=\"select time\"/> is the night driving time, and the starting price will be,\n" +
|
" <input type=\"text\" oninput=\"checkIsYuan(this)\" name=\"num6\" id=\"num6\" class=\"form-control newWidth\" placeholder=\"Up to 5 digits\"/> Rp\n" +
|
" <br>\n" +
|
" <br>\n" +
|
" The mileage fee is <input type=\"text\" oninput=\"checkIsYuan(this)\" name=\"num7\" id=\"num7\" class=\"form-control newWidth\" placeholder=\"Up to 5 digits\"/> Rp\n" +
|
" <i class=\"fa fa-remove\" onclick=\"delBox(this)\"></i>\n" +
|
" <br/>\n" +
|
" </div>\n" +
|
" </div>"
|
}else {
|
var a =" <div class=\"form-group\">\n" +
|
" <label class=\"col-sm-2 control-label\"></label>\n" +
|
" <div class=\"col-sm-10\">\n" +
|
" <input type=\"text\" name=\"num5\" id=\"num1-" + i + "\" class=\"form-control newWidth nightTime\" placeholder=\"Pilih waktu\"/> untuk waktu mengemudi di malam hari, dan harga awal menjadi,\n" +
|
" <input type=\"text\" oninput=\"checkIsYuan(this)\" name=\"num6\" id=\"num6\" class=\"form-control newWidth\" placeholder=\"Sehingga 5 digit\"/> Rp\n" +
|
" <br>\n" +
|
" <br>\n" +
|
" Biaya jarak tempuh adalah <input type=\"text\" oninput=\"checkIsYuan(this)\" name=\"num7\" id=\"num7\" class=\"form-control newWidth\" placeholder=\"Sehingga 5 digit\"/> Rp\n" +
|
" <i class=\"fa fa-remove\" onclick=\"delBox(this)\"></i>\n" +
|
" <br/>\n" +
|
" </div>\n" +
|
" </div>"
|
}
|
|
$("#night").append($(a))
|
laydate.render({
|
elem: '#num1-' + i
|
,type: 'time'
|
,range: '-'
|
,format: 'HH:mm'
|
,lang:"en"
|
});
|
|
}
|
function delBox(o) {
|
$(o).parent("div").parent("div").remove()
|
}
|
|
|
laydate.render({
|
elem: '#num1-1'
|
,type: 'time'
|
,range: '-'
|
,format: 'HH:mm'
|
,lang:"en"
|
});
|
</script>
|
@}
|