|
@@ -1,624 +0,0 @@
|
|
|
-<style>
|
|
|
- .f_label {width: 90px;}
|
|
|
- .accordion-body {padding: 0;}
|
|
|
- #view_select_position {
|
|
|
- display:inline-block;
|
|
|
- padding:1px 4px 1px 4px;
|
|
|
- border:1px solid #999999;
|
|
|
- text-decoration:none;
|
|
|
- color:#333333;
|
|
|
- }
|
|
|
-</style>
|
|
|
-
|
|
|
-<div id="main">
|
|
|
- <div region="west" border="false" id="west_panel">
|
|
|
- <table id="dg_content"></table>
|
|
|
- <div id="tb_content">
|
|
|
- <div class="tb_line">
|
|
|
- <input id="ss" />
|
|
|
- <span class="tb_label">服务</span>
|
|
|
- <input id="filter_type" style="width:100px"/>
|
|
|
- </div>
|
|
|
- <div class="tb_line">
|
|
|
- <span class="tb_label">状态: </span>
|
|
|
- <input id="filter_status" />
|
|
|
-
|
|
|
- </div>
|
|
|
-
|
|
|
- <div style="margin: 3px 2px;padding:5px;border: 1px solid #95B8E7;">
|
|
|
- <a href="#" class='easyui-linkbutton' plain="true" iconCls="icon-add" onclick="add_content();return false;">新增充值卡</a>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div id="acc_container" class="accordion" region="center">
|
|
|
- <div region="center" title="充值卡" data-options="iconCls:'icon-save',selected:true">
|
|
|
- <div class="easyui-layout detail_layout">
|
|
|
- <div data-options="region:'center'" class="detail_center">
|
|
|
- <div class="detail_main">
|
|
|
- <form id="content_form" method="post">
|
|
|
- <ul>
|
|
|
- <li class="f_item">
|
|
|
- <div class="box">
|
|
|
- <div class="f_label">
|
|
|
- <span>ID: </span>
|
|
|
- </div>
|
|
|
- <div class="box_flex f_content">
|
|
|
- <input type="hidden" name="id" id="recharge_id" value='' />
|
|
|
- <span id="id_str"></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li class="f_item">
|
|
|
- <div class="box">
|
|
|
- <div class="f_label">
|
|
|
- <span>充值面额: </span>
|
|
|
- </div>
|
|
|
- <div class="box_flex f_content">
|
|
|
- <input type="text" name="denomination" id="edit_denomination" value='' />
|
|
|
- <span id="id_str"></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
-
|
|
|
- <li class="f_item">
|
|
|
- <div class="box">
|
|
|
- <div class="f_label">
|
|
|
- <span>选择方式: </span>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="box_flex f_content">
|
|
|
- <input type="radio" name="select_fun" id="edit_cash_back" checked="true" value='cash_back' />返现金额
|
|
|
- <span id="id_str"></span>
|
|
|
- <input type="radio" name="select_fun" id="edit_coupon" value="coupon" />使用代金券
|
|
|
- </div>
|
|
|
-
|
|
|
- </li>
|
|
|
-
|
|
|
- <li class="f_item">
|
|
|
- <div class="box">
|
|
|
- <div class="f_label">
|
|
|
- <span></span>
|
|
|
- </div>
|
|
|
- <div class="box_flex f_content" id="cash">
|
|
|
- <input type="text" name="cash_back" id="edit_cash_back" value='' />
|
|
|
- </div>
|
|
|
- <div class="box_flex f_content" id="coupons" style="display: none;">
|
|
|
- <div id="coupons_items"></div>
|
|
|
- <textarea id="text_coupons" name="coupons" style="width: 250px;min-height: 50px" placeholder="若使用代金券,填写代金券id,多个代金券时用换行分割"></textarea>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
-
|
|
|
- <li class="f_item">
|
|
|
- <div class="box">
|
|
|
- <div class="f_label">
|
|
|
- <span>介绍: </span>
|
|
|
- </div>
|
|
|
- <div class="box_flex f_content">
|
|
|
- <textarea name="desc" style="width: 250px;min-height: 100px"></textarea>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
-
|
|
|
-
|
|
|
- <li class="f_item">
|
|
|
- <div class="box">
|
|
|
- <div class="f_label">
|
|
|
- <span>状态:</span>
|
|
|
- </div>
|
|
|
- <div class="box_flex f_content">
|
|
|
- <input id="setStatus" name="status" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li class="f_item">
|
|
|
- <div class="box">
|
|
|
- <div class="f_label">
|
|
|
- </div>
|
|
|
- <div class="box_flex f_content">
|
|
|
- <span id="action_info" style="color:green;"></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
-
|
|
|
- </ul>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
- <div data-options="region:'south'" class="detail_south">
|
|
|
- <div class="detail_toolbar">
|
|
|
- <a href="#" class="easyui-linkbutton set_button" iconCls="icon-save" onclick="save_content();return false;">保存</a>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-<div style="display: none;">
|
|
|
- <div id="add_dialog" style="padding: 15px 0;">
|
|
|
- <form id="add_form" method="post">
|
|
|
- <ul>
|
|
|
- <li class="f_item">
|
|
|
- <div class="box">
|
|
|
- <div class="f_label">
|
|
|
- <span>充值面额: </span>
|
|
|
- </div>
|
|
|
- <div class="box_flex f_content">
|
|
|
- <input id="denomination" name="denomination" style="width: 250px;" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
-
|
|
|
- <li class="f_item">
|
|
|
- <div class="box">
|
|
|
- <div class="f_label">
|
|
|
- <span>返现的金额: </span>
|
|
|
- </div>
|
|
|
- <div class="box_flex f_content">
|
|
|
- <input id="cash_back" name="cash_back" style="width: 250px;" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li class="f_item">
|
|
|
- <div class="box">
|
|
|
- <div class="f_label">
|
|
|
- <span>状态: </span>
|
|
|
- </div>
|
|
|
- <div class="box_flex f_content">
|
|
|
- <input id="setStatus_add" name="status" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
-
|
|
|
- <li class="f_item">
|
|
|
- <div class="box">
|
|
|
- <div class="f_label">
|
|
|
- <span>介 绍: </span>
|
|
|
- </div>
|
|
|
- <div class="box_flex f_content">
|
|
|
- <textarea name="desc" style="width: 250px;min-height: 100px"></textarea>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- </ul>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
-
|
|
|
-</div>
|
|
|
-
|
|
|
-<div style="display:none;">
|
|
|
- <div id="refund_tip_dialog" style="padding: 30px 0;">
|
|
|
- <div style="text-align:center;"><span id="refund_tip"></span></div>
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-<script language="javascript" type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/coolautosuggest/jquery.coolautosuggest.js"></script>
|
|
|
-<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/js/coolautosuggest/jquery.coolautosuggest.css" />
|
|
|
-<script type="text/javascript">
|
|
|
- var jq_dg_content = $('#dg_content');
|
|
|
- var jq_content_form = $('#content_form');
|
|
|
- var jq_filter_status = $('#filter_status');
|
|
|
- var jq_setStatus_add = $('#setStatus_add');
|
|
|
- var module_router = site_root + '/index.php?r=Recharge';
|
|
|
- var status_data = <?php echo json_encode($status); ?>;
|
|
|
- var main_coupons = <?php echo json_encode($main_coupons); ?>;
|
|
|
- var jq_setStatus = $('#setStatus');
|
|
|
- var w_width = $(window).width();
|
|
|
- var w_height = $(window).height();
|
|
|
- var jq_ss = $('#ss');
|
|
|
- var jq_filter_coupons = $('#coupon');
|
|
|
-
|
|
|
- var jq_add_dialog = $('#add_dialog');
|
|
|
- var jq_add_form = $('#add_form');
|
|
|
-
|
|
|
- var jq_date_start_order = $('#date_start_order');
|
|
|
- var jq_date_end_order = $('#date_end_order');
|
|
|
- var jq_date_start_book = $('#date_start_book');
|
|
|
- var jq_date_end_book = $('#date_end_book');
|
|
|
-
|
|
|
- var jq_set_precedence = $('#set_precedence');
|
|
|
-
|
|
|
-
|
|
|
- var jq_acc = $('#acc_container');
|
|
|
-
|
|
|
- $(function(){
|
|
|
-
|
|
|
- jq_acc.accordion({
|
|
|
- height: w_height - 18,
|
|
|
- onSelect: function(title) {
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- /* jq_filter_coupons.combobox({
|
|
|
- editable : false,
|
|
|
- data : main_coupons,
|
|
|
- onSelect : function () {
|
|
|
- search_content();
|
|
|
- }
|
|
|
- })*/
|
|
|
-
|
|
|
- jq_date_start_order.datebox({});
|
|
|
- jq_date_end_order.datebox({});
|
|
|
-
|
|
|
- jq_date_start_book.datebox({});
|
|
|
- jq_date_end_book.datebox({});
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- var buttons = $.extend([], $.fn.datebox.defaults.buttons);
|
|
|
- buttons[0].text = '确定';
|
|
|
- buttons[0].handler=function(){
|
|
|
- var vals = $('#booking_time').datetimebox('spinner').spinner('getValue').split(':');
|
|
|
- $('#booking_time_str').val( parseInt($('#booking_time_str').val())-(parseInt($('#booking_time_str').val())+8*3600)%86400 +vals[0]*3600+vals[1]*60);
|
|
|
-
|
|
|
- var d=new Date(parseInt($('#booking_time_str').val())*1000);
|
|
|
-
|
|
|
- $('#booking_time').datetimebox('setText',formatDate(d));
|
|
|
- $('#booking_time').datetimebox('hidePanel');
|
|
|
- };
|
|
|
-
|
|
|
- $('#booking_time').datetimebox({
|
|
|
- required: false,
|
|
|
- showSeconds:false,
|
|
|
- buttons:buttons,
|
|
|
- onSelect: function(date){
|
|
|
- var currentDate = new Date();
|
|
|
- //console.log(date)
|
|
|
- // if(currentDate>=date){
|
|
|
- // $.messager.show({
|
|
|
- // title: '提示',
|
|
|
- // msg: '必须选择现在之后的日期',
|
|
|
- // timeout: 3500,
|
|
|
- // showType: 'slide'
|
|
|
- // });
|
|
|
- // }else{
|
|
|
- $('#booking_time_str').val(date.getTime()/1000);
|
|
|
- // }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $('#booking_time_add').datetimebox({
|
|
|
- required: false,
|
|
|
- showSeconds:false,
|
|
|
- //buttons:buttons_add,
|
|
|
- onSelect: function(date){
|
|
|
- var currentDate = new Date();
|
|
|
- $('#booking_time_str_add').val(date.getTime()/1000);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $('#order_time_add').datetimebox({
|
|
|
- required: false,
|
|
|
- showSeconds:false,
|
|
|
- //buttons:buttons_add,
|
|
|
- // onSelect: function(date){
|
|
|
- // var currentDate = new Date();
|
|
|
- // $('#order_time_str_add').val(date.getTime()/1000);
|
|
|
- // }
|
|
|
- });
|
|
|
-
|
|
|
- $('#deal_time').datetimebox({
|
|
|
- required: false,
|
|
|
- showSeconds:false,
|
|
|
- //buttons:buttons_deal,
|
|
|
- // onSelect: function(date){
|
|
|
- // console.log(date);
|
|
|
- // $('#deal_time_str').val(date.getTime()/1000);
|
|
|
- // }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- jq_setStatus.combobox({
|
|
|
- editable: false,
|
|
|
- data: status_data
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- jq_setStatus_add.combobox({
|
|
|
- editable: false,
|
|
|
- data: (function () {
|
|
|
- var status_data_temp = new Array();
|
|
|
- $.extend(status_data_temp, status_data);
|
|
|
- status_data_temp.shift();
|
|
|
-
|
|
|
- return status_data_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: '请输入关键字'
|
|
|
- });
|
|
|
-
|
|
|
- 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();
|
|
|
- }
|
|
|
- }
|
|
|
- },{
|
|
|
- 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.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:'denomination', title:'充值面额', width:25,sortable:false
|
|
|
- },
|
|
|
- {field:'cash_back', title:'返现金额', width:25,sortable:false},
|
|
|
- {field:'status', title:'状态', width:50, sortable: true,
|
|
|
- formatter: function(value, row){
|
|
|
- return get_filed_text(value, status_data);
|
|
|
- }
|
|
|
- }
|
|
|
- ]],
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- onSelect: function(index, row){
|
|
|
-
|
|
|
- var data = $.extend({}, row);
|
|
|
- $('#id_str').html(data.id);
|
|
|
- $('#recharge_id').val(data.id);
|
|
|
- jq_content_form.form('load', data);
|
|
|
-
|
|
|
- $('#admins_edit_info').html('');
|
|
|
-// var _html = '';
|
|
|
-// for (i in data.coupons){
|
|
|
-// console.log(JSON.stringify(data.coupons[i]));
|
|
|
-// _html += data.coupons[i]+'<br/>';
|
|
|
-// }
|
|
|
-//
|
|
|
-// $('#coupons_items').html(_html);
|
|
|
- if (data['action_user'] != ''){
|
|
|
- jq_action_info.html('信息已被编辑: ' + data['action_user'] + ' ' + data['action_time']);
|
|
|
- } else {
|
|
|
- jq_action_info.html('');
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- });
|
|
|
-
|
|
|
- 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_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'
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- 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'
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- $('#edit_coupon').change(function(){
|
|
|
- $('#cash').hide();
|
|
|
- $('#coupons').show();
|
|
|
- });
|
|
|
- $('#edit_cash_back').change(function(){
|
|
|
-
|
|
|
- $('#cash').show();
|
|
|
- $('#coupons').hide();
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-});
|
|
|
-
|
|
|
-function save_content(){
|
|
|
- if ($('#recharge_id').val() == ""){
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (jq_setStatus.combobox('getValue') <0 ){
|
|
|
- $.messager.confirm('注意', '确认 取消/退款 该订单吗?', function(r){
|
|
|
- $.messager.progress();
|
|
|
- jq_content_form.submit();
|
|
|
- });
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $.messager.progress();
|
|
|
- jq_content_form.submit();
|
|
|
-}
|
|
|
-function checkAddForm () {
|
|
|
- // 空数据检查
|
|
|
-
|
|
|
- if ($('#denomination').val() == '') {
|
|
|
- $.messager.alert('提示', '请输入充值面额', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($('#cash_back').val() == '') {
|
|
|
- $.messager.alert('提示', '请输入返现的金额', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if ($('#setStatus_add').combobox('getValue') == '') {
|
|
|
- $.messager.alert('提示', '请选择充值卡状态', 'warning');
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
-}
|
|
|
-
|
|
|
-function add_content(){
|
|
|
- jq_add_dialog.dialog('open');
|
|
|
-}
|
|
|
-
|
|
|
-</script>
|