north 7 vuotta sitten
vanhempi
sitoutus
a1e21c72cc

+ 10 - 0
www/protected/controllers/HouseKeepingController.php

@@ -16,6 +16,12 @@ class HouseKeepingController extends AdminController
         $cart_options = CommonFn::getComboboxData(HouseKeeping::$cart_options, 1, true, 100);
         $cart_options = CommonFn::getComboboxData(HouseKeeping::$cart_options, 1, true, 100);
         $skill_options = CommonFn::getComboboxData(HouseKeeping::$skill_options, 1, true, 100);
         $skill_options = CommonFn::getComboboxData(HouseKeeping::$skill_options, 1, true, 100);
         $contract_option = CommonFn::getComboboxData(HouseKeeping::$contract_option, 1, true, 100);
         $contract_option = CommonFn::getComboboxData(HouseKeeping::$contract_option, 1, true, 100);
+        $c = new EMongoCriteria();
+        $c->status('==',2);
+        $tmp = Store::model()->findAll($c);
+        foreach ($tmp as $k => $v) {
+            $store_options[$v->store_id]['name'] = $v->store_name;
+        }
         $this->render('index', [
         $this->render('index', [
             'status_option' => $status_option,
             'status_option' => $status_option,
             'type_option' => $type_option,
             'type_option' => $type_option,
@@ -66,6 +72,7 @@ class HouseKeepingController extends AdminController
         $server_start_time = intval(Yii::app()->request->getParam('server_start_time', ''));
         $server_start_time = intval(Yii::app()->request->getParam('server_start_time', ''));
         $status_time = intval(Yii::app()->request->getParam('status_time', ''));
         $status_time = intval(Yii::app()->request->getParam('status_time', ''));
         $server_end_time = intval(Yii::app()->request->getParam('server_end_time', ''));
         $server_end_time = intval(Yii::app()->request->getParam('server_end_time', ''));
+        $store_id = (Yii::app()->request->getParam('store_id', ''));
         $id = Yii::app()->request->getParam('id');
         $id = Yii::app()->request->getParam('id');
 
 
         if (!CommonFn::isMongoId($id)) {
         if (!CommonFn::isMongoId($id)) {
@@ -76,6 +83,9 @@ class HouseKeepingController extends AdminController
         if (!empty($contract)) {
         if (!empty($contract)) {
             $h->contract = $contract;
             $h->contract = $contract;
         }
         }
+        if (!empty($store_id)) {
+            $h->store_id = $store_id;
+        }
         if (!empty($type)) {
         if (!empty($type)) {
             $h->type = $type;
             $h->type = $type;
         }
         }

+ 84 - 0
www/protected/controllers/REmployeController.php

@@ -0,0 +1,84 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: north
+ * Date: 2017/8/14
+ * Time: 下午2:31
+ */
+class REmployeController extends AdminController {
+
+    public function actionIndex()
+    {
+        $status = CommonFn::getComboboxData(JEmploye::$status_option, 100, true, 100);//人员状态
+        $auth = CommonFn::getComboboxData(JEmploye::$auth_option, 1, true, 100);
+        $this->render('index',array(
+            'status' => $status,
+            'auth' => $auth
+        ));
+    }
+
+    public function actionList()
+    {
+        $pageParams = CommonFn::getPageParams();
+        $status = intval(Yii::app()->request->getParam('status', 100));
+        $criteria = new EMongoCriteria($pageParams);
+        if ($status != 100 ) {
+            $criteria->status('==',$status);
+        }
+        $cursor = JEmploye::model()->findAll($criteria);
+        $rows = CommonFn::getRowsFromCursor($cursor);
+        $parsedRows = JEmploye::model()->parse($rows);
+        $total = $cursor->count();
+        echo CommonFn::composeDatagridData($parsedRows, $total);
+    }
+
+    public function actionEdit()
+    {
+        $id = Yii::app()->request->getParam('id','');
+        $status = intval(Yii::app()->request->getParam('status',100));
+        if ($status == 100) {
+            CommonFn::requestAjax(false,'状态没有修改');exit;
+        }
+        if (!CommonFn::isMongoId($id)) {
+            CommonFn::requestAjax(false,'id错误');exit;
+        }
+        $employe = JEmploye::get(new MongoId($id));
+        $employe->status = $status;
+        $employe->save();
+        CommonFn::requestAjax(true,'保存成功');exit;
+    }
+    public function actionAdd()
+    {
+        $user_id = Yii::app()->request->getParam('user_id','');
+        $user_name = Yii::app()->request->getParam('user_name','');
+        $mobile = Yii::app()->request->getParam('mobile','');
+        $auth = intval(Yii::app()->request->getParam('auth',''));
+        $owned_stores = Yii::app()->request->getParam('owned_stores','');
+        $desc = Yii::app()->request->getParam('desc','');
+        $sex = Yii::app()->request->getParam('sex','');
+        $status = intval(Yii::app()->request->getParam('status',100));
+        if ($status == 100) {
+            CommonFn::requestAjax(false,'状态没有修改');exit;
+        }
+
+        if (CommonFn::isMongoId($user_id)) {
+            $user = RUser::get(new MongoId($user_id));
+            if (empty($user)) {
+                CommonFn::requestAjax(false,'id错误');exit;
+            }
+
+        }
+
+        $employe = new JEmploye();
+        $employe->user_id = $user->_id;
+        $employe->user_name = $user_name;
+        $employe->mobile = $mobile;
+        $employe->auth = intval($auth);
+        $employe->owned_stores = intval($owned_stores);
+        $employe->desc = $desc;
+        $employe->status = intval($status);
+        $employe->sex = intval($sex);
+        $employe->save();
+        CommonFn::requestAjax(true,'保存成功');exit;
+    }
+}

+ 124 - 0
www/protected/controllers/StoreController.php

@@ -0,0 +1,124 @@
+<?php
+
+/**
+ * Created by north.Deng's MAC
+ * User: north.Deng
+ * Date: 2018/1/11
+ * Time: 下午2:06
+ * description :
+ */
+class StoreController extends AdminController
+{
+    public function actionIndex()
+    {
+        $status_option = CommonFn::getComboboxData(Store::$status_options, 1, true, 100);
+
+        $this->render('index', [
+            'status' => $status_option,
+        ]);
+    }
+
+    public function actionList()
+    {
+        $pageParams = CommonFn::getPageParams();
+
+        $id = intval(Yii::app()->request->getParam('id'));
+        $search = Yii::app()->request->getParam('search', '');
+        $status = intval(Yii::app()->request->getParam('status', 100));
+
+        $criteria = new EMongoCriteria($pageParams);
+        // id筛选
+        if ($id) {
+            $criteria->_id('==', new MongoId($id));
+        }
+        // 状态筛选
+        if ($status != 100) {
+            $criteria->status('==', $status);
+        }
+
+        $cursor = Store::model()->findAll($criteria);
+        $rows = CommonFn::getRowsFromCursor($cursor);
+        $parsedRows = Store::model()->parse($rows);
+        $total = $cursor->count();
+
+        echo CommonFn::composeDatagridData($parsedRows, $total);
+
+    }
+
+    public function actionEdit()
+    {
+        $status = Yii::app()->request->getParam('status', '');
+        $store_name = Yii::app()->request->getParam('store_name', '');
+        $store_principal = Yii::app()->request->getParam('store_principal', '');
+        $mobile = Yii::app()->request->getParam('mobile', '');
+        $address = Yii::app()->request->getParam('address', '');
+        $desc = Yii::app()->request->getParam('desc', '');
+        $content = Yii::app()->request->getParam('content', '');
+        $id = Yii::app()->request->getParam('id', '');
+
+        if (!CommonFn::isMongoId($id)) {
+            CommonFn::requestAjax(false, '修改失败', array());exit;
+        }
+        $store = Store::get(new MongoId($id));
+
+        if (!empty($status)) {
+            $store->status = intval($status);
+        }
+        if (!empty($store_name)) {
+            $store->store_name = $store_name;
+        }
+        if (!empty($store_principal)) {
+            $store->store_principal = $store_principal;
+        }
+        if (!empty($mobile)) {
+            $store->mobile = $mobile;
+        }
+        if (!empty($address)) {
+            $store->address = $address;
+        }
+        if (!empty($desc)) {
+            $store->desc = $desc;
+        }
+        if (!empty($content)) {
+            $store->content = $content;
+        }
+
+        $success = $store->save();
+        CommonFn::requestAjax($success, '修改成功', array());
+
+    }
+
+    public function actionAdd()
+    {
+        $status = Yii::app()->request->getParam('status', '');
+        $store_name = Yii::app()->request->getParam('store_name', '');
+        $store_id = Yii::app()->request->getParam('store_id', '');
+        $store_principal = Yii::app()->request->getParam('store_principal', '');
+        $mobile = Yii::app()->request->getParam('mobile', '');
+        $address = Yii::app()->request->getParam('address', '');
+        $desc = Yii::app()->request->getParam('desc', '');
+        $content = Yii::app()->request->getParam('content', '');
+        $c = new EMongoCriteria();
+        $c->store_id('==',$store_id);
+        $tmp = Store::model()->findAll($c);
+        if (!empty($tmp)) {
+            CommonFn::requestAjax(false,'门店id已经使用',array());exit;
+        }
+        if (!in_array($status ,array(1,2))) {
+            CommonFn::requestAjax(false,'请选择门店状态',array());exit;
+        }
+        $store = new Store();
+        $store->status = intval($status);
+        $store->store_name = $store_name;
+        $store->store_id = intval($store_id);
+        $store->store_principal = $store_principal;
+        $store->mobile = $mobile;
+        $store->address = $address;
+        $store->desc = $desc;
+        $store->content = $content;
+        $store->save();
+        CommonFn::requestAjax(true,'保存成功',array());
+
+    }
+
+}

+ 17 - 1
www/protected/modules/j/controllers/HouseKeepingController.php

@@ -14,6 +14,7 @@ class HouseKeepingController extends JBaseController
     {
     {
 
 
         $id = intval(Yii::app()->request->getParam('id'));
         $id = intval(Yii::app()->request->getParam('id'));
+        $store_id = intval(Yii::app()->request->getParam('store_id'));
 
 
 
 
         $criteria = new EMongoCriteria();
         $criteria = new EMongoCriteria();
@@ -21,7 +22,7 @@ class HouseKeepingController extends JBaseController
         if ($id) {
         if ($id) {
             $criteria->user_id('==', new MongoId($id));
             $criteria->user_id('==', new MongoId($id));
         }
         }
-
+        $criteria->store_id('==', intval($store_id));
 
 
         $cursor = HouseKeeping::model()->findAll($criteria);
         $cursor = HouseKeeping::model()->findAll($criteria);
         $rows = CommonFn::getRowsFromCursor($cursor);
         $rows = CommonFn::getRowsFromCursor($cursor);
@@ -32,6 +33,19 @@ class HouseKeepingController extends JBaseController
 
 
     }
     }
 
 
+    public function actionGetStore()
+    {
+        $c= new EMongoCriteria();
+        $c->status('==',1);
+        $tmp = Store::model()->findAll($c);
+        $data = array();
+        foreach ($tmp as $k => $v) {
+            $data[$k]['store_id'] = $v->store_id;
+            $data[$k]['store_name'] = $v->store_name;
+        }
+        return json_encode($data);
+    }
+
     public function actionEdit()
     public function actionEdit()
     {
     {
         $status = intval(Yii::app()->request->getParam('status', ''));
         $status = intval(Yii::app()->request->getParam('status', ''));
@@ -110,7 +124,9 @@ class HouseKeepingController extends JBaseController
         $server_start_time = intval(Yii::app()->request->getParam('server_start_time', ''));
         $server_start_time = intval(Yii::app()->request->getParam('server_start_time', ''));
         $status_time = intval(Yii::app()->request->getParam('status_time', ''));
         $status_time = intval(Yii::app()->request->getParam('status_time', ''));
         $server_end_time = intval(Yii::app()->request->getParam('server_end_time', ''));
         $server_end_time = intval(Yii::app()->request->getParam('server_end_time', ''));
+        $store_id = intval(Yii::app()->request->getParam('store_id', ''));
         $h = new HouseKeeping();
         $h = new HouseKeeping();
+        $h->store_id = $store_id;
         $h->user_name = $user_name;
         $h->user_name = $user_name;
         $h->user_id = $user_id;
         $h->user_id = $user_id;
         $h->mobile = $mobile;
         $h->mobile = $mobile;

+ 6 - 0
www/protected/modules/o2o/models/HouseKeeping.php

@@ -27,6 +27,7 @@
      public $tech;//服务人员
      public $tech;//服务人员
      public $contract;//签约状态
      public $contract;//签约状态
      public $time;//创建时间
      public $time;//创建时间
+     public $store_id;//store id
 
 
 
 
      //服务形式
      //服务形式
@@ -114,6 +115,11 @@
          $newRow['status'] = CommonFn::get_val_if_isset($row,'status');
          $newRow['status'] = CommonFn::get_val_if_isset($row,'status');
          $newRow['status_str'] = self::$status_option[intval($newRow['status'])];
          $newRow['status_str'] = self::$status_option[intval($newRow['status'])];
          $newRow['time'] = CommonFn::get_val_if_isset($row,'time','');
          $newRow['time'] = CommonFn::get_val_if_isset($row,'time','');
+         $newRow['store_id'] = CommonFn::get_val_if_isset($row,'store_id','');
+         $c = new EMongoCriteria();
+         $c->store_id('==',intval($newRow['store_id']));
+         $store = Store::model()->find($c);
+         $newRow['store_name'] = $store->store_name;
          if(APPLICATION=='admin'){
          if(APPLICATION=='admin'){
              $newRow['action_user'] = CommonFn::get_val_if_isset($row,'action_user',"");
              $newRow['action_user'] = CommonFn::get_val_if_isset($row,'action_user',"");
              $newRow['action_time'] = CommonFn::get_val_if_isset($row,'action_time',"");
              $newRow['action_time'] = CommonFn::get_val_if_isset($row,'action_time',"");

+ 99 - 0
www/protected/modules/o2o/models/JEmploye.php

@@ -0,0 +1,99 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: north
+ * Date: 2017/7/21
+ * Time: 下午4:48
+ */
+class JEmploye extends MongoAr {
+
+    public $_id;//人员编号
+    public $user_id;//user $_id
+    public $user_name;//用户名
+    public $sex;//性别 1 男 0 女
+    public $register_time;//出生日期
+    public $card_id;//身份证号
+    public $address = array();//地址
+    public $mobile;//联系方式
+    public $owned_stores;//所属机构
+    public $education;//学历
+    public $certificate;//证书
+    public $type_of_work;//工种
+    public $skil;//技能
+    public $work_year;//工作年限
+    public $auth;//角色 中医/营养师/保洁师/月嫂/催乳师/配送师
+    public $status;//人员状态	在岗/离岗/黑名单/
+    public $desc;//备注
+
+    public static $auth_option = array(
+        0 => "门店老师",
+    );
+    public static $status_option = array(
+        0 => "在岗",
+        1 => "离岗",
+        2 => "黑名单",
+        3 => "待审核"
+    );
+
+    public function __construct($scenario='insert'){
+        $this->setMongoDBComponent(Yii::app()->getComponent('mongodb_o2o'));
+        parent::__construct($scenario);
+    }
+
+
+    public static function model($className=__CLASS__)
+    {
+        return parent::model($className);
+    }
+
+    public function getCollectionName()
+    {
+        return 'j_employe';
+    }
+
+    public static function get($_id) {
+        if(CommonFn::isMongoId($_id)){
+            $criteria = new EMongoCriteria();
+            $criteria->_id('==', $_id);
+            $model = self::model()->find($criteria);
+            return $model;
+        }else{
+            return false;
+        }
+    }
+
+    public function parseRow($row,$output=array()){
+        $newRow = array();
+        $newRow['id'] = (string)$row['_id'];
+        $newRow['user_name'] = CommonFn::get_val_if_isset($row,'user_name','');
+        $newRow['user_id'] = CommonFn::get_val_if_isset($row,'user_id','');
+        $newRow['mobile'] = CommonFn::get_val_if_isset($row,'mobile','');
+        $newRow['owned_stores'] = CommonFn::get_val_if_isset($row,'owned_stores','');
+        $newRow['register_time'] = CommonFn::get_val_if_isset($row,'register_time','');
+        $newRow['sex'] = CommonFn::get_val_if_isset($row,'sex','');
+        $newRow['card_id'] = CommonFn::get_val_if_isset($row,'card_id','');
+        $newRow['address'] = CommonFn::get_val_if_isset($row,'address','');
+
+        $newRow['education'] = CommonFn::get_val_if_isset($row,'education','');
+        $newRow['certificate'] = CommonFn::get_val_if_isset($row,'certificate','');
+        $newRow['type_of_work'] = CommonFn::get_val_if_isset($row,'type_of_work','');
+        $newRow['skil'] = CommonFn::get_val_if_isset($row,'skil','');
+        $newRow['work_year'] = CommonFn::get_val_if_isset($row,'work_year','');
+        $newRow['auth'] = CommonFn::get_val_if_isset($row,'auth','');
+        $newRow['auth_str'] = JEmploye::$auth_option[intval($newRow['auth'])];
+        $newRow['address'] = CommonFn::get_val_if_isset($row,'address','');
+        $newRow['status'] = CommonFn::get_val_if_isset($row,'status','');
+        $newRow['status_str'] = JEmploye::$status_option[intval($newRow['status'])];
+        $newRow['desc'] = CommonFn::get_val_if_isset($row,'desc','');
+
+        if(APPLICATION=='admin'){
+            $newRow['action_user'] = CommonFn::get_val_if_isset($row,'action_user',"");
+            $newRow['action_time'] = CommonFn::get_val_if_isset($row,'action_time',"");
+            $newRow['action_log'] = CommonFn::get_val_if_isset($row,'action_log',"");
+
+        }
+        return $this->output($newRow,$output);
+    }
+
+
+}

+ 76 - 0
www/protected/modules/o2o/models/Store.php

@@ -0,0 +1,76 @@
+<?php
+
+/**
+ * Created by north.Deng's MAC
+ * User: north.Deng
+ * Date: 2018/1/11
+ * Time: 下午1:48
+ * description :
+ */
+class Store extends MongoAr
+{
+    public $_id;
+    public $store_id;//门店id
+    public $store_name;//门店名称
+    public $store_principal;//负责人
+    public $mobile;//联系方式
+    public $address;//地址
+    public $desc;//描述
+    public $content;//备注
+    public $status; //1关闭 2正常
+
+    public static $status_options = array(
+        1 => array("name" => "关闭"),
+        2 => array("name" => "正常"),
+    );
+
+    public function __construct($scenario='insert'){
+        $this->setMongoDBComponent(Yii::app()->getComponent('mongodb_o2o'));
+        parent::__construct($scenario);
+    }
+
+
+    public static function model($className=__CLASS__)
+    {
+        return parent::model($className);
+    }
+
+    public function getCollectionName()
+    {
+        return 'j_store';
+    }
+
+    public static function get($_id) {
+        if(CommonFn::isMongoId($_id)){
+            $criteria = new EMongoCriteria();
+            $criteria->_id('==', $_id);
+            $model = self::model()->find($criteria);
+            return $model;
+        }else{
+            return false;
+        }
+    }
+
+    public function parseRow($row,$output=array()){
+
+        $newRow = array();
+        $newRow['id'] = (string)$row['_id'];
+        $newRow['store_id'] = CommonFn::get_val_if_isset($row,'store_id','');
+        $newRow['store_name'] = CommonFn::get_val_if_isset($row,'store_name','');
+        $newRow['store_principal'] = CommonFn::get_val_if_isset($row,'store_principal','');
+        $newRow['mobile'] = CommonFn::get_val_if_isset($row,'mobile','');
+        $newRow['address'] = CommonFn::get_val_if_isset($row,'address','');
+        $newRow['desc'] = CommonFn::get_val_if_isset($row,'desc','');
+        $newRow['status'] = CommonFn::get_val_if_isset($row,'status','');
+        $newRow['status_str'] = self::$status_options[intval($newRow['status'])]['name'];
+
+        $newRow['content'] = CommonFn::get_val_if_isset($row,'content','');
+        if(APPLICATION=='admin'){
+            $newRow['action_user'] = CommonFn::get_val_if_isset($row,'action_user',"");
+            $newRow['action_time'] = CommonFn::get_val_if_isset($row,'action_time',"");
+            $newRow['action_log'] = CommonFn::get_val_if_isset($row,'action_log',"");
+
+        }
+        return $this->output($newRow,$output);
+    }
+}

+ 3 - 2
www/protected/views/houseKeeping/index.php

@@ -453,11 +453,12 @@
           return   month+"月"+date+"日"+hour+":00";
           return   month+"月"+date+"日"+hour+":00";
         }
         }
         },
         },
-        {field:'user_name', title:'姓名', width:25,sortable:false},
+        {field:'user_name', title:'姓名', width:40,sortable:false},
         {field:'mobile', title:'联系方式', width:50, sortable: true},
         {field:'mobile', title:'联系方式', width:50, sortable: true},
         {field:'type_str', title:'服务类型', width:50, sortable: true},
         {field:'type_str', title:'服务类型', width:50, sortable: true},
         {field:'cart_str', title:'服务形式', width:50, sortable: true},
         {field:'cart_str', title:'服务形式', width:50, sortable: true},
         {field:'status_str', title:'预约状态', width:50, sortable: true},
         {field:'status_str', title:'预约状态', width:50, sortable: true},
+        {field:'store_name', title:'门店', width:50, sortable: true},
 
 
         /*{field:'skill_str', title:'技能', width:50, sortable: true},
         /*{field:'skill_str', title:'技能', width:50, sortable: true},
         {field:'age', title:'年龄', width:50, sortable: true},
         {field:'age', title:'年龄', width:50, sortable: true},
@@ -540,7 +541,7 @@
         $('#age').val('');
         $('#age').val('');
         $('#tech').val('');
         $('#tech').val('');
         $('#desc').val('');
         $('#desc').val('');
-        jq_content_form.form('load', data);
+        jq_content_form.form('load', '');
         $('#admins_edit_info').html('');
         $('#admins_edit_info').html('');
 
 
         jq_action_info.html('');
         jq_action_info.html('');

+ 486 - 0
www/protected/views/rEmploye/index.php

@@ -0,0 +1,486 @@
+<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">
+                <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="xorder_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 id="setStatus" name="status" />
+                                        </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="user_name" name="user_name" style="width: 250px;"  />
+                        </div>
+                    </div>
+                </li>
+                <li class="f_item">
+                    <div class="box">
+                        <div class="f_label">
+                            <span>用户id: </span>
+                        </div>
+                        <div class="box_flex f_content">
+                            <input id="user_id" name="user_id" 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 type="radio" id="sex" name="1" />男
+                            <input type="radio" id="sex" name="0"  />女
+                        </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="mobile" name="mobile" 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="addAuth" 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">
+                    <input id="setStatus_add" name="status" />
+                  </div>
+                </div>
+              </li>
+              <li class="f_item">
+                <div class="box">
+                  <div class="f_label">
+                    <span>门店ID:</span>
+                  </div>
+                  <div class="box_flex f_content">
+                    <input id="owned_stores" name="owned_stores" />
+                  </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="desc" name="desc" />
+                  </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=rEmploye';
+  var status_data = <?php echo json_encode($status); ?>;
+  var auth = <?php echo json_encode($auth); ?>;
+  var jq_setStatus = $('#setStatus');
+  var jq_addAuth = $('#addAuth');
+  var w_width = $(window).width();
+  var w_height = $(window).height();
+  var jq_ss = $('#ss');
+  var jq_add_dialog = $('#add_dialog');
+  var jq_add_form = $('#add_form');
+
+  var jq_set_precedence = $('#set_precedence');
+  var tmp = 1;
+
+  var jq_acc = $('#acc_container');
+
+
+  $(function(){
+
+    jq_acc.accordion({
+      height: w_height - 18,
+      onSelect: function(title) {
+
+      }
+    });
+
+    jq_setStatus.combobox({
+      editable: false,
+      data: status_data,
+    });
+    jq_addAuth.combobox({
+      editable: false,
+      data: auth,
+    });
+
+
+
+    $('#pre_production_date').datetimebox({
+      required: false,
+      showSeconds:false,
+      //buttons:buttons_add,
+      // onSelect: function(date){
+      //     var currentDate = new Date();
+      //     $('#order_time_str_add').val(date.getTime()/1000);
+      // }
+    });
+    $('#production_date').datetimebox({
+      required: false,
+      showSeconds:false,
+      //buttons:buttons_add,
+      // onSelect: function(date){
+      //     var currentDate = new Date();
+      //     $('#order_time_str_add').val(date.getTime()/1000);
+      // }
+    });
+
+
+
+
+
+    var buttons = $.extend([], $.fn.datebox.defaults.buttons);
+    buttons[0].text = '确定';
+
+
+
+    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_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);
+      }
+    });
+
+    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:'user_name', title:'用户名', width:40,sortable:false
+        },
+        {field:'mobile', title:'联系方式', width:40,sortable:false},
+        {field:'status_str', title:'人员状态', width:40,sortable:true},
+        {field:'auth_str', title:'角色', width:40,sortable:false}
+      ]],
+
+      onSelect: function(index, row){
+        console.log(row)
+        $('#id_str').html(row.id);
+        $('#xorder_id').val(row.id);
+      },
+      onLoadSuccess : function () {
+        $('#id_str').html('');
+        $('#xorder_id').val('');
+        $('#setStatus').val(100);
+
+      }
+
+    });
+
+    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 ($('#xorder_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',
+      //url :'index.php?r=moonclub/xOrder/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'
+          });
+        }
+      }
+    });
+  });
+
+  function search_content(){
+
+    var filter_status = jq_filter_status.combobox('getValue');
+
+    jq_dg_content.datagrid({
+      pageNum: 1,
+      queryParams: {
+        status : filter_status
+      }
+    });
+
+  };
+
+  function checkAddForm () {
+
+    return true;
+  }
+
+  function add_content(){
+    jq_add_dialog.dialog('open');
+  }
+  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 save_content(){
+    $.messager.progress();
+    jq_content_form.submit();
+  }
+
+
+</script>

+ 595 - 0
www/protected/views/store/index.php

@@ -0,0 +1,595 @@
+<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">
+        <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="id" value='' />
+                      <span id="id_str"></span>
+                    </div>
+                  </div>
+                </li>
+                <li class="f_item">
+                  <div class="box">
+                    <div class="f_label">
+                      <span>门店ID: </span>
+                    </div>
+                    <div class="box_flex f_content">
+                      <span id="edit_store_id"></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="store_name" id="edit_store_name"  />
+                    </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="address" id="edit_address"  />
+                    </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="store_principal" id="edit_store_principal"  />
+                    </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="mobile" id="edit_mobile"  />
+                    </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" id="edit_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">
+                      <textarea name="content" id="edit_content" 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>门店ID: </span>
+            </div>
+            <div class="box_flex f_content">
+              <input type="number" name="store_id" id="add_store_id"  />
+            </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="store_name" id="add_store_name"  />
+            </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="address" id="add_address"  />
+            </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="store_principal" id="add_store_principal"  />
+            </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="mobile" id="add_mobile"  />
+            </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" id="add_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">
+              <textarea name="content" id="add_content" 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_add" name="status" />
+            </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=Store';
+  var status_data = <?php echo json_encode($status); ?>;
+  var jq_setStatus = $('#setStatus');
+  var w_width = $(window).width();
+  var w_height = $(window).height();
+  var jq_ss = $('#ss');
+  var jq_action_info = $('#action_info');
+
+  var jq_add_dialog = $('#add_dialog');
+  var jq_add_form = $('#add_form');
+
+
+  var jq_set_precedence = $('#set_precedence');
+
+
+  var jq_acc = $('#acc_container');
+
+  $(function(){
+
+    jq_acc.accordion({
+      height: w_height - 18,
+      onSelect: function(title) {
+
+      }
+    });
+
+
+
+    var buttons = $.extend([], $.fn.datebox.defaults.buttons);
+    buttons[0].text = '确定';
+
+    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:'store_id', title:'门店ID', width:25,sortable:true
+        },
+        {field:'store_name', title:'门店名称', width:25, sortable: true},
+        {field:'store_principal', title:'负责人', width:25,sortable:false},
+        {field:'status_str', title:'状态', width:50, sortable: true},
+        {field:'address', title:'地址', width:25,sortable:true}
+      ]],
+
+      onSelect: function(index, row){
+        var data = $.extend({}, row);
+        $('#id_str').html(data.id);
+        $('#edit_store_id').html(data.store_id);
+        jq_content_form.form('load', data);
+        $('#admins_edit_info').html('');
+        if (data['action_user'] != ''){
+          jq_action_info.html('信息已被编辑: ' + data['action_user'] + ' ' + data['action_time']);
+        } else {
+          jq_action_info.html('');
+        }
+
+      },
+      onLoadSuccess : function () {
+        $('#id_str').html('');
+        $('#edit_store_id').html('');
+        $('#edit_address').val('');
+        $('#edit_store_principal').val('');
+        $('#edit_mobile').val('');
+        $('#edit_store_name').val('');
+        $('#edit_desc').val('');
+        $('#edit_content').val('');
+        jq_content_form.form('load', '');
+
+        jq_action_info.html('');
+
+        jq_dg_content.datagrid('clearSelections');
+        jq_setStatus.combobox('setValue', 100);
+      }
+
+    });
+
+    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();
+    });
+    $('#add_coupon').change(function(){
+
+      $('#add_cash').hide();
+      $('#add_coupons').show();
+    });
+    $('#add_cash_back').change(function(){
+
+      $('#add_cash').show();
+      $('#add_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 search_content(){
+
+    var filter_status = jq_filter_status.combobox('getValue');
+
+    jq_dg_content.datagrid({
+      pageNum: 1,
+      queryParams: {
+        status : filter_status
+      }
+    });
+
+  };
+
+  function checkAddForm () {
+    return true;
+  }
+
+  function add_content(){
+    jq_add_dialog.dialog('open');
+  }
+
+</script>