|
- //json/jsonHotelWaitConfirm.html
- var tr_finalStr = '';
- //订单备注-tr_str
- var cur_order_id = 0;
- var pay_end_time = '';
- var ht_tr_com_one_str = ''; //订单备注tr的str
- var ht_tr_mes_one_str = ''; //短信通知tr的str
- var ht_select_room_HTML_st = ''; //库存后面房间数
- var tr_modify = '';
- var http_data_length = 0;
- //详情
- var base_url = "./st-xm/Api/ht_get_order_detail.php";
- var base_url_modify = "./st-xm/Api/ht_get_order_modify.php";
- //库存-下订单前的info
- //var base_url_place="./st-xm/Api/ht_get_place_order_info.php";
- var base_url_place = "./st-xm/Api/ht_get_place_order_info.php";
- //my--moyan
- //var my_base_url_ok = "http://192.168.6.108:8082/st-xm/Api/hotel_order_status.php";
- var my_base_url_ok = "./st-xm/Api/hotel_order_status.php";
- var my_base_url_cancel = "./st-xm/Api/hotel_order_cancel_changeback.php";
- var base_url_my_add_order = "./st-xm/Api/hotel_submit_order.php";
- //订单主表里面的订单根据order_id得到的
- var detail_date_arr = null;
- //头部左侧
- var order_detail = null;
-
- //页面加载的时候调用
- window.onload = function() {
- ht_tr_com_one_str = $('#ht_tr_com_one').prop('outerHTML');
- ht_tr_com_one_str = ht_tr_com_one_str.replace('none', 'table-row');
- ht_tr_mes_one_str = $('#ht_tr_mes_one').prop('outerHTML');
- ht_tr_mes_one_str = ht_tr_mes_one_str.replace('none', 'table-row');
- tr_modify = $('#tr_modify_one').prop('outerHTML');
- tr_modify = tr_modify.replace('none', 'table-row');
-
- // ht_select_room_HTML_st=$('#select_room').prop('outerHTML');
- ht_select_room_HTML_st = $('#select_room').html();
- tr_finalStr = $('#tr_modify_final').prop('outerHTML');
- tr_finalStr = tr_finalStr.replace('none', 'table-row');
-
- var order_id = getPar('order_id');
- if (!order_id) {
- alert('缺少参数');
- return;
- }
- $('#order_id').val(getPar('order_id'));
- //调用 函数
- var url_modify = base_url_modify + "?method=getOrderChannel&order_id=" + order_id;
-
- $.getJSON(url_modify, function(res_data) {
- console.log('-----------');
- console.log(res_data);
- if (res_data['order_channel'].length > 0) {
-
- var dict = res_data['order_channel'][0];
- //判断是否是自营
- // if (dict['org_type_id'] == "176" || dict['org_type'] == "自营") {
- // $('#order_channel').html("自营");
- // $('#outside_order_id').css('display', 'none');
- // $('#order_from').val(dict['org_type_id']);
- // $('#distributors').val('0');
- // } else {
- var str = dict['org_type'] + ' | ' + dict['org_name'] + ' 渠道订单号:';
- $('#order_channel').html(str);
- var num = dict['outside_order_id'];
- $('#outside_order_id').val(num);
- $('#outside_order_id').css('display', '');
- $('#order_from').val(dict['org_type_id']);
- $('#distributors').val(dict['org_id']);
- // }
- $('#myform').css('display', 'block');
-
- }
- });
- var url = base_url + '?method=getOrderDetail&order_id=' + order_id;
-
- get_http_data_by_url(url);
-
- }
-
- // 请求方法,传入URL
- function get_http_data_by_url(myURL) {
- $.getJSON(myURL, function(httpData) {
- if (httpData['code'] != "0") {
- alert(httpData['info']);
- return;
- }
- if (httpData['order_detail'].length <= 0) {
- alert('没有符合条件的数据');
- return;
- }
- console.log('订单详情');
- console.log(httpData);
- //头部左侧
- order_detail = httpData['order_detail'][0];
- var top_left_HTML = $('#chartLeftSpan').html();
- //将订单号保存在一个临时变量里
- cur_order_id = getPar('order_id');
- top_left_HTML = top_left_HTML.replace('[订单号]', getPar('order_id'));
-
- var st = order_detail['order_status_str'];
- top_left_HTML = top_left_HTML.replace('[是否入住]', st);
- top_left_HTML = top_left_HTML.replace('[分销商(上海驴妈妈)]', order_detail['org_name']);
- top_left_HTML = top_left_HTML.replace('[酒店]', '酒店');
- $('#chartLeftSpan').html(top_left_HTML);
- //头部右侧
- var or_st = httpData['order_status'];
- var new_or_st = new Array();
- for (var i = 0; i < or_st.length; i++) {
- var temp = or_st[i];
- new_or_st[temp['order_status_id']] = temp;
- }
- if (new_or_st['145']) { //待支付
- var arr_date_time = new_or_st['145']['status_date'].split(' ');
- $('#one_date').html(arr_date_time[0]);
- $('#one_time').html(arr_date_time[1]);
- pay_end_time = order_detail['pay_end_time'];
- if (!new_or_st['198']) {
- ShowCountDown();
- timer = setInterval('ShowCountDown()', 1000);
- }
- //变成支付,,添加支付剩余时间
- }
- if (new_or_st['198']) { //待确认
- var arr_date_time = new_or_st['198']['status_date'].split(' ');
- $('#two_date').html(arr_date_time[0]);
- $('#two_time').html(arr_date_time[1]);
- $('#two_cir').css('border', '3px solid greenyellow');
- $('#two_cir').css('border-radius', '15px;');
- $('#pay_time').html('');
- $('#downBtn1').html('确认');
- $('#downBtn3').css('width', '100px');
- $('#downBtn3').html('退改申请');
- }
- if (new_or_st['200']) { //待安排
- var arr_date_time = new_or_st['200']['status_date'].split(' ');
- $('#three_date').html(arr_date_time[0]);
- $('#three_time').html(arr_date_time[1]);
- $('#three_cir').css('border', '3px solid greenyellow');
- $('#three_cir').css('border-radius', '15px;');
- $('#downBtn1').css('width', '125px');
- $('#downBtn1').html('录入确认号');
- $('#downBtn2').css('display', 'none');
- $('#downBtn2').html('');
- $('#downBtn3').css('width', '100px');
- $('#downBtn3').html('退改申请');
- }
- if (new_or_st['199']) { //待通知
- var arr_date_time = new_or_st['199']['status_date'].split(' ');
- $('#four_date').html(arr_date_time[0]);
- $('#four_time').html(arr_date_time[1]);
- $('#four_cir').css('border', '3px solid greenyellow');
- $('#four_cir').css('border-radius', '15px;');
- $('#downBtn1').css('width', '150px');
- $('#downBtn1').html('人工确认通知');
- }
- if (new_or_st['218']) { //已安排
- var arr_date_time = new_or_st['218']['status_date'].split(' ');
- $('#five_date').html(arr_date_time[0]);
- $('#five_time').html(arr_date_time[1]);
- $('#five_cir').css('border', '3px solid greenyellow');
- $('#five_cir').css('border-radius', '15px;');
- $('#downBtn1').css('display', 'none');
- $('#downBtn1').html('');
- $('#downBtn3').css('width', '100px');
- $('#downBtn3').html('退改申请');
- }
- if (new_or_st['201']) { //退改中
- $('#pay_time').html('');
- // $('#pay_time').css('display','none');
- $('#six_cir').css('border', '3px solid darkgray');
- $('#downBtn1').css('display', 'none');
- $('#downBtn1').html('');
- $('#downBtn2').css('display', 'none');
- $('#downBtn2').html('');
- $('#downBtn3').css('width', '100px');
- $('#downBtn3').html('退单确认');
- }
- if (new_or_st['147']) { //已完成
- if (!new_or_st['201']) {
- $('#pay_time').html('<img width="10px" height="10px" src="../img/timer.jpg"/>入住日期:' + order_detail['check_in_date']);
- $('#downBtn3').css('width', '100px');
- $('#downBtn3').html('退改申请');
- $('#six_cir').css('border', '3px solid greenyellow');
- $('#six_cir').css('border-radius', '15px;');
- }
- }
- if (new_or_st['238']) { //已退单
- $('#downBtn1').css('display', 'none');
- $('#downBtn1').html('');
- $('#downBtn2').css('display', 'none');
- $('#downBtn2').html('');
- $('#downBtn3').css('display', 'none');
- $('#downBtn3').html('');
- }
- if (new_or_st['148']) { //已取消
- $('#downBtn1').css('display', 'none');
- $('#downBtn2').css('display', 'none');
- $('#downBtn3').css('display', 'none');
- $('#downBtn1').html('');
- $('#downBtn2').html('');
- $('#downBtn3').html('');
- $('#pay_time').html('');
- clearInterval(timer);
- }
- // 订单备注短信通知
- $('#span_order_remark').html('订单备忘:' + order_detail['com_count'] + '条');
- $('#span_info_noti').html('短信通知:' + order_detail['mes_count'] + '条');
-
- // 1.预订信息
- $('#hotel_room').html(order_detail['prod_name']);
- $('#form_prod_id').val(order_detail['prod_id']);
- $('#form_prod_name').val(order_detail['prod_name'])
- //开始和结束日期
- $('#id-date-picker-1').val(order_detail['start_date']);
- $('#id-date-picker-2').val(order_detail['end_date']);
- //共几晚 最晚到店
- $('#all_days').html('共 ' + order_detail['all_day'] + ' 晚');
- $('#arrive_latest_time').val(order_detail['latest_time']);
-
- // 表格
- detail_date_arr = httpData['detail_date_arr'];
- date_choose_picker(1);
- // 2.客人信息
- $('#customer_name').val(order_detail['customer_name']);
- $('#customer_mobile').val(order_detail['customer_mobile']);
- //显示整个页面
- $('.hotelWaitConfirm').css('display', 'block');
- //订单备注
- get_order_comment(base_url + '?method=getOrderRemark&order_id=' + cur_order_id);
- //短信通知
- get_order_send_message(base_url + '?method=getOrderSendMessage&order_id=' + cur_order_id);
-
- });
- }
- //请求订单备注
- function get_order_comment(com_url) {
- $.getJSON(com_url, function(res_data) {
- var ht_comment_list = $('#ht_comment_list');
- var order_remark_arr = res_data['order_remark_arr'];
- if (order_remark_arr == undefined) {
- return;
- }
- var comHTML = '';
- for (var i = 0; i < order_remark_arr.length; i++) {
- var dict = order_remark_arr[i];
- var HTML = ht_tr_com_one_str;
- HTML = HTML.replace('[类型]', dict['comment_type_str']);
- HTML = HTML.replace('[内容]', dict['comment_txt']);
- HTML = HTML.replace('[添加人]', dict['user_name']);
- HTML = HTML.replace('[添加时间]', dict['create_time']);
- comHTML += HTML;
- }
- ht_comment_list.html(comHTML);
- });
- }
- //请求订单-短信通知
- function get_order_send_message(mes_url) {
- $.getJSON(mes_url, function(res_data) {
- var ht_send_message_list = $('#ht_send_message_list');
- var order_send_message_arr = res_data['order_send_message_arr'];
- if (order_send_message_arr == undefined) {
- return;
- }
- var mesHTML = '';
- for (var i = 0; i < order_send_message_arr.length; i++) {
- var dict = order_send_message_arr[i];
- var HTML = ht_tr_mes_one_str;
- HTML = HTML.replace('[内容]', dict['send_mobile'] + ":" + dict['message']);
- HTML = HTML.replace('[操作人]', dict['user_name']);
- HTML = HTML.replace('[发送时间]', dict['send_time']);
- mesHTML += HTML;
- }
- ht_send_message_list.html(mesHTML);
- });
- }
- //判断日期是否合法
- function date_choose_picker(type) {
- var start_date = $('#id-date-picker-1').val();
- var end_date = $('#id-date-picker-2').val();
- // 判断日期是否合理
- var date1 = new Date(start_date.replace(/\-/g, '/'));
- var date2 = new Date(end_date.replace(/\-/g, '/'));
- if (date1 > date2) {
- alert('开始日期不能小于结束日期!!!');
- $('#all_days').html('共 0 晚');
- $('#hotelList').html('');
- if (type == 1) {
- $('#id-date-picker-1').val('');
- } else {
- $('#id-date-picker-2').val('');
- }
- return;
- }
- if (detail_date_arr.length > 0) {
- var cur_order_prod_id = detail_date_arr[0]['prod_id'];
- //去查询库存
- var tnowtime = getDateTime(4);
- var url = base_url_place + "?method=getPlaceOrderInfo&prod_id=" + cur_order_prod_id + "&check_in_date=" + start_date + "&check_out_date=" + end_date + "&tt=" + tnowtime;
- console.log('ku chun ' + url);
- $.getJSON(url, function(res_data) {
- if (res_data['code'] != "0") {
- alert(res_data['info']);
- return;
- }
- var arr_rooms = new Array();
- console.log('订单中的');
- console.log(detail_date_arr); //订单中的
- console.log('库存');
- console.log(res_data); //库存
- $('#maxcount').val(detail_date_arr.length);
-
- //库存的
- var res_order_info = res_data['place_order_info'];
- var bookingHTML = '';
- $('#all_days').html('共 '+res_order_info.length+' 晚');
- if (res_order_info.length > 0) {
- $('#maxcount').val(res_order_info.length);
- //先保存数据的长度
- http_data_length = res_order_info.length;
- var v_b_p=0;//采购价
- var v_m_p=0;//结算价
- var v_p_p=0;//利润
- var v_o_p=0;//零售价
- for (var i = 0; i < res_order_info.length; i++) {
- var tempHTML = tr_modify;
- var dict_res = res_order_info[i];
- tempHTML = tempHTML.replace('[base]', i);
- tempHTML = tempHTML.replace('[mid]', i);
- tempHTML = tempHTML.replace('[order]', i);
- tempHTML = tempHTML.replace('check_in_date', 'check_in_date_' + i);
- tempHTML = tempHTML.replace('run_id', 'run_id_' + i);
- tempHTML = tempHTML.replace('select_room', 'select_room_' + i);
- tempHTML = tempHTML.replace('room_count', 'room_count_' + i);
- tempHTML = tempHTML.replace('[cai_blur]', i);
- tempHTML = tempHTML.replace('[jie_blur]', i);
- tempHTML = tempHTML.replace('[zero_blur]', i);
- tempHTML = tempHTML.replace('[index]', i);
- tempHTML = tempHTML.replace('[cai1]', i);
- tempHTML = tempHTML.replace('[jie1]', i);
- tempHTML = tempHTML.replace('[zero1]', i);
- tempHTML = tempHTML.replace('[cai2]', i);
- tempHTML = tempHTML.replace('[jie2]', i);
- tempHTML = tempHTML.replace('[lirun]', i);
- tempHTML = tempHTML.replace('[库存]', dict_res['total_count']);
- //arr_rooms.push(dict_res['total_count']);
- var dict_order='';
- for(var item in detail_date_arr){
- if((dict_res['run_date']== detail_date_arr[item]['check_in_date']) && (dict_res['prod_id'] == detail_date_arr[item]['prod_id'])){
- dict_order = detail_date_arr[item];
- }
- }
-
- if(dict_order==''){
- tempHTML = tempHTML.replace('[入住日期]', dict_res['run_date']);
- tempHTML = tempHTML.replace('checkIn:Value', dict_res['run_date']);
- tempHTML = tempHTML.replace('[run_id:Value]', dict_res['run_id']);
-
- tempHTML = tempHTML.replace('[采购价]', dict_res['base_price']);
- tempHTML = tempHTML.replace('[结算价]', dict_res['mid_price']);
- tempHTML = tempHTML.replace('[零售价]', dict_res['order_price']);
- tempHTML = tempHTML.replace('[采购价金额]', dict_res['base_price']);
- tempHTML = tempHTML.replace('[结算价金额]', dict_res['mid_price']);
- tempHTML = tempHTML.replace('[销售利润]', dict_res['mid_price'] - dict_res['base_price']);
-
-
- v_b_p=v_b_p+ parseFloat(dict_res['base_price']);//采购价
-
- v_m_p=v_m_p+parseFloat(dict_res['mid_price']);//结算价
- v_p_p=v_p_p+parseFloat(dict_res['mid_price'] - dict_res['base_price']);//利润
- v_o_p=v_o_p+parseFloat(dict_res['order_price']);
-
- arr_rooms.push(dict_res['total_count']);
- }else{
- tempHTML = tempHTML.replace('[入住日期]', dict_order['check_in_date']);
- tempHTML = tempHTML.replace('checkIn:Value', dict_order['check_in_date']);
-
- tempHTML = tempHTML.replace('[run_id:Value]', dict_res['run_id']);
-
- tempHTML = tempHTML.replace('[采购价]', dict_order['base_price']);
- tempHTML = tempHTML.replace('[结算价]', dict_order['mid_price']);
- tempHTML = tempHTML.replace('[零售价]', dict_order['order_price']);
- tempHTML = tempHTML.replace('[采购价金额]', dict_order['base_balance']);
- tempHTML = tempHTML.replace('[结算价金额]', dict_order['mid_balance']);
- tempHTML = tempHTML.replace('[销售利润]', dict_order['profits']);
- v_b_p=v_b_p+parseFloat(dict_order['base_balance']);
- v_m_p=v_m_p+parseFloat(dict_order['mid_balance']);//结算价
- v_p_p=v_p_p+parseFloat(dict_order['profits']);//利润
- v_o_p=v_o_p+parseFloat(dict_order['order_balance']);
- arr_rooms.push(parseInt(dict_res['total_count'])+parseInt(dict_order['count']));
- }
- bookingHTML += tempHTML;
- }
- //总计
-
- tr_finalStr = tr_finalStr.replace('[总零售价]', order_detail['all_order_balance']);
- tr_finalStr = tr_finalStr.replace('[采购价金额]',order_detail['all_base_balance']);
- tr_finalStr = tr_finalStr.replace('[结算价金额]', order_detail['all_mid_balance']);
- tr_finalStr = tr_finalStr.replace('[销售利润]', order_detail['all_profits']);
-
- bookingHTML += tr_finalStr
- $('#ht_modify_or_list').html(bookingHTML);
- $('#order').html(v_o_p);
- $('#base').html(v_b_p);
- $('#mid').html(v_m_p);
- $('#profit').html(v_p_p);
- for (var i = 0; i < arr_rooms.length; i++) {
- var count = arr_rooms[i];
- var sel_room_all_HTML = '';
- for (var j = 0; j < count; j++) {
- var tempHT = ht_select_room_HTML_st;
- tempHT = tempHT.replace('[value:i]', j + 1);
- tempHT = tempHT.replace('[html:i]', j + 1);
- sel_room_all_HTML += tempHT;
- }
- $('#select_room_' + i).html(sel_room_all_HTML);
- }
- //让房间数默认选中下单时的个数
- for (var i = 0; i < res_order_info.length; i++) {
- var dict_res = res_order_info[i];
- var dict_order='';
- for(var item in detail_date_arr){
- if((dict_res['run_date']== detail_date_arr[item]['check_in_date']) && (dict_res['prod_id'] == detail_date_arr[item]['prod_id'])){
- dict_order = detail_date_arr[item];
- }
- }
- if(dict_order!=''){
- $('#select_room_' + i).val(dict_order['count']);
- }
-
- }
-
-
-
- }
- });
-
- }
- }
- //计时
- var timer = null;
-
- function ShowCountDown() {
- // pay_end_time
- var dt1 = getDateTime(0) + " " + getDateTime(2);
- var dt2 = pay_end_time;
- var date1 = new Date(dt1.replace(/\-/g, '/'));
- var date2 = new Date(dt2.replace(/\-/g, '/'));
- var date3 = date2 - date1;
- //计算出相差天数
- var days = Math.floor(date3 / (24 * 3600 * 1000))
-
- //计算出小时数
- var leave1 = date3 % (24 * 3600 * 1000) //计算天数后剩余的毫秒数
- var hours = Math.floor(leave1 / (3600 * 1000))
-
- //计算相差分钟数
- var leave2 = leave1 % (3600 * 1000) //计算小时数后剩余的毫秒数
- var minutes = Math.floor(leave2 / (60 * 1000))
-
- //计算相差秒数
- var leave3 = leave2 % (60 * 1000) //计算分钟数后剩余的毫秒数
- var seconds = Math.round(leave3 / 1000);
- var str = days + "日" + hours + "时" + minutes + "分" + seconds + "秒";
-
- if (hours < 10) {
- str = str.replace('日', '日0');
- // str = days + "日0" + hours + "时" + minutes + "分" + seconds + "秒";
- }
- if (minutes < 10) {
- str = str.replace('时', '时0')
- // str = days + "日" + hours + "时0" + minutes + "分" + seconds + "秒";
- }
- if (seconds < 10) {
- str = str.replace('分', '分0');
- // str = days + "日" + hours + "时" + minutes + "分0" + seconds + "秒";
- }
- if(date2==date1){
- location.replace(location.href);
- }else if(date2<date1){
- str="0日00时00分00秒";
- str = '<img width="10px" height="10px" src="../img/timer.jpg"/>剩余时间:' + str;
- $('#pay_time').html(str);
- }else{
- str = '<img width="10px" height="10px" src="../img/timer.jpg"/>剩余时间:' + str;
- $('#pay_time').html(str);
- }
- }
- //点击了三个固定的
- function click_show_div(objName, self_obj) {
- var obj = $(objName);
- if (obj.css('display') == 'none') {
- center_show(obj);
- } else {
- obj.css('display', 'none');
- }
- }
- //点击了第二级
- function click_two_show_div(father_name, self_name) {
- var father = $(father_name);
- var self = $(self_name);
- father.css('display', 'none');
- center_show(self);
- }
- //选择房间数
- function select_room(index, count) {
- //拿到采购价和结算价
- var cai_price = $('#cai_price_' + index).val();
- var jie_price = $('#jie_price_' + index).val();
-
- //计算
- update_show(index, count, cai_price, jie_price);
- //总计
- all_total_show()
- }
- //采购价value发生改变
- function cai_change(index, value) {
- //拿到房间数
- var rooms = $('#select_room_' + index).find("option:selected").val();
- //拿到结算价
- var jie_price = $('#jie_price_' + index).val();
- //计算
- update_show(index, rooms, value, jie_price);
- //总计
- all_total_show();
- }
- //结算价value发生改变
- function jie_change(index, value) {
- if (value.trim().length <= 0) {
- value = 0;
- }
- //拿到房间数
- var rooms = $('#select_room_' + index).find("option:selected").val();
- //拿到采购价
- var cai_price = $('#cai_price_' + index).val();
- //计算
- update_show(index, rooms, cai_price, value);
- //总计
- all_total_show();
- }
-
- //零售价value发生改变
- function zero_change(index, value) {
- if (value.trim().length <= 0) {
- value = 0;
- }
- //拿到房间数
- var rooms = $('#select_room_' + index).find("option:selected").val();
- //拿到采购价
- var cai_price = $('#cai_price_' + index).val();
- //计算
- //update_show(index, rooms, cai_price, value);
- //总计
- all_total_show();
- }
-
- //计算和显示
- function update_show(index, room_count, cai_price, jie_price) {
- //计算
- var all_cai = cai_price * room_count;
- var all_jie = jie_price * room_count;
- //改变页面
- //利润
- var profits = all_jie - all_cai;
- //改变页面的效果
- $('#cai_price_balance_' + index).html(all_cai);
- $('#jie_price_balance_' + index).html(all_jie);
- $('#profits_' + index).html(profits);
-
- }
- //总计
- function all_total_show() {
- var all_cai = 0;
- var all_jie = 0;
- var all_profits = 0; //利润
- var all_order=0;//零售价
- for (var i = 0; i < http_data_length; i++) {
- var ling=($('#zero_price_'+i).val())*($('#select_room_'+i).val());
- var cai = $('#cai_price_balance_' + i).html();
- var jie = $('#jie_price_balance_' + i).html();
- var profits = $('#profits_' + i).html();
-
- all_order+=parseInt(ling);
- all_cai += parseInt(cai);
- all_jie += parseInt(jie);
- all_profits = all_jie - all_cai;
- }
- var all_HTML = $('#tr_modify_final').html();
- var tempHTML = tr_finalStr;
- var profits = all_jie - all_cai;
- tempHTML = tempHTML.replace('[总零售价]', all_order);
- tempHTML = tempHTML.replace('[采购价金额]', all_cai);
- tempHTML = tempHTML.replace('[结算价金额]', all_jie);
- tempHTML = tempHTML.replace('[销售利润]', all_profits);
- all_HTML += tempHTML;
- $('#tr_modify_final').html(all_HTML);
- $('#order').html(all_order);
- $('#base').html(all_cai);
- $('#mid').html(all_jie);
- $('#profit').html(all_profits);
-
- }
- //订单备注的——提交
- $(document).ready(function() {
- $('#btn_comment_submit').click(function() {
- hide_all();
- var type = $('#add_com_sel').find("option:selected").val();
- var text = $('#or_remark_txt').val();
- if (type == "") {
- alert('请选择类型!!!');
- return;
- }
- if (text.trim().length <= 0) {
- alert('请输入备注信息!!!');
- return;
- }
- var ok_num_url = my_base_url_ok + "?method=addcomment&order_id=" + cur_order_id + "&comment_type=" + type + "&comment_text=" + text;
- $('#or_remark_txt').val();
- $.getJSON(ok_num_url, function(res_data) {
- if (res_data['code'] != "0") {
- alert(res_data['info']);
- return;
- }
- location.replace(location.href);
- });
- });
- });
- //短信通知——提交
- $(document).ready(function() {
- $('#btn_message_submit').click(function() {
- hide_all();
- $('#or_send_mes_txt').html('');
- // var mes_url="http://127.0.0.1/%E8%9C%98%E8%9B%9B2.0%E8%83%BD%E5%86%99PHP/st-xm/Api/ht_get_order_detail.php?method=getOrderSendMessage&order_id="+cur_order_id;
- get_order_send_message(mes_url + '?method=getOrderSendMessage&order_id=' + cur_order_id);
- });
- });
- //点击了关闭
- function click_cancel(father_name, self_name) {
- if (father_name) {
- var father = $(father_name);
- center_show(father);
- } else {
- $('.mask').css('display', 'none');
- }
- $(self_name).css('display', 'none');
- }
-
- //居中显示
- var tempDiv = null;
-
- function center_show(show_div) {
- tempDiv = show_div;
- //显示蒙板
- show_div.css('display', 'block');
- show_div.css('z-index', 10);
- show_div.css('background-color', 'white');
- show_div.css('position', 'fixed');
-
- var w = show_div.css('width');
- var h = show_div.css('height');
- w = w.substr(0, w.length - 2);
- h = h.substr(0, h.length - 2);
-
- // var s_left=(window.screen.availWidth-w)/2 +"px";
- // var s_top=(window.screen.availHeight-h)/2 +'px';
- var s_left = (window.innerWidth - w) / 2 + 'px';
- var s_top = (window.innerHeight - h) / 2 + 'px';
- show_div.css('left', s_left);
- show_div.css('top', s_top);
- $('.mask').css('display', 'block');
-
- }
- //点击蒙板
- function hide_all() {
- $('.mask').css('display', 'none');
- tempDiv.css('display', 'none');
- }
- //order_pay选择改变
- function select_pay_way(value) {
- if (value == '0') {
- $('#pay1').css('display', 'block');
- $('#pay2').css('display', 'none');
- } else {
- $('#pay1').css('display', 'none');
- $('#pay2').css('display', 'block');
- }
- }
- //保存修改
- $(document).ready(function() {
- $('#btn_modify_save').click(function() {
- document.myform.action = base_url_my_add_order;
- document.myform.submit();
- });
- });
- //取消
- $(document).ready(function() {
- $('#btn_cancel').click(function() {
- history.back();
- });
- });
-
- function getPar(par) {
- //获取当前URL
- var local_url = document.location.href;
- local_url = decodeURI(local_url);
- //获取要取得的get参数位置
- var get = local_url.indexOf(par + "=");
- if (get == -1) {
- return false;
- }
- //截取字符串
- var get_par = local_url.slice(par.length + get + 1);
- //判断截取后的字符串是否还有其他get参数
- var nextPar = get_par.indexOf("&");
- if (nextPar != -1) {
- get_par = get_par.slice(0, nextPar);
- }
- return get_par;
- }
-
- function checkMobile(str) {
- var re = /^1\d{10}$/;
- if (re.test(str)) {
- return true;
- } else {
- return false;
- }
- }
-
- function getDateTime(nTypeFlag) {
- var tNowTime = new Date();
- var myYear = ';' + tNowTime.getFullYear() + ';';
- var myMonth = ';' + (tNowTime.getMonth() + 1 - 0) + ';';
- var myDay = ';' + tNowTime.getDate() + ';';
- var myHour = ';' + tNowTime.getHours() + ';';
- var myMinu = ';' + tNowTime.getMinutes() + ';';
- var mySecond = ';' + tNowTime.getSeconds() + ';';
-
- if (myMonth.length < 4) myMonth = '0' + myMonth;
- if (myDay.length < 4) myDay = '0' + myDay;
- if (myHour.length < 4) myHour = '0' + myHour;
- if (myMinu.length < 4) myMinu = '0' + myMinu;
- if (mySecond.length < 4) mySecond = '0' + mySecond;
-
- var cNewTimeStr;
- //alert(tNowTime);
- switch (nTypeFlag + 1 - 1) {
- case 0:
- cNewTimeStr = myYear + '-' + myMonth + '-' + myDay;
- break;
- case 1:
- cNewTimeStr = myYear + myMonth + myDay;
- break;
- case 2:
- cNewTimeStr = myHour + ':' + myMinu + ':' + mySecond;
- break;
- case 3:
- cNewTimeStr = myHour + myMinu + mySecond;
- break;
- case 4:
- cNewTimeStr = myYear + myMonth + myDay + myHour + myMinu + mySecond;
- break;
- case 5:
- cNewTimeStr = myYear + '年' + myMonth + '月' + myDay + '日';
- break;
- case 6:
- cNewTimeStr = myYear;
- break;
- case 7:
- cNewTimeStr = myYear + '-' + myMonth;
- break;
- default:
- cNewTimeStr = myYear + '-' + myMonth + '-' + myDay + ' ' + myHour + ':' + myMinu + ':' + mySecond;
- break;
- }
-
- cNewTimeStr = cNewTimeStr.replace(/;/g, "");
-
- return cNewTimeStr;
-
- }
-
- /*
-
- // // 3.结算信息
- // //分销商
- // var arr_fen_shop=httpData['fen_shop'];
- // var tr_fen=$('#tr_fen_one').prop('outerHTML');
- // var fenHTML='';
- // for (var i=0;i<arr_fen_shop.length;i++) {
- // var tempDict=arr_fen_shop[i];
- // var tempHTML=tr_fen;
- // tempHTML=tempHTML.replace('[名称]',tempDict['shop_name']);
- // tempHTML=tempHTML.replace('[分销商订单号]',tempDict['order_no']);
- // tempHTML=tempHTML.replace('[交易类型]',tempDict['sale_type']);
- // tempHTML=tempHTML.replace('[项目]',tempDict['project']);
- // tempHTML=tempHTML.replace('[金额]',tempDict['balance']);
- // tempHTML=tempHTML.replace('[交易方式]',tempDict['sale_way']);
- // tempHTML=tempHTML.replace('[生成时间]',tempDict['create_date']);
- // tempHTML=tempHTML.replace('[支付时间]',tempDict['pay_date']);
- // fenHTML+=tempHTML;
- // }
- // $('#fen_shopList').html(fenHTML);
- // //供应商
- // var arr_give_shop=httpData['give_shop'];
- // var tr_give=$('#tr_give').prop('outerHTML');
- // var giveHTML='';
- // for (var i=0;i<arr_give_shop.length;i++) {
- // var tempDict=arr_give_shop[i];
- // var tempHTML=tr_give;
- // tempHTML=tempHTML.replace('[名称]',tempDict['shop_name']);
- // tempHTML=tempHTML.replace('[分销商订单号]',tempDict['order_no']);
- // tempHTML=tempHTML.replace('[交易类型]',tempDict['sale_type']);
- // tempHTML=tempHTML.replace('[项目]',tempDict['project']);
- // tempHTML=tempHTML.replace('[金额]',tempDict['balance']);
- // tempHTML=tempHTML.replace('[交易方式]',tempDict['sale_way']);
- // tempHTML=tempHTML.replace('[生成时间]',tempDict['create_date']);
- // tempHTML=tempHTML.replace('[支付时间]',tempDict['pay_date']);
- // giveHTML+=tempHTML;
- // }
- // $('#give_shopList').html(giveHTML);
-
-
- */
|