/**
|
* 角色管理的单例
|
*/
|
var OilPrice = {
|
};
|
|
|
/**
|
* 修改转发状态
|
* @param id
|
* @param s
|
*/
|
OilPrice.saveOilPrice = function(){
|
let content = "";
|
const dieselOil10Price = $('#dieselOil10Price').val();
|
const dieselOil0Price = $('#dieselOil0Price').val();
|
const gasoline92Price = $('#gasoline92Price').val();
|
const gasoline95Price = $('#gasoline95Price').val();
|
const gasoline98Price = $('#gasoline98Price').val();
|
const startTime = $('#startTime').val();
|
if(null == dieselOil10Price || '' == dieselOil10Price){
|
Feng.error("请填写-10#柴油油价");
|
return
|
}
|
if(null == dieselOil0Price || '' == dieselOil0Price){
|
Feng.error("请填写0#柴油油价");
|
return
|
}
|
if(null == gasoline92Price || '' == gasoline92Price){
|
Feng.error("请填写92#汽油油价");
|
return
|
}
|
if(null == gasoline95Price || '' == gasoline95Price){
|
Feng.error("请填写95#汽油油价");
|
return
|
}
|
if(null == gasoline98Price || '' == gasoline98Price){
|
Feng.error("请填写98#汽油油价");
|
return
|
}
|
if(null == startTime || '' == startTime){
|
Feng.error("请填写生效开始时间");
|
return
|
}
|
if(new Date(startTime) < new Date()){
|
Feng.error("生效日期必须大于当前日期");
|
return
|
}
|
var ajax = new $ax(Feng.ctxPath + "/oilPrice/saveData", function (data) {
|
if(data.code == 200 ){
|
Feng.success("保存成功!");
|
}else{
|
Feng.error(data.msg);
|
}
|
}, function (data) {
|
Feng.error("保存失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set({
|
dieselOil10Price: dieselOil10Price,
|
dieselOil0Price: dieselOil0Price,
|
gasoline92Price: gasoline92Price,
|
gasoline95Price: gasoline95Price,
|
gasoline98Price: gasoline98Price,
|
startTime: startTime
|
});
|
ajax.start();
|
}
|
|
|
|
OilPrice.exportingHistoricalOilPrices = function(){
|
window.location.href = Feng.ctxPath + "/oilPrice/exportingHistorical";
|
}
|
|
|
|
$(function () {
|
layui.use('laydate', function() {
|
var laydate = layui.laydate;
|
laydate.render({
|
elem: '#startTime'
|
,type: 'datetime'
|
});
|
});
|
|
});
|