username@email.com
2021-06-03 904fb460b9359fe92e00ce25804d96c8a52bb513
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
//承包合同预审
var currentUserName;
var tabIndex;
var $projectid;
initData = function () {
    if (window.sysid === '') {
        $.ajax({
            url: "/ContractPretrial/InitData",
            async: false,
            cache: false,
            dataType: "json",
            success: function (data) {
                currentUserName = data.CurrentUserName;
                $("#oa_contractpretrial_Code").val(data.Code);
            }
        });
        var $title = "承包合同预审(" + currentUserName + ")";
        $("#oa_contractpretrial_PartyB").val("浙江坤德创新岩土工程有限公司");
        $("#oa_contractpretrial_Title").val($title);
    }
    addCSS();
    //合同金额
    addInputUnit($("#oa_contractpretrial_Amount"), "元", "back");
}
 
//选择客户
$(document).on("click", "input[name='oa_contractpretrial.PartyA']", function () {
    layer.open({
        type: 2,
        title: '客户单位',
        shadeClose: true,
        shade: 0.4,
        area: ['90%', '90%'],
        content: "/Customer/Index"
    });
});
 
SetCustomer = function (mId, mName, mContactName, mContactPhone) {
    $('input[name="oa_contractpretrial.PartyA"]').val(mName);
    $('input[name="oa_contractpretrial.PartyADeputy"]').val(mContactName);
    layer.closeAll();
}
 
//动态添加CSS样式
function addCSS() {
    var str_style = 'td{ position:relative;}\
                    .bl{position: relative;}\
                    .bl .back {position: absolute;top: 0;right: 5px;display: inline-block;}\
                    .bl .backdtl {position: absolute;top: 2px;right:10px;display: inline-block;}';
 
    if (document.all) { // document.createStyleSheet(url)
        window.style = str_style;
        document.createStyleSheet("javascript:style");
    } else { //document.createElement(style)
        var style = document.createElement('style');
        style.type = 'text/css';
        style.innerHTML = str_style;
        document.getElementsByTagName('HEAD').item(0).appendChild(style);
    }
}
 
//在input后添加元div
function addInputUnit($input, unit, className) {
    var div = createDivUnit(unit, className);
    $input.after(div);
    $input.parent().addClass("bl");
}
//创建div元
function createDivUnit(unit, className) {
    var div = document.createElement("div");
    div.className = className;
    div.innerHTML = unit;
    return div;
}
 
 
getQueryVariable = function (parameter) {
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] === parameter) { return pair[1]; }
    }
    return "";
}
 
Array.prototype.Contains = function (val) {
    for (var i = 0; i < this.length; i++) {
        if (this[i] == val) {
            return true;
        }
    }
    return false;
};