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
 
window.submitUrl = "/Pages/front/FindOrder.aspx"; //设置当前页的提交路径
 
/*
保存(新增/修改)
*/
function SaveQuote(member) {
   var txtDemandQuoteInfo= document.getElementById('txtDemandQuoteInfo');
   if (txtDemandQuoteInfo && !txtDemandQuoteInfo.value) { alertMsg('报价价格无效!');  txtDemandQuoteInfo.focus();return; }
    if (!window.NoneData) { alertMsg('数据尚未加载完毕,请稍后操作!'); return; };
    if (CheckBuyer(member, window.NoneData ? window.NoneData.MemberId : 'nonedata')) { alertMsg('不能给自己报价!'); return; }
    alert(window.NoneData.Keyid);
    CallServer(
    {
        Target: "DemandQuote", RequestParams: window.ConvertJsonToString({ QuoteInfo: txtDemandQuoteInfo.value, DemandId: window.NoneData.Keyid}) 
    },
     function (data, textStatus) {
        alertMsg(isWin = ('1' == data) ? "操作成功!" : "操作失败!");
        if ('1' == data) {
            $('#div_DemandQuote').css('display','none');
            document.getElementById('txtDemandQuoteInfo').value = '';
 
        } else { }
    });
}
 
/*
设置层位置
*/
function SetDivLocation(event, demandId) {
    var position = mouseCoords(event); 
    //alertMsg("x:" + position.x + ",y:" + position.y + ',' + $(document).scrollTop());
    
    $('#div_DemandQuote').css('top', (position.y + $(document).scrollTop()) + 'px');
    $('#div_DemandQuote').css('left', (position.x + 20) + 'px');
    $('#div_DemandQuote').css('display', 'block');
    $('#txtDemandId').val(demandId);
    document.getElementById('txtDemandQuoteInfo').focus();
 
}
/*
获取鼠标坐标
*/
function mouseCoords(ev) {
    if (ev.pageX || ev.pageY) {
        return { x: ev.pageX, y: ev.pageY };
    }
    return {
        x: ev.clientX + document.body.scrollLeft - document.body.clientLeft,
        y: ev.clientY + document.body.scrollTop - document.body.clientTop
    };