|
@@ -239,7 +239,7 @@
|
|
|
<input name="technician_name" style="width: 250px;" id="setTechnician_content"/>
|
|
|
<input name="technician" type="hidden" id="technician_id" value="0" />
|
|
|
<a class='easyui-linkbutton' plain="true" iconCls="icon-add" onclick="add_extra();return false;">添加保洁师</a><br/>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</li>
|
|
|
<li class="f_item">
|
|
@@ -704,12 +704,12 @@
|
|
|
// showType: 'slide'
|
|
|
// });
|
|
|
// }else{
|
|
|
- $('#booking_time_str').val(date.getTime()/1000);
|
|
|
+ $('#booking_time_str').val(date.getTime()/1000);
|
|
|
// }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- $('#booking_time_add').datetimebox({
|
|
|
+ $('#booking_time_add').datetimebox({
|
|
|
required: false,
|
|
|
showSeconds:false,
|
|
|
//buttons:buttons_add,
|
|
@@ -755,10 +755,10 @@
|
|
|
data: {id:rec.value},
|
|
|
dataType: "json",
|
|
|
success: function(data){
|
|
|
- //console.log(data)
|
|
|
+ //console.log(data)
|
|
|
var _html = "";
|
|
|
for (i in data.extra){
|
|
|
- console.log(JSON.stringify(data.extra[i]));
|
|
|
+ console.log(JSON.stringify(data.extra[i]));
|
|
|
_html += '<input type="radio" name="extra" value=\''+JSON.stringify(data.extra[i])+'\' />'+data.extra[i]['type']+'--'+data.extra[i]['price']+'元<br />';
|
|
|
}
|
|
|
|
|
@@ -821,222 +821,222 @@
|
|
|
return type_temp;
|
|
|
})()
|
|
|
});
|
|
|
- var p_width = parseInt(w_width / 2);
|
|
|
- if (p_width < 520){
|
|
|
- p_width = 520;
|
|
|
- }
|
|
|
- var d_width = p_width - 10;
|
|
|
- $('#west_panel').css({width : p_width});
|
|
|
- $('#main').css({width: w_width - 25, height: w_height - 18}).layout();
|
|
|
-
|
|
|
- jq_ss.searchbox({
|
|
|
- width: 130,
|
|
|
- searcher:function(value){
|
|
|
- search_content();
|
|
|
- },
|
|
|
- prompt: '请输入关键字'
|
|
|
- });
|
|
|
+ var p_width = parseInt(w_width / 2);
|
|
|
+ if (p_width < 520){
|
|
|
+ p_width = 520;
|
|
|
+ }
|
|
|
+ var d_width = p_width - 10;
|
|
|
+ $('#west_panel').css({width : p_width});
|
|
|
+ $('#main').css({width: w_width - 25, height: w_height - 18}).layout();
|
|
|
|
|
|
- jq_setStatus.combobox({
|
|
|
- editable: false,
|
|
|
- data: status_data
|
|
|
- });
|
|
|
+ jq_ss.searchbox({
|
|
|
+ width: 130,
|
|
|
+ searcher:function(value){
|
|
|
+ search_content();
|
|
|
+ },
|
|
|
+ prompt: '请输入关键字'
|
|
|
+ });
|
|
|
|
|
|
+ jq_setStatus.combobox({
|
|
|
+ editable: false,
|
|
|
+ data: status_data
|
|
|
+ });
|
|
|
|
|
|
- jq_add_dialog.dialog({
|
|
|
- title: '新建订单',
|
|
|
- width: 500,
|
|
|
- height: 500,
|
|
|
- closed: true,
|
|
|
- modal: true,
|
|
|
- buttons:[{
|
|
|
- text: '确认',
|
|
|
- iconCls: 'icon-ok',
|
|
|
- handler: function(){
|
|
|
- // ------ 数据完整性检查 ------
|
|
|
- var check = checkAddForm();
|
|
|
- if (!check) {
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- $.messager.progress();
|
|
|
- jq_add_form.submit();
|
|
|
+
|
|
|
+ jq_add_dialog.dialog({
|
|
|
+ title: '新建订单',
|
|
|
+ width: 500,
|
|
|
+ height: 500,
|
|
|
+ closed: true,
|
|
|
+ modal: true,
|
|
|
+ buttons:[{
|
|
|
+ text: '确认',
|
|
|
+ iconCls: 'icon-ok',
|
|
|
+ handler: function(){
|
|
|
+ // ------ 数据完整性检查 ------
|
|
|
+ var check = checkAddForm();
|
|
|
+ if (!check) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ $.messager.progress();
|
|
|
+ jq_add_form.submit();
|
|
|
+ }
|
|
|
}
|
|
|
+ },{
|
|
|
+ text: '取消',
|
|
|
+ iconCls: 'icon-cancel',
|
|
|
+ handler: function(){
|
|
|
+ jq_add_dialog.dialog('close');
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ onOpen:function(){
|
|
|
+ jq_add_form.form('clear');
|
|
|
+ jq_add_form.form('load', {});
|
|
|
+ jq_set_precedence.combobox('setValue', 0);
|
|
|
+ $('#extra_items').html('');
|
|
|
+
|
|
|
+ $('#re_address').html('');
|
|
|
}
|
|
|
- },{
|
|
|
- text: '取消',
|
|
|
- iconCls: 'icon-cancel',
|
|
|
- handler: function(){
|
|
|
- jq_add_dialog.dialog('close');
|
|
|
- }
|
|
|
- }],
|
|
|
- onOpen:function(){
|
|
|
- jq_add_form.form('clear');
|
|
|
- jq_add_form.form('load', {});
|
|
|
- jq_set_precedence.combobox('setValue', 0);
|
|
|
- $('#extra_items').html('');
|
|
|
-
|
|
|
- $('#re_address').html('');
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
- jq_dg_content.datagrid({
|
|
|
- url: module_router + '/list',
|
|
|
- title: '订单列表',
|
|
|
- width: d_width,
|
|
|
- height: w_height - 18,
|
|
|
- fitColumns: true,
|
|
|
- autoRowHeight: true,
|
|
|
- striped: true,
|
|
|
- toolbar: '#tb_content',
|
|
|
- singleSelect: true,
|
|
|
- selectOnCheck: false,
|
|
|
- checkOnSelect: false,
|
|
|
- rowStyler: function(index,row){
|
|
|
- if (row.precedence && row.status==1){
|
|
|
- return 'color:red;';
|
|
|
- }else if(row.status==-3){
|
|
|
- return 'color:green;';
|
|
|
- }
|
|
|
- },
|
|
|
- pagination: true,
|
|
|
- pageList: [20, 30, 50],
|
|
|
- pageSize: 20,
|
|
|
- nowrap: false,
|
|
|
- idField: 'id',
|
|
|
- sortName: 'order_time',
|
|
|
- sortOrder: 'desc',
|
|
|
- queryParams: get_param_obj(),
|
|
|
- frozenColumns:[[
|
|
|
- {field:'ck',checkbox:true}
|
|
|
- ]],
|
|
|
- columns:[[
|
|
|
- {field:'id', title:'id', hidden:true},
|
|
|
- {field:'type', title:'服务', width:50,
|
|
|
- formatter: function(value, row){
|
|
|
- return type[value].text;
|
|
|
+ jq_dg_content.datagrid({
|
|
|
+ url: module_router + '/list',
|
|
|
+ title: '订单列表',
|
|
|
+ width: d_width,
|
|
|
+ height: w_height - 18,
|
|
|
+ fitColumns: true,
|
|
|
+ autoRowHeight: true,
|
|
|
+ striped: true,
|
|
|
+ toolbar: '#tb_content',
|
|
|
+ singleSelect: true,
|
|
|
+ selectOnCheck: false,
|
|
|
+ checkOnSelect: false,
|
|
|
+ rowStyler: function(index,row){
|
|
|
+ if (row.precedence && row.status==1){
|
|
|
+ return 'color:red;';
|
|
|
+ }else if(row.status==-3){
|
|
|
+ return 'color:green;';
|
|
|
}
|
|
|
},
|
|
|
- {field:'user', title:'用户', width:50,
|
|
|
- formatter: function(value, row){
|
|
|
- var username = value.user_name;
|
|
|
- if(value.otherPlatform=='1'){
|
|
|
- return username;
|
|
|
- }else{
|
|
|
- return '<a href="javascript:;" onclick="parent.load_url(\'<?php echo Yii::app()->request->baseUrl; ?>/index.php?r=rUser&id='+value.id+'\');">'+ username +'</a>';
|
|
|
+ pagination: true,
|
|
|
+ pageList: [20, 30, 50],
|
|
|
+ pageSize: 20,
|
|
|
+ nowrap: false,
|
|
|
+ idField: 'id',
|
|
|
+ sortName: 'order_time',
|
|
|
+ sortOrder: 'desc',
|
|
|
+ queryParams: get_param_obj(),
|
|
|
+ frozenColumns:[[
|
|
|
+ {field:'ck',checkbox:true}
|
|
|
+ ]],
|
|
|
+ columns:[[
|
|
|
+ {field:'id', title:'id', hidden:true},
|
|
|
+ {field:'type', title:'服务', width:50,
|
|
|
+ formatter: function(value, row){
|
|
|
+ return type[value].text;
|
|
|
}
|
|
|
+ },
|
|
|
+ {field:'user', title:'用户', width:50,
|
|
|
+ formatter: function(value, row){
|
|
|
+ var username = value.user_name;
|
|
|
+ if(value.otherPlatform=='1'){
|
|
|
+ return username;
|
|
|
+ }else{
|
|
|
+ return '<a href="javascript:;" onclick="parent.load_url(\'<?php echo Yii::app()->request->baseUrl; ?>/index.php?r=rUser&id='+value.id+'\');">'+ username +'</a>';
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- },
|
|
|
- {field:'order_time_str', title:'下单时间', width:70,sortable:false
|
|
|
- },
|
|
|
- {field:'order_count', title:'总单', width:30,sortable:false,
|
|
|
- formatter: function(value, row){
|
|
|
- if(value){
|
|
|
- return '<a href="javascript:;" onclick="parent.load_url(\'<?php echo Yii::app()->request->baseUrl; ?>/index.php?r=rOrder&have_pay=1&search='+row.address.mobile+'\');">'+ value +'</a>';
|
|
|
- }else{
|
|
|
- return value;
|
|
|
}
|
|
|
+ },
|
|
|
+ {field:'order_time_str', title:'下单时间', width:70,sortable:false
|
|
|
+ },
|
|
|
+ {field:'order_count', title:'总单', width:30,sortable:false,
|
|
|
+ formatter: function(value, row){
|
|
|
+ if(value){
|
|
|
+ return '<a href="javascript:;" onclick="parent.load_url(\'<?php echo Yii::app()->request->baseUrl; ?>/index.php?r=rOrder&have_pay=1&search='+row.address.mobile+'\');">'+ value +'</a>';
|
|
|
+ }else{
|
|
|
+ return value;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- },
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- {field:'booking_time', title:'预约时间', width:60,sortable:false,formatter: function(value, row){
|
|
|
- var now=new Date(value*1000);
|
|
|
-
|
|
|
- var month=now.getMonth()+1;
|
|
|
- var date=now.getDate();
|
|
|
- var hour = now.getHours();
|
|
|
- return month+"-"+date+" "+hour+":00";
|
|
|
- }},
|
|
|
- {field:'af_sum_price', title:'总额', width:25,sortable:false},
|
|
|
- {field:'sum_price', title:'折后', width:25,sortable:false},
|
|
|
- {field:'status', title:'状态', width:40, sortable: true,
|
|
|
- formatter: function(value, row){
|
|
|
- return get_filed_text(value, status_data);
|
|
|
- }
|
|
|
- },
|
|
|
- {field:'counts', title:'数量', width:20,sortable:false},
|
|
|
- {field:'score', title:'评价',width:20,
|
|
|
- formatter:function(value, row) {
|
|
|
- if (value == 100) {
|
|
|
- return '无';
|
|
|
- } else {
|
|
|
- return '<a href="javascript:;" onclick="parent.load_url(\'<?php echo Yii::app()->request->baseUrl; ?>/index.php?r=comment&id='+row.commentId+'\');">'+ value +'</a>';
|
|
|
+ {field:'booking_time', title:'预约时间', width:60,sortable:false,formatter: function(value, row){
|
|
|
+ var now=new Date(value*1000);
|
|
|
+
|
|
|
+ var month=now.getMonth()+1;
|
|
|
+ var date=now.getDate();
|
|
|
+ var hour = now.getHours();
|
|
|
+ return month+"-"+date+" "+hour+":00";
|
|
|
+ }},
|
|
|
+ {field:'af_sum_price', title:'总额', width:25,sortable:false},
|
|
|
+ {field:'sum_price', title:'折后', width:25,sortable:false},
|
|
|
+ {field:'status', title:'状态', width:40, sortable: true,
|
|
|
+ formatter: function(value, row){
|
|
|
+ return get_filed_text(value, status_data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {field:'counts', title:'数量', width:20,sortable:false},
|
|
|
+ {field:'score', title:'评价',width:20,
|
|
|
+ formatter:function(value, row) {
|
|
|
+ if (value == 100) {
|
|
|
+ return '无';
|
|
|
+ } else {
|
|
|
+ return '<a href="javascript:;" onclick="parent.load_url(\'<?php echo Yii::app()->request->baseUrl; ?>/index.php?r=comment&id='+row.commentId+'\');">'+ value +'</a>';
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- ]],
|
|
|
+ ]],
|
|
|
|
|
|
- onSelect: function(index, row){
|
|
|
- $('#technician_id').val(0);
|
|
|
- $('#setTechnician_content').removeAttr('readonly');
|
|
|
+ onSelect: function(index, row){
|
|
|
+ $('#technician_id').val(0);
|
|
|
+ $('#setTechnician_content').removeAttr('readonly');
|
|
|
|
|
|
- var data = $.extend({}, row);
|
|
|
- jq_content_form.form('load', data);
|
|
|
- jq_resetTec_form.form('clear');
|
|
|
- jq_resetTec_form.form('load', data);
|
|
|
+ var data = $.extend({}, row);
|
|
|
+ jq_content_form.form('load', data);
|
|
|
+ jq_resetTec_form.form('clear');
|
|
|
+ jq_resetTec_form.form('load', data);
|
|
|
|
|
|
- //如果technician_name存在则选择框为readonly
|
|
|
- tec_name = $('#setTechnician_content').val();
|
|
|
- if (tec_name.length > 0) {
|
|
|
- $('#setTechnician_content').attr('readonly', 'true');
|
|
|
- }
|
|
|
+ //如果technician_name存在则选择框为readonly
|
|
|
+ tec_name = $('#setTechnician_content').val();
|
|
|
+ if (tec_name.length > 0) {
|
|
|
+ $('#setTechnician_content').attr('readonly', 'true');
|
|
|
+ }
|
|
|
|
|
|
- // 如果technician_name存在且订单状态为1-4则显示重新分配
|
|
|
- console.log(data.technician_name);
|
|
|
- if (data.technician_name != '' && data.status >= 1 && data.status <= 3) {
|
|
|
- $('#resetTechTip').hide();
|
|
|
- $('#resetTechDiv').show();
|
|
|
- } else {
|
|
|
- $('#resetTechTip').show();
|
|
|
- $('#resetTechDiv').hide();
|
|
|
- }
|
|
|
+ // 如果technician_name存在且订单状态为1-4则显示重新分配
|
|
|
+ console.log(data.technician_name);
|
|
|
+ if (data.technician_name != '' && data.status >= 1 && data.status <= 3) {
|
|
|
+ $('#resetTechTip').hide();
|
|
|
+ $('#resetTechDiv').show();
|
|
|
+ } else {
|
|
|
+ $('#resetTechTip').show();
|
|
|
+ $('#resetTechDiv').hide();
|
|
|
+ }
|
|
|
|
|
|
- $('#admins_edit_info').html('');
|
|
|
- var technicians = data['technicians'];
|
|
|
- var tmp = '';
|
|
|
+ $('#admins_edit_info').html('');
|
|
|
+ var technicians = data['technicians'];
|
|
|
+ var tmp = '';
|
|
|
|
|
|
- for (var j in technicians) {
|
|
|
- tmp +='<div id="extra_add_info_'+technicians[j]['technician_id']+'" style="height:4px">'+technicians[j]['technician_name'];
|
|
|
- /*tmp += '<a href="" onclick="delete_extra('+technicians[j]['technician_id']+');return false;">删除</a></div><br/>';*/
|
|
|
- tmp += '<input type="hidden" id="extra_add_info_hidden_'+technicians[j]['technician_id']+'" name="extra_add_info_'+technicians[j]['technician_id']+'" value='+technicians[j]['technician_name']+'/></div><br/>';
|
|
|
+ for (var j in technicians) {
|
|
|
+ tmp +='<div id="extra_add_info_'+technicians[j]['technician_id']+'" style="height:4px">'+technicians[j]['technician_name'];
|
|
|
+ /*tmp += '<a href="" onclick="delete_extra('+technicians[j]['technician_id']+');return false;">删除</a></div><br/>';*/
|
|
|
+ tmp += '<input type="hidden" id="extra_add_info_hidden_'+technicians[j]['technician_id']+'" name="extra_add_info_'+technicians[j]['technician_id']+'" value='+technicians[j]['technician_name']+'/></div><br/>';
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- var address_contact = '省:'+data['address']['province']+'<br />'+'市:'+data['address']['city']+'<br />'+'区:'+data['address']['area']+'<br />'+'地址:'+data['address']['poi']['name']+' '+data['address']['detail']+'<br />'+'姓名:'+data['address']['name']+'<br />'+'手机号:'+data['address']['mobile']+'<br />'+'<a href="javascript:void();" lat='+data['address']['position'][1]+' lng='+data['address']['position'][0]+' id="view_position">查看坐标</a>';
|
|
|
- $('#address_contact').html(address_contact);
|
|
|
- $('#extra_add_info').html(tmp);
|
|
|
- var products = data['products'];
|
|
|
- var product_info = '';
|
|
|
+ var address_contact = '省:'+data['address']['province']+'<br />'+'市:'+data['address']['city']+'<br />'+'区:'+data['address']['area']+'<br />'+'地址:'+data['address']['poi']['name']+' '+data['address']['detail']+'<br />'+'姓名:'+data['address']['name']+'<br />'+'手机号:'+data['address']['mobile']+'<br />'+'<a href="javascript:void();" lat='+data['address']['position'][1]+' lng='+data['address']['position'][0]+' id="view_position">查看坐标</a>';
|
|
|
+ $('#address_contact').html(address_contact);
|
|
|
+ $('#extra_add_info').html(tmp);
|
|
|
+ var products = data['products'];
|
|
|
+ var product_info = '';
|
|
|
|
|
|
- for(var j in products){
|
|
|
- if(j == products.length-1){
|
|
|
- if(products[j].count>1){
|
|
|
- product_info += products[j]['product'].name+"x"+products[j]['product'].count;
|
|
|
- }else{
|
|
|
- product_info += products[j]['product'].name;
|
|
|
- }
|
|
|
- if(!$.isEmptyObject(products[j]['extra'])){
|
|
|
- product_info += '('+products[j]['extra'].type+'--'+products[j]['extra'].price+')';
|
|
|
- }
|
|
|
+ for(var j in products){
|
|
|
+ if(j == products.length-1){
|
|
|
+ if(products[j].count>1){
|
|
|
+ product_info += products[j]['product'].name+"x"+products[j]['product'].count;
|
|
|
+ }else{
|
|
|
+ product_info += products[j]['product'].name;
|
|
|
+ }
|
|
|
+ if(!$.isEmptyObject(products[j]['extra'])){
|
|
|
+ product_info += '('+products[j]['extra'].type+'--'+products[j]['extra'].price+')';
|
|
|
+ }
|
|
|
|
|
|
- }else{
|
|
|
- if(products[j].count>1) {
|
|
|
- product_info += products[j]['product'].name + "x" + products[j]['product'].count + " + ";
|
|
|
}else{
|
|
|
- product_info += products[j]['product'].name + " + ";
|
|
|
- }
|
|
|
- if(!$.isEmptyObject(products[j].extra)){
|
|
|
- product_info += '('+products[j]['extra'].type+'--'+products[j]['extra'].price+')';
|
|
|
+ if(products[j].count>1) {
|
|
|
+ product_info += products[j]['product'].name + "x" + products[j]['product'].count + " + ";
|
|
|
+ }else{
|
|
|
+ product_info += products[j]['product'].name + " + ";
|
|
|
+ }
|
|
|
+ if(!$.isEmptyObject(products[j].extra)){
|
|
|
+ product_info += '('+products[j]['extra'].type+'--'+products[j]['extra'].price+')';
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
- var coupons = data['coupons'];
|
|
|
- var coupon_info = '';
|
|
|
+ var coupons = data['coupons'];
|
|
|
+ var coupon_info = '';
|
|
|
|
|
|
|
|
|
$('#booking_time').datetimebox('setValue', parse_time(data,'booking_time'));
|
|
@@ -1060,501 +1060,501 @@
|
|
|
});return false;
|
|
|
});
|
|
|
|
|
|
- for(var j in coupons){
|
|
|
- console.log(coupons[j]['coupon']);
|
|
|
- var value = coupons[j]['coupon']['name']+'(满'+coupons[j]['coupon']['min_price']+'免'+coupons[j]['coupon']['value']+')'+'('+coupons[j]['coupon']['alias_name']+')';
|
|
|
+ for(var j in coupons){
|
|
|
+ console.log(coupons[j]['coupon']);
|
|
|
+ var value = coupons[j]['coupon']['name']+'(满'+coupons[j]['coupon']['min_price']+'免'+coupons[j]['coupon']['value']+')'+'('+coupons[j]['coupon']['alias_name']+')';
|
|
|
|
|
|
- if(j == coupons.length-1){
|
|
|
- coupon_info += value;
|
|
|
- }else{
|
|
|
- coupon_info += value+'+';
|
|
|
+ if(j == coupons.length-1){
|
|
|
+ coupon_info += value;
|
|
|
+ }else{
|
|
|
+ coupon_info += value+'+';
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- $('#booking_time').datetimebox('setValue', parse_time(data,'booking_time'));
|
|
|
- $('#deal_time').datetimebox('setValue', parse_time(data,'deal_time'));
|
|
|
- $('#product_info').html(product_info);
|
|
|
- $('#coupon_info').html(coupon_info);
|
|
|
-
|
|
|
- $('#view_position').on('click',function(){
|
|
|
- console.log($(this).attr('lat'));
|
|
|
- $.fn.position_selector('init',{
|
|
|
- width:$(window).width()-300,//弹框显示宽度
|
|
|
- height:$(window).height()-100,//弹框显示高度
|
|
|
- zoom:18, //缩放级别
|
|
|
- locat:'上海',//默认城市
|
|
|
- can_edit:true,
|
|
|
- lat:$(this).attr('lat'),
|
|
|
- lng:$(this).attr('lng'),
|
|
|
- func:function(){return false;},//选择成功之后的回调函数
|
|
|
- element_id:'map_container'//弹窗ID
|
|
|
- });return false;
|
|
|
- });
|
|
|
+ $('#booking_time').datetimebox('setValue', parse_time(data,'booking_time'));
|
|
|
+ $('#deal_time').datetimebox('setValue', parse_time(data,'deal_time'));
|
|
|
+ $('#product_info').html(product_info);
|
|
|
+ $('#coupon_info').html(coupon_info);
|
|
|
+
|
|
|
+ $('#view_position').on('click',function(){
|
|
|
+ console.log($(this).attr('lat'));
|
|
|
+ $.fn.position_selector('init',{
|
|
|
+ width:$(window).width()-300,//弹框显示宽度
|
|
|
+ height:$(window).height()-100,//弹框显示高度
|
|
|
+ zoom:18, //缩放级别
|
|
|
+ locat:'上海',//默认城市
|
|
|
+ can_edit:true,
|
|
|
+ lat:$(this).attr('lat'),
|
|
|
+ lng:$(this).attr('lng'),
|
|
|
+ func:function(){return false;},//选择成功之后的回调函数
|
|
|
+ element_id:'map_container'//弹窗ID
|
|
|
+ });return false;
|
|
|
+ });
|
|
|
+
|
|
|
+ if (data['action_user'] != ''){
|
|
|
+ jq_action_info.html('信息已被编辑: ' + data['action_user'] + ' ' + data['action_time']);
|
|
|
+ } else {
|
|
|
+ jq_action_info.html('');
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#on_loading").show();
|
|
|
+ $('#pay_channel').html(data.pay_channel);
|
|
|
+ $('#counts').html(data.counts);
|
|
|
+ $('#charge_id').html(data.charge_id);
|
|
|
+ $('#memo').html(data.memo);
|
|
|
+ $('#id_str').html(data.id);
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
- if (data['action_user'] != ''){
|
|
|
- jq_action_info.html('信息已被编辑: ' + data['action_user'] + ' ' + data['action_time']);
|
|
|
- } else {
|
|
|
+ onLoadSuccess: function(){
|
|
|
+ $('#resetTechTip').hide();
|
|
|
+ $('#resetTechDiv').hide();
|
|
|
+ $('#setTechnician_content').removeAttr('readonly');
|
|
|
+ $(this).datagrid('clearChecked');
|
|
|
+ $('#address_contact').html('');
|
|
|
+ $('#product_info').html('');
|
|
|
+ $('#coupon_info').html('');
|
|
|
+ jq_content_form.form('clear');
|
|
|
+ jq_resetTec_form.form('clear');
|
|
|
+ $('#id_str').html('');
|
|
|
+ $('#counts').html('');
|
|
|
+ $('#booking_time_str').val('');
|
|
|
+ $('#deal_time_str').val('');
|
|
|
jq_action_info.html('');
|
|
|
+ jq_dg_content.datagrid('clearSelections');
|
|
|
+ jq_setStatus.combobox('setValue', 100);
|
|
|
}
|
|
|
+ });
|
|
|
|
|
|
- $("#on_loading").show();
|
|
|
- $('#pay_channel').html(data.pay_channel);
|
|
|
- $('#counts').html(data.counts);
|
|
|
- $('#charge_id').html(data.charge_id);
|
|
|
- $('#memo').html(data.memo);
|
|
|
- $('#id_str').html(data.id);
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- onLoadSuccess: function(){
|
|
|
- $('#resetTechTip').hide();
|
|
|
- $('#resetTechDiv').hide();
|
|
|
- $('#setTechnician_content').removeAttr('readonly');
|
|
|
- $(this).datagrid('clearChecked');
|
|
|
- $('#address_contact').html('');
|
|
|
- $('#product_info').html('');
|
|
|
- $('#coupon_info').html('');
|
|
|
- jq_content_form.form('clear');
|
|
|
- jq_resetTec_form.form('clear');
|
|
|
- $('#id_str').html('');
|
|
|
- $('#counts').html('');
|
|
|
- $('#booking_time_str').val('');
|
|
|
- $('#deal_time_str').val('');
|
|
|
- jq_action_info.html('');
|
|
|
- jq_dg_content.datagrid('clearSelections');
|
|
|
- jq_setStatus.combobox('setValue', 100);
|
|
|
- }
|
|
|
- });
|
|
|
+ jq_ss.searchbox({
|
|
|
+ width: 140,
|
|
|
+ searcher:function(value){
|
|
|
+ search_content();
|
|
|
+ },
|
|
|
+ prompt: '请输入关键字'
|
|
|
+ });
|
|
|
|
|
|
- jq_ss.searchbox({
|
|
|
- width: 140,
|
|
|
- searcher:function(value){
|
|
|
- search_content();
|
|
|
- },
|
|
|
- prompt: '请输入关键字'
|
|
|
- });
|
|
|
+ jq_filter_status.combobox({
|
|
|
+ width: 100,
|
|
|
+ data: status_data,
|
|
|
+ editable: false,
|
|
|
+ onSelect: function(){
|
|
|
+ search_content();
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- jq_filter_status.combobox({
|
|
|
- width: 100,
|
|
|
- data: status_data,
|
|
|
- editable: false,
|
|
|
- onSelect: function(){
|
|
|
- search_content();
|
|
|
- }
|
|
|
- });
|
|
|
+ jq_filter_channel.combobox({
|
|
|
+ width: 100,
|
|
|
+ data: channel_data,
|
|
|
+ editable: false,
|
|
|
+ onSelect: function(){
|
|
|
+ search_content();
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- jq_filter_channel.combobox({
|
|
|
- width: 100,
|
|
|
- data: channel_data,
|
|
|
- editable: false,
|
|
|
- onSelect: function(){
|
|
|
- search_content();
|
|
|
- }
|
|
|
- });
|
|
|
+ jq_filter_station.combobox({
|
|
|
+ width: 100,
|
|
|
+ data: station_data,
|
|
|
+ editable: false,
|
|
|
+ onSelect: function () {
|
|
|
+ search_content();
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- jq_filter_station.combobox({
|
|
|
- width: 100,
|
|
|
- data: station_data,
|
|
|
- editable: false,
|
|
|
- onSelect: function () {
|
|
|
- search_content();
|
|
|
- }
|
|
|
- });
|
|
|
+ // ------ content form ------
|
|
|
+ $('#setStation_content').combobox({
|
|
|
+ width: 250,
|
|
|
+ data: (function(){
|
|
|
+ var station_data_temp = new Array();
|
|
|
+ $.extend(station_data_temp, station_data);
|
|
|
+ station_data_temp.shift();
|
|
|
|
|
|
- // ------ content form ------
|
|
|
- $('#setStation_content').combobox({
|
|
|
- width: 250,
|
|
|
- data: (function(){
|
|
|
- var station_data_temp = new Array();
|
|
|
- $.extend(station_data_temp, station_data);
|
|
|
- station_data_temp.shift();
|
|
|
-
|
|
|
- return station_data_temp;
|
|
|
- })(),
|
|
|
- editable: false
|
|
|
- });
|
|
|
+ return station_data_temp;
|
|
|
+ })(),
|
|
|
+ editable: false
|
|
|
+ });
|
|
|
|
|
|
- jq_content_form.form({
|
|
|
- url: module_router + '/edit',
|
|
|
- onSubmit: function(param){
|
|
|
- if ($('#order_id').val() == ""){
|
|
|
- return false;
|
|
|
- }
|
|
|
- var isValid = $(this).form('validate');
|
|
|
- if (!isValid){
|
|
|
+ jq_content_form.form({
|
|
|
+ url: module_router + '/edit',
|
|
|
+ onSubmit: function(param){
|
|
|
+ if ($('#order_id').val() == ""){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var isValid = $(this).form('validate');
|
|
|
+ if (!isValid){
|
|
|
+ $.messager.progress('close');
|
|
|
+ }
|
|
|
+ return isValid;
|
|
|
+ },
|
|
|
+ success: function(res){
|
|
|
$.messager.progress('close');
|
|
|
+ var res = JSON.parse(res);
|
|
|
+
|
|
|
+ if (res.success){
|
|
|
+ jq_dg_content.datagrid('reload');
|
|
|
+ }
|
|
|
+ if(res.success){
|
|
|
+ $.messager.show({
|
|
|
+ title: '提示',
|
|
|
+ msg: '保存成功',
|
|
|
+ timeout: 3500,
|
|
|
+ showType: 'slide'
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#technician_id').val(0);
|
|
|
+ }else{
|
|
|
+ $.messager.show({
|
|
|
+ title: '提示',
|
|
|
+ msg: res.message,
|
|
|
+ timeout: 3500,
|
|
|
+ showType: 'slide'
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- return isValid;
|
|
|
- },
|
|
|
- success: function(res){
|
|
|
- $.messager.progress('close');
|
|
|
- var res = JSON.parse(res);
|
|
|
-
|
|
|
- if (res.success){
|
|
|
- jq_dg_content.datagrid('reload');
|
|
|
- }
|
|
|
- if(res.success){
|
|
|
- $.messager.show({
|
|
|
- title: '提示',
|
|
|
- msg: '保存成功',
|
|
|
- timeout: 3500,
|
|
|
- showType: 'slide'
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
- $('#technician_id').val(0);
|
|
|
- }else{
|
|
|
- $.messager.show({
|
|
|
- title: '提示',
|
|
|
- msg: res.message,
|
|
|
- timeout: 3500,
|
|
|
- showType: 'slide'
|
|
|
- });
|
|
|
+ jq_add_form.form({
|
|
|
+ url : module_router + '/add',
|
|
|
+ onSubmit : function (param) {
|
|
|
+ var isValid = $(this).form('validate');
|
|
|
+ if (!isValid){
|
|
|
+ $.messager.progress('close');
|
|
|
+ }
|
|
|
+ return isValid;
|
|
|
+ },
|
|
|
+ success : function (res) {
|
|
|
+ $.messager.progress('close');
|
|
|
+ var res = JSON.parse(res);
|
|
|
+
|
|
|
+ if (res.success) {
|
|
|
+ $.messager.show({
|
|
|
+ title : '提示',
|
|
|
+ msg : '保存成功',
|
|
|
+ timeout : 3500,
|
|
|
+ showType : 'slide'
|
|
|
+ });
|
|
|
+ jq_add_dialog.dialog('close');
|
|
|
+ jq_dg_content.datagrid('reload');
|
|
|
+ } else {
|
|
|
+ $.messager.show({
|
|
|
+ title : '提示',
|
|
|
+ msg : res.message,
|
|
|
+ timeout : 3500,
|
|
|
+ showType : 'slide'
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
- jq_add_form.form({
|
|
|
- url : module_router + '/add',
|
|
|
- onSubmit : function (param) {
|
|
|
- var isValid = $(this).form('validate');
|
|
|
- if (!isValid){
|
|
|
+ jq_resetTec_form.form({
|
|
|
+ url: module_router + '/resetTech',
|
|
|
+ onSubmit: function(param) {
|
|
|
+ var isValid = $(this).form('validate');
|
|
|
+ if (!isValid){
|
|
|
+ $.messager.progress('close');
|
|
|
+ }
|
|
|
+ return isValid;
|
|
|
+ },
|
|
|
+ success: function(res) {
|
|
|
$.messager.progress('close');
|
|
|
+ var res = JSON.parse(res);
|
|
|
+
|
|
|
+ if (res.success) {
|
|
|
+ $.messager.show({
|
|
|
+ title : '提示',
|
|
|
+ msg : '保存成功',
|
|
|
+ timeout : 3500,
|
|
|
+ showType : 'slide'
|
|
|
+ });
|
|
|
+ jq_dg_content.datagrid('reload');
|
|
|
+ } else {
|
|
|
+ $.messager.show({
|
|
|
+ title : '提示',
|
|
|
+ msg : res.message,
|
|
|
+ timeout : 3500,
|
|
|
+ showType : 'slide'
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- return isValid;
|
|
|
- },
|
|
|
- success : function (res) {
|
|
|
- $.messager.progress('close');
|
|
|
- var res = JSON.parse(res);
|
|
|
-
|
|
|
- if (res.success) {
|
|
|
- $.messager.show({
|
|
|
- title : '提示',
|
|
|
- msg : '保存成功',
|
|
|
- timeout : 3500,
|
|
|
- showType : 'slide'
|
|
|
- });
|
|
|
- jq_add_dialog.dialog('close');
|
|
|
- jq_dg_content.datagrid('reload');
|
|
|
- } else {
|
|
|
- $.messager.show({
|
|
|
- title : '提示',
|
|
|
- msg : res.message,
|
|
|
- timeout : 3500,
|
|
|
- showType : 'slide'
|
|
|
- });
|
|
|
+ });
|
|
|
+
|
|
|
+ // 自动填充
|
|
|
+ var setTechnician_content = $('#setTechnician_content');
|
|
|
+ setTechnician_content.coolautosuggest({
|
|
|
+ url: 'index.php?r=o2o/tech/selectTech&tech=',
|
|
|
+ showDescription: true,
|
|
|
+ onSelected:function(result){
|
|
|
+ $('#technician_id').val(result.tech_id);
|
|
|
+ // console.log(result);
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
- jq_resetTec_form.form({
|
|
|
- url: module_router + '/resetTech',
|
|
|
- onSubmit: function(param) {
|
|
|
- var isValid = $(this).form('validate');
|
|
|
- if (!isValid){
|
|
|
- $.messager.progress('close');
|
|
|
+ var reset_tech_selector = $('#resetTecName');
|
|
|
+ reset_tech_selector.coolautosuggest({
|
|
|
+ url: '/index.php?r=o2o/tech/selectTech&tech=',
|
|
|
+ showDescription: true,
|
|
|
+ onSelected:function(result){
|
|
|
+ $('#resetTec').val(result.tech_id);
|
|
|
}
|
|
|
- return isValid;
|
|
|
- },
|
|
|
- success: function(res) {
|
|
|
- $.messager.progress('close');
|
|
|
- var res = JSON.parse(res);
|
|
|
-
|
|
|
- if (res.success) {
|
|
|
- $.messager.show({
|
|
|
- title : '提示',
|
|
|
- msg : '保存成功',
|
|
|
- timeout : 3500,
|
|
|
- showType : 'slide'
|
|
|
- });
|
|
|
- jq_dg_content.datagrid('reload');
|
|
|
- } else {
|
|
|
- $.messager.show({
|
|
|
- title : '提示',
|
|
|
- msg : res.message,
|
|
|
- timeout : 3500,
|
|
|
- showType : 'slide'
|
|
|
- });
|
|
|
+ });
|
|
|
+
|
|
|
+ /* 每5分钟请求一次接口获取申请退款订单 */
|
|
|
+ jq_refund_tip_dialog.dialog({
|
|
|
+ title: '提示',
|
|
|
+ width: 300,
|
|
|
+ height: 150,
|
|
|
+ closed: true,
|
|
|
+ modal: true,
|
|
|
+ buttons:[{
|
|
|
+ text: '处理退款订单',
|
|
|
+ iconCls: 'icon-ok',
|
|
|
+ handler: function(){
|
|
|
+ url = '<?php echo Yii::app()->request->baseUrl; ?>/index.php?r=rOrder&status=-3';
|
|
|
+ parent.load_url(url);
|
|
|
+ jq_refund_tip_dialog.dialog('close');
|
|
|
+ }
|
|
|
+ },{
|
|
|
+ text: '取消',
|
|
|
+ iconCls: 'icon-cancel',
|
|
|
+ handler: function(){
|
|
|
+ jq_refund_tip_dialog.dialog('close');
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ onOpen:function(){
|
|
|
+
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
- // 自动填充
|
|
|
- var setTechnician_content = $('#setTechnician_content');
|
|
|
- setTechnician_content.coolautosuggest({
|
|
|
- url: 'index.php?r=o2o/tech/selectTech&tech=',
|
|
|
- showDescription: true,
|
|
|
- onSelected:function(result){
|
|
|
- $('#technician_id').val(result.tech_id);
|
|
|
- // console.log(result);
|
|
|
+ function checkRefundOrder() {
|
|
|
+ $.post(
|
|
|
+ module_router + '/checkRefundOrder',
|
|
|
+ {},
|
|
|
+ function(res) {
|
|
|
+ res = $.parseJSON(res);
|
|
|
+ if(res.code == 2){
|
|
|
+ // $content = '<a href="javascript:;" onclick="process_append_order(\''+res.procession_append_order_id+'\');">待处理追加订单</a>';
|
|
|
+ console.log(res);
|
|
|
+ $.messager.defaults.ok = '去处理';
|
|
|
+ $.messager.defaults.cancel = '取消';
|
|
|
+ $.messager.confirm('提示','有追加订单待处理',function(r){
|
|
|
+ if (r){
|
|
|
+ process_append_order(res.procession_append_order_id);
|
|
|
+ }else{
|
|
|
+ cancel_process_append_order(res.procession_append_order_id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else if (res.code == 1) {
|
|
|
+ $content = '共有<span style="color:red">'+res.count+'</span>个<span style="color: green;">申请退款</span>的订单未处理';
|
|
|
+ $('#refund_tip').html($content);
|
|
|
+ jq_refund_tip_dialog.dialog('open');
|
|
|
+ }else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
- });
|
|
|
|
|
|
- var reset_tech_selector = $('#resetTecName');
|
|
|
- reset_tech_selector.coolautosuggest({
|
|
|
- url: '/index.php?r=o2o/tech/selectTech&tech=',
|
|
|
- showDescription: true,
|
|
|
- onSelected:function(result){
|
|
|
- $('#resetTec').val(result.tech_id);
|
|
|
- }
|
|
|
+ checkRefundOrder();
|
|
|
+ setInterval(checkRefundOrder, 600000);
|
|
|
});
|
|
|
|
|
|
- /* 每5分钟请求一次接口获取申请退款订单 */
|
|
|
- jq_refund_tip_dialog.dialog({
|
|
|
- title: '提示',
|
|
|
- width: 300,
|
|
|
- height: 150,
|
|
|
- closed: true,
|
|
|
- modal: true,
|
|
|
- buttons:[{
|
|
|
- text: '处理退款订单',
|
|
|
- iconCls: 'icon-ok',
|
|
|
- handler: function(){
|
|
|
- url = '<?php echo Yii::app()->request->baseUrl; ?>/index.php?r=rOrder&status=-3';
|
|
|
- parent.load_url(url);
|
|
|
- jq_refund_tip_dialog.dialog('close');
|
|
|
- }
|
|
|
- },{
|
|
|
- text: '取消',
|
|
|
- iconCls: 'icon-cancel',
|
|
|
- handler: function(){
|
|
|
- jq_refund_tip_dialog.dialog('close');
|
|
|
+ function search_content(){
|
|
|
+ var filter_status = jq_filter_status.combobox('getValue');
|
|
|
+ var filter_channel = jq_filter_channel.combobox('getValue');
|
|
|
+ var date_start_order = jq_date_start_order.datebox('getValue');
|
|
|
+ var date_end_order = jq_date_end_order.datebox('getValue');
|
|
|
+ var date_start_book = jq_date_start_book.datebox('getValue');
|
|
|
+ var date_end_book = jq_date_end_book.datebox('getValue');
|
|
|
+ // var station = jq_filter_station.combobox('getValue');
|
|
|
+ var type = jq_filter_type.combobox('getValue');
|
|
|
+
|
|
|
+ var search = jq_ss.searchbox('getValue');
|
|
|
+ jq_dg_content.datagrid({
|
|
|
+ pageNum: 1,
|
|
|
+ queryParams: {
|
|
|
+ search : search,
|
|
|
+ status : filter_status,
|
|
|
+ channel : filter_channel,
|
|
|
+ date_start_order : date_start_order,
|
|
|
+ date_end_order : date_end_order,
|
|
|
+ date_start_book : date_start_book,
|
|
|
+ date_end_book : date_end_book,
|
|
|
+ // station : station,
|
|
|
+ type : type
|
|
|
}
|
|
|
- }],
|
|
|
- onOpen:function(){
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
+ function save_content(){
|
|
|
+ if ($('#order_id').val() == ""){
|
|
|
+ return false;
|
|
|
}
|
|
|
- });
|
|
|
|
|
|
- function checkRefundOrder() {
|
|
|
- $.post(
|
|
|
- module_router + '/checkRefundOrder',
|
|
|
- {},
|
|
|
- function(res) {
|
|
|
- res = $.parseJSON(res);
|
|
|
- if(res.code == 2){
|
|
|
- // $content = '<a href="javascript:;" onclick="process_append_order(\''+res.procession_append_order_id+'\');">待处理追加订单</a>';
|
|
|
- console.log(res);
|
|
|
- $.messager.defaults.ok = '去处理';
|
|
|
- $.messager.defaults.cancel = '取消';
|
|
|
- $.messager.confirm('提示','有追加订单待处理',function(r){
|
|
|
- if (r){
|
|
|
- process_append_order(res.procession_append_order_id);
|
|
|
- }else{
|
|
|
- cancel_process_append_order(res.procession_append_order_id);
|
|
|
- }
|
|
|
- });
|
|
|
- }else if (res.code == 1) {
|
|
|
- $content = '共有<span style="color:red">'+res.count+'</span>个<span style="color: green;">申请退款</span>的订单未处理';
|
|
|
- $('#refund_tip').html($content);
|
|
|
- jq_refund_tip_dialog.dialog('open');
|
|
|
- }else {
|
|
|
- return false;
|
|
|
- }
|
|
|
+ if (jq_setStatus.combobox('getValue') <0 ){
|
|
|
+ $.messager.confirm('注意', '确认 取消/退款 该订单吗?', function(r){
|
|
|
+ $.messager.progress();
|
|
|
+ jq_content_form.submit();
|
|
|
+ });
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (jq_setStatus.combobox('getValue') == 6) {
|
|
|
+ tec_name = $('#setTechnician_content').val();
|
|
|
+ tec_id = $('#technician_id').val();
|
|
|
+ if (tec_name.length == 0 && tec_id.length == 0) {
|
|
|
+ $.messager.alert('提示', '完成订单前请指定保洁师');
|
|
|
+ return false;
|
|
|
}
|
|
|
- );
|
|
|
+ }
|
|
|
+
|
|
|
+ $.messager.progress();
|
|
|
+ jq_content_form.submit();
|
|
|
}
|
|
|
|
|
|
- checkRefundOrder();
|
|
|
- setInterval(checkRefundOrder, 600000);
|
|
|
-});
|
|
|
-
|
|
|
-function search_content(){
|
|
|
- var filter_status = jq_filter_status.combobox('getValue');
|
|
|
- var filter_channel = jq_filter_channel.combobox('getValue');
|
|
|
- var date_start_order = jq_date_start_order.datebox('getValue');
|
|
|
- var date_end_order = jq_date_end_order.datebox('getValue');
|
|
|
- var date_start_book = jq_date_start_book.datebox('getValue');
|
|
|
- var date_end_book = jq_date_end_book.datebox('getValue');
|
|
|
- // var station = jq_filter_station.combobox('getValue');
|
|
|
- var type = jq_filter_type.combobox('getValue');
|
|
|
-
|
|
|
- var search = jq_ss.searchbox('getValue');
|
|
|
- jq_dg_content.datagrid({
|
|
|
- pageNum: 1,
|
|
|
- queryParams: {
|
|
|
- search : search,
|
|
|
- status : filter_status,
|
|
|
- channel : filter_channel,
|
|
|
- date_start_order : date_start_order,
|
|
|
- date_end_order : date_end_order,
|
|
|
- date_start_book : date_start_book,
|
|
|
- date_end_book : date_end_book,
|
|
|
- // station : station,
|
|
|
- type : type
|
|
|
+ function parse_time(data,attr){
|
|
|
+ if(data[attr]){
|
|
|
+ var d=new Date(data[attr]*1000);
|
|
|
+ return formatDate(d);
|
|
|
+ }else{
|
|
|
+ return '';
|
|
|
}
|
|
|
- });
|
|
|
-};
|
|
|
+ }
|
|
|
|
|
|
-function save_content(){
|
|
|
- if ($('#order_id').val() == ""){
|
|
|
- return false;
|
|
|
+ function formatDate(now){
|
|
|
+ var year=now.getFullYear();
|
|
|
+ var month=now.getMonth()+1;
|
|
|
+ var date=now.getDate();
|
|
|
+ var hour = now.getHours();
|
|
|
+ var minute = now.getMinutes();
|
|
|
+ return year+"-"+month+"-"+date+" "+hour+":"+minute;
|
|
|
}
|
|
|
|
|
|
- if (jq_setStatus.combobox('getValue') <0 ){
|
|
|
- $.messager.confirm('注意', '确认 取消/退款 该订单吗?', function(r){
|
|
|
- $.messager.progress();
|
|
|
- jq_content_form.submit();
|
|
|
- });
|
|
|
- return true;
|
|
|
+ function add_content(){
|
|
|
+ jq_add_dialog.dialog('open');
|
|
|
}
|
|
|
|
|
|
- if (jq_setStatus.combobox('getValue') == 6) {
|
|
|
- tec_name = $('#setTechnician_content').val();
|
|
|
- tec_id = $('#technician_id').val();
|
|
|
- if (tec_name.length == 0 && tec_id.length == 0) {
|
|
|
- $.messager.alert('提示', '完成订单前请指定保洁师');
|
|
|
+ function reset_technician() {
|
|
|
+ var id = jq_resetTec_form.find('input[name="id"]').val();
|
|
|
+ if (id.length == 0) {
|
|
|
+ $.messager.alert('提示', '请先选择一个订单');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var name = jq_resetTec_form.find("input[id='reset_add']").val();
|
|
|
+ var add = jq_resetTec_form.find('input[name="reset_technician_name"]').val();
|
|
|
+ if (name == undefined) {
|
|
|
+ $.messager.alert('提示', '请先选择一名保洁师');
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ if (add.length != 0) {
|
|
|
+ $.messager.alert('提示', '请点击添加保洁师');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $.messager.progress();
|
|
|
+ jq_resetTec_form.form('submit');
|
|
|
+ $('#reset_extra_add_info').empty();
|
|
|
}
|
|
|
|
|
|
- $.messager.progress();
|
|
|
- jq_content_form.submit();
|
|
|
-}
|
|
|
+ function checkAddForm () {
|
|
|
+ // 正则检查
|
|
|
+ // 手机号检查
|
|
|
+ var mobile_regex = new RegExp(/^\d{8,11}$/);
|
|
|
+ var mobile_text = $('#mobile_add').val();
|
|
|
+ if (!mobile_regex.test(mobile_text)) {
|
|
|
+ $.messager.alert('提示', '手机号输入非法(如存在空格等)噢', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
-function parse_time(data,attr){
|
|
|
- if(data[attr]){
|
|
|
- var d=new Date(data[attr]*1000);
|
|
|
- return formatDate(d);
|
|
|
- }else{
|
|
|
- return '';
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-function formatDate(now){
|
|
|
- var year=now.getFullYear();
|
|
|
- var month=now.getMonth()+1;
|
|
|
- var date=now.getDate();
|
|
|
- var hour = now.getHours();
|
|
|
- var minute = now.getMinutes();
|
|
|
- return year+"-"+month+"-"+date+" "+hour+":"+minute;
|
|
|
-}
|
|
|
-
|
|
|
-function add_content(){
|
|
|
- jq_add_dialog.dialog('open');
|
|
|
-}
|
|
|
-
|
|
|
-function reset_technician() {
|
|
|
- var id = jq_resetTec_form.find('input[name="id"]').val();
|
|
|
- if (id.length == 0) {
|
|
|
- $.messager.alert('提示', '请先选择一个订单');
|
|
|
- return false;
|
|
|
- }
|
|
|
- var name = jq_resetTec_form.find("input[id='reset_add']").val();
|
|
|
- var add = jq_resetTec_form.find('input[name="reset_technician_name"]').val();
|
|
|
- if (name == undefined) {
|
|
|
- $.messager.alert('提示', '请先选择一名保洁师');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ // 空数据检查
|
|
|
+ if ($('#mobile_add').val() == '') {
|
|
|
+ $.messager.alert('提示', '请填写手机号', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($('#name_add').val() == '') {
|
|
|
+ $.messager.alert('提示', '请填写姓名', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($('#view_latitude').val() == '' || $('#view_longitude').val() == '') {
|
|
|
+ $.messager.alert('提示', '请选择坐标', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($('#detail_add').val() == '') {
|
|
|
+ $.messager.alert('提示', '请填写详细地址', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- if (add.length != 0) {
|
|
|
- $.messager.alert('提示', '请点击添加保洁师');
|
|
|
- return false;
|
|
|
- }
|
|
|
- $.messager.progress();
|
|
|
- jq_resetTec_form.form('submit');
|
|
|
- $('#reset_extra_add_info').empty();
|
|
|
-}
|
|
|
-
|
|
|
-function checkAddForm () {
|
|
|
- // 正则检查
|
|
|
- // 手机号检查
|
|
|
- var mobile_regex = new RegExp(/^\d{8,11}$/);
|
|
|
- var mobile_text = $('#mobile_add').val();
|
|
|
- if (!mobile_regex.test(mobile_text)) {
|
|
|
- $.messager.alert('提示', '手机号输入非法(如存在空格等)噢', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ if ($('#set_type').combobox('getValue') == '') {
|
|
|
+ $.messager.alert('提示', '请选择订单类型', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($('#setChannels_add').combobox('getValue') == '') {
|
|
|
+ $.messager.alert('提示', '请选择订单来源', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($('#order_time_add').datebox('getValue') == '') {
|
|
|
+ $.messager.alert('提示', '请选择订单时间', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($('#booking_time_add').datebox('getValue') == '') {
|
|
|
+ $.messager.alert('提示', '请选择预约时间', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($('#price_add').val() == '') {
|
|
|
+ $.messager.alert('提示', '请填写订单金额', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($('#final_price_add').val() == '') {
|
|
|
+ $.messager.alert('提示', '请填写折扣后金额', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($('#setStatus_add').combobox('getValue') == '') {
|
|
|
+ $.messager.alert('提示', '请选择订单状态', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- // 空数据检查
|
|
|
- if ($('#mobile_add').val() == '') {
|
|
|
- $.messager.alert('提示', '请填写手机号', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($('#name_add').val() == '') {
|
|
|
- $.messager.alert('提示', '请填写姓名', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($('#view_latitude').val() == '' || $('#view_longitude').val() == '') {
|
|
|
- $.messager.alert('提示', '请选择坐标', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($('#detail_add').val() == '') {
|
|
|
- $.messager.alert('提示', '请填写详细地址', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ if($('#extra_items').html().length && !$("input[name='extra']:checked").val()){
|
|
|
+ $.messager.alert('提示', '服务详情没有选择', 'warning');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- if ($('#set_type').combobox('getValue') == '') {
|
|
|
- $.messager.alert('提示', '请选择订单类型', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($('#setChannels_add').combobox('getValue') == '') {
|
|
|
- $.messager.alert('提示', '请选择订单来源', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($('#order_time_add').datebox('getValue') == '') {
|
|
|
- $.messager.alert('提示', '请选择订单时间', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($('#booking_time_add').datebox('getValue') == '') {
|
|
|
- $.messager.alert('提示', '请选择预约时间', 'warning');
|
|
|
- return false;
|
|
|
+
|
|
|
+
|
|
|
+ return true;
|
|
|
}
|
|
|
- if ($('#price_add').val() == '') {
|
|
|
- $.messager.alert('提示', '请填写订单金额', 'warning');
|
|
|
- return false;
|
|
|
+ function delete_extra(msg){
|
|
|
+ $('#extra_add_info_'+msg).remove();
|
|
|
+ $('#extra_add_info_hidden_'+msg).remove();
|
|
|
}
|
|
|
- if ($('#final_price_add').val() == '') {
|
|
|
- $.messager.alert('提示', '请填写折扣后金额', 'warning');
|
|
|
- return false;
|
|
|
+ function add_extra(){
|
|
|
+ if ($('#setTechnician_content').val()){
|
|
|
+ setTechnician_content = $('#setTechnician_content').val();
|
|
|
+ setTechnician_id = $('#technician_id').val();
|
|
|
+ $output = "<div id='extra_add_info_"+setTechnician_id+"' style='height: 4px'>"+setTechnician_content;
|
|
|
+ $output +="<a href ='' onclick='delete_extra("+setTechnician_id+");return false;'>删除</a></div><br/>";
|
|
|
+ $output +="<input type='hidden' id='extra_add_info_hidden_"+setTechnician_id+"' name='extra_add_info_"+setTechnician_id+"' value='"+setTechnician_content+"' /></div>";
|
|
|
+ $('#setTechnician_content').val('');
|
|
|
+ $("#extra_add_info").append($output);
|
|
|
+ }
|
|
|
}
|
|
|
- if ($('#setStatus_add').combobox('getValue') == '') {
|
|
|
- $.messager.alert('提示', '请选择订单状态', 'warning');
|
|
|
- return false;
|
|
|
+ function reset_delete_extra(msg){
|
|
|
+ $('#reset_extra_add_info_'+msg).remove();
|
|
|
+ $('#reset_extra_add_info_hidden_'+msg).remove();
|
|
|
+ $('#reset_add').remove();
|
|
|
}
|
|
|
+ function reset_add_extra(){
|
|
|
+ if ($('#resetTec').val()) {
|
|
|
|
|
|
- if($('#extra_items').html().length && !$("input[name='extra']:checked").val()){
|
|
|
- $.messager.alert('提示', '服务详情没有选择', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
|
|
|
+ resetTec = $('#resetTec').val();
|
|
|
+ resetTecName = $('#resetTecName').val();
|
|
|
|
|
|
+ $output = "<div id='reset_extra_add_info_"+resetTec+"' style='height: 4px'>"+resetTecName;
|
|
|
+ $output +="<a href ='' onclick='reset_delete_extra("+resetTec+");return false;'>删除</a></div><br/>";
|
|
|
+ $output +="<input type='hidden' id='reset_extra_add_info_hidden_"+resetTec+"' name='reset_extra_add_info_"+resetTec+"' value='"+resetTecName+"' />";
|
|
|
+ $output += "<input type='hidden' id='reset_add' name='reset_add' value='1'>";
|
|
|
|
|
|
- return true;
|
|
|
-}
|
|
|
-function delete_extra(msg){
|
|
|
- $('#extra_add_info_'+msg).remove();
|
|
|
- $('#extra_add_info_hidden_'+msg).remove();
|
|
|
-}
|
|
|
-function add_extra(){
|
|
|
- if ($('#setTechnician_content').val()){
|
|
|
- setTechnician_content = $('#setTechnician_content').val();
|
|
|
- setTechnician_id = $('#technician_id').val();
|
|
|
- $output = "<div id='extra_add_info_"+setTechnician_id+"' style='height: 4px'>"+setTechnician_content;
|
|
|
- $output +="<a href ='' onclick='delete_extra("+setTechnician_id+");return false;'>删除</a></div><br/>";
|
|
|
- $output +="<input type='hidden' id='extra_add_info_hidden_"+setTechnician_id+"' name='extra_add_info_"+setTechnician_id+"' value='"+setTechnician_content+"' /></div>";
|
|
|
- $('#setTechnician_content').val('');
|
|
|
- $("#extra_add_info").append($output);
|
|
|
- }
|
|
|
-}
|
|
|
-function reset_delete_extra(msg){
|
|
|
- $('#reset_extra_add_info_'+msg).remove();
|
|
|
- $('#reset_extra_add_info_hidden_'+msg).remove();
|
|
|
- $('#reset_add').remove();
|
|
|
-}
|
|
|
-function reset_add_extra(){
|
|
|
- if ($('#resetTec').val()) {
|
|
|
-
|
|
|
-
|
|
|
- resetTec = $('#resetTec').val();
|
|
|
- resetTecName = $('#resetTecName').val();
|
|
|
-
|
|
|
- $output = "<div id='reset_extra_add_info_"+resetTec+"' style='height: 4px'>"+resetTecName;
|
|
|
- $output +="<a href ='' onclick='reset_delete_extra("+resetTec+");return false;'>删除</a></div><br/>";
|
|
|
- $output +="<input type='hidden' id='reset_extra_add_info_hidden_"+resetTec+"' name='reset_extra_add_info_"+resetTec+"' value='"+resetTecName+"' />";
|
|
|
- $output += "<input type='hidden' id='reset_add' name='reset_add' value='1'>";
|
|
|
-
|
|
|
- $("#reset_extra_add_info").append($output);
|
|
|
- $('#resetTecName').val('');
|
|
|
+ $("#reset_extra_add_info").append($output);
|
|
|
+ $('#resetTecName').val('');
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
</script>
|