无关风月
2025-03-20 2ad97245d64b65132507cab36ad89d968edb7705
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
/**
 * 角色管理的单例
 */
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'
        });
    });
 
});