|
|
$(function () {
|
|
AutoSetSubmitUrl(); //自动设置提交页面(默认为../business)
|
setTimeout(LoadData, 0); //立即获取数据
|
|
});
|
|
|
|
/*
|
加载数据方法
|
*/
|
function LoadData() {
|
//获取Json数据
|
GetJson({ '0': 'T0T' }, function (data, textStatus) {
|
try {
|
|
if (data) {
|
window.NoneData = eval('[' + data + ']')[0];
|
ShowData();
|
} else {
|
global.NoneDataOperate(); return;
|
}
|
|
|
} catch (ex) {
|
global.DealDataException(ex); return
|
}
|
});
|
|
|
}
|
/*
|
显示信息
|
*/
|
function ShowData() {
|
|
document.getElementById('div_QuotePriceControl').style.display = '已过期' == window.NoneData.StateName ? 'none' : '';
|
window.NoneData.PrintTypeName = window.NoneData.PrintType.PrintName;
|
window.NoneData.MemberName = window.NoneData.MemberBasic.Name;
|
// window.NoneData.StateName = window.NoneData.StateType.Name;
|
window.NoneData.CallTypeName = window.NoneData.CallType.Name;
|
//window.NoneData.ContactPeople = window.NoneData.ContactPeople.ToString();
|
window.NoneData.EndTime = window.NoneData.EndTime.ToString();
|
document.getElementById('link_QQ').href = 'http://wpa.qq.com/msgrd?V=1&Uin=' + window.NoneData.QQ + '&Site=ioshenmue&Menu=yes';
|
window.NoneData.StateName = (window.NoneData.StateName == "已发布" ? "暂未确定供应商" : window.NoneData.StateName);
|
window.SetJsonToDom(window.NoneData, 'spn', "innerHTML");
|
|
|
}
|
|
//正数正则表达式
|
var reg1 = /^\d+(?=\.{0,1}\d+$|$)/;
|
|
/*
|
保存(新增/修改)
|
*/
|
function SaveQuote(member) {
|
|
var ckResult = CheckBuyer(member, window.NoneData ? window.NoneData.MemberId : 'nonedata')
|
if (ckResult) { alertMsg('不能给自己报价!'); return; } else if (undefined == ckResult) return;
|
var txtQuoterPrice = document.getElementById('txtQuoterPrice');
|
if (txtQuoterPrice.value == "") {
|
alertMsg('报价价格不能为空!'); return;
|
}
|
if (!reg1.test(txtQuoterPrice.value)) {
|
alertMsg('报价价格必须为正数字!');
|
txtQuoterPrice.value = "";
|
return;
|
}
|
if (!window.NoneData) { alertMsg('数据尚未加载完毕,请稍后操作!'); return; };
|
|
window.submitUrl = "/Pages/front/FindOrder.aspx"; //设置当前页的提交路径
|
CallServer(
|
{
|
Target: "DemandQuote", RequestParams: window.ConvertJsonToString({ QuoterPrice: txtQuoterPrice.value, QuoteInfo: document.getElementById('txtDemandQuoteInfo').value, DemandId: window.NoneData.Keyid })
|
},
|
function (data, textStatus) {
|
alertMsg(isWin = ('1' == data) ? "操作成功!" : "操作失败!");
|
if ('1' == data) {
|
|
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();
|
|
}
|