buli
2023-06-05 175a084533497c67daa3527bce4807fb70ec8793
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
function saveJs() {
    var x = j$(escapeVfId('allPage:allForm:allBlock:Editable:SummonsForDirction__c')).value();
    if (x != '互相调货') {
        var agencytext = j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).value();
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerTextHidden')).val(agencytext);
    }
    blockme();
    save();
}
 
function SortLimitedJs(key) {
    blockme();
    SortLimited(key);
}
 
 
//库存排序
function SortStoreJs(key){
    blockme();
    SortStore(key);
}
 
function searchProductJs() {
    blockme();
    searchConsumableorderdetails();
}
function setDisabled() {
    var productCount = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:consumableorderdetailsCount')).value();
    for (var i = 0; i < productCount; i++) {
        var canselect = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':canSelect')).value();
        if (canselect == 'false') {
            j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':shelfnumber')).attr('disabled',true);
        }
    }
}
//分页修改 已对应
function checkAll() {
    var productCount = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:consumableorderdetailsCount')).value();
    if (j$(escapeVfId('checker')).attr('checked') == 'checked') {
        for (var i = 0; i < productCount; i++) {
            j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableinfo' + ':consumablesCountproRowCheckbox')).attr('checked',true);
        }
    } else {
        for (var i = 0; i < productCount; i++) {
            j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableinfo' + ':consumablesCountproRowCheckbox')).attr('checked',false);
        }
    }
}
 
 
//2016-03-07 页面金额测试用:Js验证
//追加总金额计算
//要求多向联动
function SumCompute(){
    var SumPrice = 0;
    var consumablesCounttestPriceJList = j$("span[Id$='variableAllprice:consumablesCounttestPrice']").value();
    //判断是否为数组 为数组时去掉空值计算
    if (consumablesCounttestPriceJList.constructor == Array) {
        for (var i = 0; i < consumablesCounttestPriceJList.length; i++) {
            var outer = consumablesCounttestPriceJList[i];
            if (isNaN(parseFloat(consumablesCounttestPriceJList[i]))) {
                consumablesCounttestPriceJList.splice(i,1);
                i= i-1;
            }
        }
        var str=consumablesCounttestPriceJList.join("+");
        var SumPrice =eval(str);
    }else{
        var SumPrice = consumablesCounttestPriceJList;
    }
    SumPrice = parseFloat(SumPrice).toFixed(2);
    SumPrice = number_format_common (SumPrice,2,'.',',');
    document.getElementById("allPage:allForm:allBlock:Editable:sumPrice_buttom").innerHTML = SumPrice; 
}
function ComputePrice(j) { // FIXME lineNo にしてください
    var z,x,c;
    var a = j.id;
    var i=a.substring(0,a.lastIndexOf(':'));
    var a=document.getElementById (i+"Allprice:consumablesCounttestPrice");
    z  =  parseFloat(j$(escapeVfId(i+':consumablesCount')).value());
    //z= z.replace(/,/g,'');;
    if(isNaN(z)){z=0.00;}
    if(z!=null&&z!=0&&z!=''){
        j$(escapeVfId(i+'info:consumablesCountproRowCheckbox')).attr('checked',true);
    }else{
        j$(escapeVfId(i+'info:consumablesCountproRowCheckbox')).attr('checked',false);
    }
    x = j$(escapeVfId(i+'Moneyinfo:productOrderMoneyinfo')).value().replace(/,/g,'');
    c = parseFloat(z * x).toFixed(2);
    //c = number_format_common (c,2,'.',',');
    a.innerHTML = c;
    SumCompute();
}
 
function calonLoad() {
}
 
function EditConsumable(){
    //解除不可写状态
    setEditAble();
    //alert("statusEdit"+'{!statusEdit}');
}
function DeleteConsumable(){
    //删除这一单
    if(window.confirm('删除是不可恢复的,你确认要删除吗?')){
        DelConsumable();
    }
}
 
function GoodsDeliveryJs(){
    //出货
    blockme();
    GoodsDelivery();
}
function ClearJs(){
    blockme();
    document.getElementById("allPage:allForm:allBlock:searchBlock:category3Search").value = "";
    document.getElementById("allPage:allForm:allBlock:searchBlock:category4Search").value = "";
    document.getElementById("allPage:allForm:allBlock:searchBlock:category5Search").value = "";
    document.getElementById("allPage:allForm:allBlock:searchBlock:OrderDateSearch").value = "";
    searchConsumableorderdetails();
}
 
window.sfdcPage.appendToOnloadQueue(function() { calonLoad() });