|
- function reload_Info(httpData){
-
- var chartLeftSpan=$('#chartLeftSpan');
- var chartLeftSpanStr=chartLeftSpan.html();
- chartLeftSpanStr=chartLeftSpanStr.replace('[订单号]',httpData['orderID']);
- chartLeftSpanStr=chartLeftSpanStr.replace('[是否入住]',httpData['ifstay']);
- chartLeftSpanStr=chartLeftSpanStr.replace('[分销商(上海驴妈妈)]',httpData['orderCome']);
- chartLeftSpanStr=chartLeftSpanStr.replace('[酒店]',httpData['saleStyle']);
- chartLeftSpan.html(chartLeftSpanStr);
-
- var orderCount=$('#orderCount');
- var orderCountStr=orderCount.html();
- orderCountStr=orderCountStr.replace('[a]',httpData['orderCount']);
- orderCountStr=orderCountStr.replace('[b]',httpData['messageCount']);
- orderCountStr=orderCountStr.replace('[c]',httpData['orderAttachment']);
- orderCount.html(orderCountStr);
- //提交订单
- var commitOrder=$('#commitOrder');
- var commitOrderStr=commitOrder.html();
- commitOrderStr=commitOrderStr.replace('[2016.03.02]',httpData['commitDay']);
- commitOrderStr=commitOrderStr.replace('[20:30]',httpData['commitTime']);
- commitOrder.html(commitOrderStr);
- //确认
- var affirmOrder=$('#affirmOrder');
- var affirmOrderStr=affirmOrder.html();
- affirmOrderStr=affirmOrderStr.replace('[2016.03.02]',httpData['affirmDay']);
- affirmOrderStr=affirmOrderStr.replace('[20:30]',httpData['affirmTime']);
- affirmOrder.html(affirmOrderStr);
- //付款
- var payOrder=$('#payOrder');
- var payOrderStr=payOrder.html();
- payOrderStr=payOrderStr.replace('[2016.03.02]',httpData['payDay']);
- payOrderStr=payOrderStr.replace('[20:30]',httpData['payTime']);
- payOrder.html(payOrderStr);
- //通知
- var attentionOrder=$('#attentionOrder');
- var attentionOrderStr=attentionOrder.html();
- attentionOrderStr=attentionOrderStr.replace('[2016.03.02]',httpData['attentionDay']);
- attentionOrderStr=attentionOrderStr.replace('[20:30]',httpData['attentionTime']);
- attentionOrder.html(attentionOrderStr);
- //安排
- var arrangeOrder=$('#arrangeOrder');
- var arrangeOrderStr=arrangeOrder.html();
- arrangeOrderStr=arrangeOrderStr.replace('[2016.03.02]',httpData['arrangeDay']);
- arrangeOrderStr=arrangeOrderStr.replace('[20:30]',httpData['arrangeTime']);
- arrangeOrder.html(arrangeOrderStr);
- //入住酒店
- var checkIn=$('#checkIn');
- var checkInStr=checkIn.html();
- checkInStr=checkInStr.replace('[2016.03.02]',httpData['checkInTimeGo']);
- checkInStr=checkInStr.replace('[2016.03.02]',httpData['checkInTimeOut']);
- checkIn.html(checkInStr);
-
-
- $('#startarea').html(httpData['product']+' '+httpData['bedStyle']);
- $('#starttime').html(httpData['bookSale']+' | '+httpData['company']+' '+httpData['orderNumber']);
- var getTime=$('#getTime');
- var timeStr=getTime.html();
- timeStr=timeStr.replace('[出发日期]',httpData['stayTime']);
- timeStr=timeStr.replace('[t]',httpData['totalNo']);
- timeStr=timeStr.replace('[小时]',httpData['lastTime']);
- getTime.html(timeStr);
- //入住日期
- var bookInfo=httpData['bookInfo'];
- var stayTime=$("#stayTime");
- var tttHTML=$('#tr_one').prop('outerHTML');
- var newHTML=''
- for(var i=0;i<bookInfo.length;i++){
- var tempDict=bookInfo[i];
- var tempHTML=tttHTML;
- tempHTML=tempHTML.replace('[入住日期]',tempDict['startTime']);
- tempHTML=tempHTML.replace('[数量]',tempDict['count']);
- tempHTML=tempHTML.replace('[采购价]',tempDict['buyPrice']);
- tempHTML=tempHTML.replace('[结算价]',tempDict['endPrice']);
- tempHTML=tempHTML.replace('[零售价]',tempDict['salePrice']);
- tempHTML=tempHTML.replace('[采购价金额]',tempDict['buy']);
- tempHTML=tempHTML.replace('[结算价金额]',tempDict['end']);
- tempHTML=tempHTML.replace('[销售利润]',tempDict['profit']);
- newHTML+=tempHTML;
- }
- var total = $('#tr_total').prop('outerHTML');
- total = total.replace('[总采购价金额]',httpData['bookTotalBuy']);
- total = total.replace('[总结算价金额]',httpData['bookTotalEnd']);
- total = total.replace('[总销售利润]',httpData['bookTotalProfit']);
- newHTML+=total;
- stayTime.html(newHTML);
- //续住晚数
- var bookInfoContinue=httpData['bookInfoContinue'];
- var continueStay=$("#continueStay");
- var tttHTML=$('#tr_one_cont').prop('outerHTML');;
- var newHTML=''
- for(var i=0;i<bookInfoContinue.length;i++){
- var tempDict=bookInfoContinue[i];
- var tempHTML=tttHTML;
- tempHTML=tempHTML.replace('[入住日期]',tempDict['startTime']);
- tempHTML=tempHTML.replace('[库存]',tempDict['stock']);
- tempHTML=tempHTML.replace('[数量]',tempDict['count']);
- tempHTML=tempHTML.replace('[采购价]',tempDict['buyPrice']);
- tempHTML=tempHTML.replace('[结算价]',tempDict['endPrice']);
- tempHTML=tempHTML.replace('[零售价]',tempDict['salePrice']);
- tempHTML=tempHTML.replace('[采购价金额]',tempDict['buy']);
- tempHTML=tempHTML.replace('[结算价金额]',tempDict['end']);
- tempHTML=tempHTML.replace('[销售利润]',tempDict['profit']);
- newHTML+=tempHTML;
- }
- var totalContinue = $('#tr_totalContinue').prop('outerHTML');
- totalContinue = totalContinue.replace('[总采购价金额]',httpData['bookTotalBuyContinue']);
- totalContinue = totalContinue.replace('[总结算价金额]',httpData['bookTotalEndContinue']);
- totalContinue = totalContinue.replace('[总销售利润]',httpData['bookTotalProfitContinue']);
- newHTML+=totalContinue;
- continueStay.html(newHTML);
- }
- window.onload=function (){
- get_virtual_user_list('./json/keepStayJson.html');
- }
-
- /*======================网络请求的Ajax的代码=======================*/
-
- // 创建一个Ajax对象
- if (window.ActiveXObject){
- var myreq = new ActiveXObject("Microsoft.XMLHTTP");
- }else{
- var myreq = new XMLHttpRequest();
- }
- // 请求方法,传入URL
- function get_virtual_user_list(myURL)
- {
- myreq.open("get",myURL,true);
-
- // 接收的数据交给哪个函数处理
- myreq.onreadystatechange = show_user_list;
- myreq.send();
- }
- function show_user_list()
- {
-
- if (myreq.readyState == 4)
- {
- // newstr 就是接收到的数据
- var newstr = myreq.responseText;
- var httpData=JSON.parse(newstr);
- reload_Info(httpData);
- }
- }
|