parent
a0c3d5ea47
commit
dfdd5364f1
@ -0,0 +1,100 @@ |
||||
<?php |
||||
|
||||
namespace common\models; |
||||
|
||||
use Yii; |
||||
|
||||
/** |
||||
* This is the model class for table "gift_ticket_t_use". |
||||
* |
||||
* @property int $id |
||||
* @property string $code |
||||
* @property int $type_id |
||||
* @property int $group_id |
||||
* @property string $car_no |
||||
* @property string $input_date |
||||
* @property string $use_date |
||||
* @property string $end_date 有效期 |
||||
* @property int $status |
||||
* @property int $op_id |
||||
* @property string $created_at |
||||
* @property string $updated_at |
||||
*/ |
||||
class GiftTicketTUse extends \common\models\Base |
||||
{ |
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public static function tableName() |
||||
{ |
||||
return 'gift_ticket_t_use'; |
||||
} |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function rules() |
||||
{ |
||||
return [ |
||||
[['type_id'], 'required'], |
||||
[['type_id','status', 'op_id','gift_shuzi','order_id'], 'integer'], |
||||
[['input_date', 'use_date', 'end_date', 'created_at', 'updated_at'], 'safe'], |
||||
[['code'], 'string', 'max' => 100], |
||||
[['car_no'], 'string', 'max' => 50], |
||||
]; |
||||
} |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function attributeLabels() |
||||
{ |
||||
return [ |
||||
'id' => 'ID', |
||||
'code' => 'Code', |
||||
'type_id' => 'Type ID', |
||||
'group_id' => 'Group ID', |
||||
'car_no' => 'Car No', |
||||
'input_date' => 'Input Date', |
||||
'use_date' => 'Use Date', |
||||
'end_date' => 'End Date', |
||||
'status' => 'Status', |
||||
'op_id' => 'Op ID', |
||||
'created_at' => 'Created At', |
||||
'updated_at' => 'Updated At', |
||||
]; |
||||
} |
||||
public function getStatus() { |
||||
$type_id = $this->typeNew->type_id; |
||||
$status = $this->status; |
||||
|
||||
if($type_id == 1 && $status == 1) { |
||||
return '未出库'; |
||||
}elseif($type_id == 1 && $status == 3) { |
||||
return '已出库'; |
||||
}elseif($type_id == 2 && $status == 1){ |
||||
return '未使用'; |
||||
}elseif ($type_id == 2 && $status == 2){ |
||||
return '使用中'; |
||||
}elseif ($type_id == 2 && $status == 3){ |
||||
return '使用完'; |
||||
}else{ |
||||
return '未定义'; |
||||
} |
||||
} |
||||
public function getTypeNew() { |
||||
return $this->hasOne(GiftT::className(),['id'=>'type_id']); |
||||
} |
||||
|
||||
|
||||
public function getUser() { |
||||
return $this->hasOne(UserT::className(),['id'=>'user_id']); |
||||
} |
||||
public function getOp() { |
||||
return $this->hasOne(UserT::className(),['id'=>'op_id']); |
||||
} |
||||
|
||||
public function getOrder(){ |
||||
return $this->hasOne(OrderT::className(),['id'=>'order_id']); |
||||
} |
||||
} |
@ -0,0 +1,117 @@ |
||||
<?php |
||||
|
||||
namespace common\models; |
||||
|
||||
use Yii; |
||||
|
||||
/** |
||||
* This is the model class for table "zhongji_tiaojian". |
||||
* |
||||
* @property int $id |
||||
* @property string $baofei 保费限制 |
||||
* @property string $xianzhong_one n选一险种 |
||||
* @property string $xianzhong_two n选2险种 |
||||
* @property string $car_type_id 车辆类型 |
||||
* @property string $car_use_id 车辆使用性质 |
||||
* @property string $max_cashback 返现最大额度 |
||||
* @property int $type 1返现2提成3礼品4礼券 |
||||
* @property string $created_at |
||||
* @property string $updated_at |
||||
*/ |
||||
class ZhongjiTiaojian extends \common\models\Base |
||||
{ |
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public $faxianxianzhong_arr; |
||||
public $faxianxianzhong_rate_arr; |
||||
public $faxianxianzhong2_arr; |
||||
public $faxianxianzhong1_arr; |
||||
public $tichengXianzhong_arr; |
||||
public $tichengXianzhong1_arr; |
||||
public $tichengXianzhong2_arr; |
||||
public $tichengXianzhong_rate_arr; |
||||
public $gift_none_arr; |
||||
public $gift_none_arr_two; |
||||
public $gift_none_arr_three; |
||||
public $gift_none_arr_four; |
||||
public $gift_free_arr; |
||||
public $gift_free_num_arr; |
||||
public $gift_money_arr; |
||||
public $gift_money_price_arr; |
||||
public $gift_money_num_arr; |
||||
public $quan_none_arr; |
||||
public $quan_none_arr_two; |
||||
public $quan_none_arr_three; |
||||
public $quan_none_arr_four; |
||||
public $quan_free_arr; |
||||
public $quan_free_num_arr; |
||||
public $quan_money_arr; |
||||
public $quan_money_price_arr; |
||||
public $quan_money_num_arr; |
||||
|
||||
public $gift_none_arr_id; |
||||
public $gift_none_arr_two_id; |
||||
public $gift_none_arr_three_id; |
||||
public $gift_none_arr_four_id; |
||||
public $gift_free_arr_id; |
||||
public $gift_money_arr_id; |
||||
|
||||
public $quan_none_arr_id; |
||||
public $quan_none_arr_two_id; |
||||
public $quan_none_arr_three_id; |
||||
public $quan_none_arr_four_id; |
||||
public $quan_free_arr_id; |
||||
public $quan_money_arr_id; |
||||
|
||||
public $fanxian_kehu_id; |
||||
public $fanxian_zuigao_id; |
||||
|
||||
|
||||
|
||||
|
||||
public static function tableName() |
||||
{ |
||||
return 'zhongji_tiaojian'; |
||||
} |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function rules() |
||||
{ |
||||
return [ |
||||
[['celuo_id'], 'integer'], |
||||
[['baofei'], 'number'], |
||||
[['type'], 'integer'], |
||||
[['created_at', 'updated_at'], 'safe'], |
||||
[['xianzhong_one', 'xianzhong_two', 'car_type_id', 'car_use_id'], 'string', 'max' => 50], |
||||
]; |
||||
} |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function attributeLabels() |
||||
{ |
||||
return [ |
||||
'id' => 'ID', |
||||
'baofei' => 'Baofei', |
||||
'xianzhong_one' => 'Xianzhong One', |
||||
'xianzhong_two' => 'Xianzhong Two', |
||||
'car_type_id' => 'Car Type ID', |
||||
'car_use_id' => 'Car Use ID', |
||||
'type' => 'Type', |
||||
'created_at' => 'Created At', |
||||
'updated_at' => 'Updated At', |
||||
]; |
||||
} |
||||
public function getFanxian() |
||||
{ |
||||
return $this->hasMany(ZhongjiFanxianT::className(),['tiaojian_id'=>'id']); |
||||
} |
||||
public function getTicheng() |
||||
{ |
||||
return $this->hasMany(ZhongjiTichengT::className(),['tiaojian_id'=>'id']); |
||||
} |
||||
} |
@ -0,0 +1,159 @@ |
||||
<?php |
||||
|
||||
namespace common\models; |
||||
|
||||
use Yii; |
||||
|
||||
/** |
||||
* This is the model class for table "zhongji_yingxiao". |
||||
* |
||||
* @property int $id |
||||
* @property string $celuo_name 策略名字 |
||||
* @property string $begin_date |
||||
* @property string $end_date |
||||
* @property string $baofei 保费额度 |
||||
* @property int $xianzhong_one 险种n选1 |
||||
* @property string $xianzhong_two 险种n选2 |
||||
* @property int $car_type_id 车辆类型 |
||||
* @property int $car_use_id 车辆使用性质 |
||||
* @property string $created_at |
||||
* @property string $updated_at |
||||
*/ |
||||
class ZhongjiYingxiao extends \common\models\Base |
||||
{ |
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public static function tableName() |
||||
{ |
||||
return 'zhongji_yingxiao'; |
||||
} |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function rules() |
||||
{ |
||||
return [ |
||||
[['begin_date', 'end_date', 'created_at', 'updated_at'], 'safe'], |
||||
[['baofei'], 'number'], |
||||
[['celuo_name','xianzhong_one', 'xianzhong_two', 'car_type_id', 'car_use_id'], 'string', 'max' => 50], |
||||
]; |
||||
} |
||||
|
||||
/** |
||||
* {@inheritdoc} |
||||
*/ |
||||
public function attributeLabels() |
||||
{ |
||||
return [ |
||||
'id' => 'ID', |
||||
'celuo_name' => 'Celuo Name', |
||||
'begin_date' => 'Begin Date', |
||||
'end_date' => 'End Date', |
||||
'baofei' => 'Baofei', |
||||
'xianzhong_one' => 'Xianzhong One', |
||||
'xianzhong_two' => 'Xianzhong Two', |
||||
'car_type_id' => 'Car Type ID', |
||||
'car_use_id' => 'Car Use ID', |
||||
'created_at' => 'Created At', |
||||
'updated_at' => 'Updated At', |
||||
]; |
||||
} |
||||
|
||||
// public function getId() |
||||
// { |
||||
// return $this->id; |
||||
// } |
||||
public function getFanxian() |
||||
{ |
||||
return $this->hasMany(ZhongjiFanxianT::className(),['celuo_id'=>'id']); |
||||
} |
||||
|
||||
public function getKehufanxian() |
||||
{ |
||||
return ZhongjiFanxianT::find()->where(['celuo_id'=>$this->id,'fanxian_type'=>1])->one(); |
||||
|
||||
} |
||||
|
||||
public function getXianzhongfanxian($id) |
||||
{ |
||||
return ZhongjiFanxianT::find()->where(['celuo_id'=>$id,'fanxian_type'=>2])->all(); |
||||
} |
||||
|
||||
public function getXianzhongfanxianTwo($id) |
||||
{ |
||||
return ZhongjiFanxianT::find()->where(['celuo_id'=>$id,'fanxian_type'=>3])->one(); |
||||
} |
||||
public function getXianzhongfanxianOne($id) |
||||
{ |
||||
return ZhongjiFanxianT::find()->where(['celuo_id'=>$id,'fanxian_type'=>5])->one(); |
||||
} |
||||
public function getnogift($id = 0) |
||||
{ |
||||
return ZhongjiFanxianT::find()->where(['celuo_id'=>$this->id,'fanxian_type'=>4])->one(); |
||||
} |
||||
|
||||
public function getKehuticheng($id) |
||||
{ |
||||
return ZhongjiTichengT::find()->where(['celuo_id'=>$id,'ticheng_type'=>1])->one(); |
||||
} |
||||
public function getOnlineticheng($id) |
||||
{ |
||||
return ZhongjiTichengT::find()->where(['celuo_id'=>$id,'ticheng_type'=>2])->one(); |
||||
} |
||||
public function getXianzhongticheng($id) |
||||
{ |
||||
return ZhongjiTichengT::find()->where(['celuo_id'=>$id,'ticheng_type'=>3])->all(); |
||||
} |
||||
|
||||
public function getXianzhongtichengTwo($id) |
||||
{ |
||||
return ZhongjiTichengT::find()->where(['celuo_id'=>$id,'ticheng_type'=>4])->one(); |
||||
} |
||||
public function getXianzhongtichengOne($id) |
||||
{ |
||||
return ZhongjiTichengT::find()->where(['celuo_id'=>$id,'ticheng_type'=>5])->one(); |
||||
} |
||||
public function getnogiftTicheng($id) |
||||
{ |
||||
return ZhongjiTichengT::find()->where(['celuo_id'=>$id,'ticheng_type'=>6])->one(); |
||||
} |
||||
public function getGiftNonetwo($id) |
||||
{ |
||||
return ZhongjiGiftT::find()->where(['celuo_id'=>$id,'gift_type'=>1,'free_type'=>4])->all(); |
||||
} |
||||
public function getQuanNonetwo($id) |
||||
{ |
||||
return ZhongjiGiftT::find()->where(['celuo_id'=>$id,'gift_type'=>2,'free_type'=>4])->all(); |
||||
} |
||||
public function getGiftNone($id) |
||||
{ |
||||
return ZhongjiGiftT::find()->where(['celuo_id'=>$id,'gift_type'=>1,'free_type'=>3])->all(); |
||||
} |
||||
public function getQuanNone($id) |
||||
{ |
||||
return ZhongjiGiftT::find()->where(['celuo_id'=>$id,'gift_type'=>2,'free_type'=>3])->all(); |
||||
} |
||||
public function getGiftfree($id) |
||||
{ |
||||
return ZhongjiGiftT::find()->where(['celuo_id'=>$id,'gift_type'=>1,'free_type'=>1])->all(); |
||||
} |
||||
public function getQuanfree($id) |
||||
{ |
||||
return ZhongjiGiftT::find()->where(['celuo_id'=>$id,'gift_type'=>2,'free_type'=>1])->all(); |
||||
} |
||||
public function getGiftMoney($id) |
||||
{ |
||||
return ZhongjiGiftT::find()->where(['celuo_id'=>$id,'gift_type'=>1,'free_type'=>2])->all(); |
||||
} |
||||
public function getQuanMoney($id) |
||||
{ |
||||
return ZhongjiGiftT::find()->where(['celuo_id'=>$id,'gift_type'=>2,'free_type'=>2])->all(); |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,107 @@ |
||||
<?php |
||||
|
||||
|
||||
namespace frontend\controllers; |
||||
|
||||
|
||||
use common\models\ZhongjiYingxiao; |
||||
use yii\web\Response; |
||||
use Yii; |
||||
|
||||
class MarketingStrategyController extends UserBaseController |
||||
{ |
||||
public $enableCsrfValidation = false; |
||||
public $layout = 'blue-main'; |
||||
|
||||
public function actionIndex() { |
||||
return $this->render('index'); |
||||
} |
||||
|
||||
public function actionIndexJson() { |
||||
Yii::$app->response->format = Response::FORMAT_JSON; |
||||
$request = Yii::$app->request; |
||||
$offset = $request->get('offset',0); |
||||
$limit = $request->get('limit', 10); |
||||
|
||||
$query = ZhongjiYingxiao::find() |
||||
->where('is_delete=0') |
||||
->orderBy('id desc'); |
||||
|
||||
$total = $query->count(); |
||||
|
||||
$query = $query->offset($offset)->limit($limit); |
||||
$items = $query->all(); |
||||
|
||||
$data = []; |
||||
$data['total'] = $total; |
||||
$data['rows'] = []; |
||||
foreach($items as $item) { |
||||
$row = $item->toArray(); |
||||
$data['rows'][] = $row; |
||||
} |
||||
|
||||
return $data; |
||||
} |
||||
|
||||
public function actionAdd() { |
||||
return $this->render('add'); |
||||
} |
||||
|
||||
public function actionEdit() { |
||||
$request = Yii::$app->request; |
||||
$id = $request->get('id'); |
||||
$info = ZhongjiYingxiao::findOne(['id'=>$id]); |
||||
|
||||
return $this->render('edit', [ |
||||
'info' => $info |
||||
]); |
||||
} |
||||
|
||||
public function actionSave() { |
||||
Yii::$app->response->format = Response::FORMAT_JSON; |
||||
$request = Yii::$app->request; |
||||
$result = array(); |
||||
$result['success'] = false; |
||||
$result['msg'] = '保存失败'; |
||||
|
||||
if($request->isPost) { |
||||
$op = $request->post('op', 'add'); |
||||
$name = $request->post('name'); |
||||
$begin_date = $request->post('begin_date'); |
||||
$begin_time = $request->post('begin_time'); |
||||
$end_date = $request->post('end_date'); |
||||
$end_time = $request->post('end_time'); |
||||
$remark = $request->post('remark'); |
||||
|
||||
if($op == 'add') { |
||||
$item = new ZhongjiYingxiao(); |
||||
$item->celuo_name = $name; |
||||
$item->begin_date = $begin_date.' '.$begin_time.':00'; |
||||
$item->end_date = $end_date.' '.$end_time.':00'; |
||||
$item->is_delete = 0; |
||||
$item->remark = $remark; |
||||
$item->save(); |
||||
|
||||
$result['success'] = true; |
||||
$result['msg'] = '保存成功'; |
||||
return $result; |
||||
} else { |
||||
$id = $request->post('id'); |
||||
$item = ZhongjiYingxiao::findOne(['id'=>$id]); |
||||
if($item) { |
||||
$item->celuo_name = $name; |
||||
$item->begin_date = $begin_date.' '.$begin_time.':00'; |
||||
$item->end_date = $end_date.' '.$end_time.':00'; |
||||
$item->remark = $remark; |
||||
$item->save(); |
||||
|
||||
$result['success'] = true; |
||||
$result['msg'] = '保存成功'; |
||||
return $result; |
||||
} |
||||
} |
||||
} |
||||
return $result; |
||||
|
||||
} |
||||
} |
@ -0,0 +1,121 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-content"> |
||||
<form role="form" class="form-horizontal" id="searchFrm" onsubmit="return search();"> |
||||
<div class="form-group"> |
||||
<label class="control-label col-sm-1">车牌</label> |
||||
<div class="col-sm-3"> |
||||
<input type="text" id="car_no" name="car_no" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-sm-1">发动机号</label> |
||||
<div class="col-sm-3"> |
||||
<input type="text" id="engine_no" name="engine_no" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-sm-1">车架号</label> |
||||
<div class="col-sm-3"> |
||||
<input type="text" id="car_frame_no" name="car_frame_no" class="form-control"> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="control-label col-sm-1">车主</label> |
||||
<div class="col-sm-3"> |
||||
<input type="text" id="car_man" name="car_man" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-sm-1">联系电话</label> |
||||
<div class="col-sm-3"> |
||||
<input type="text" id="phone" name="phone" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-sm-1">保险公司</label> |
||||
<div class="col-sm-3"> |
||||
<input type="text" id="company" name="company" class="form-control"> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="control-label col-sm-1">初登日期</label> |
||||
<div class="col-sm-3"> |
||||
<div class="input-daterange input-group" id="datepicker"> |
||||
<input type="text" class="input-sm form-control" name="register_begin" value="" autocomplete="off" /> |
||||
<span class="input-group-addon">到</span> |
||||
<input type="text" class="input-sm form-control" name="register_end" value="" autocomplete="off" /> |
||||
</div> |
||||
</div> |
||||
<label class="control-label col-sm-1">保险日期</label> |
||||
<div class="col-sm-3"> |
||||
<div class="input-daterange input-group" id="datepicker"> |
||||
<input type="text" class="input-sm form-control" name="insurer1_begin" value="" autocomplete="off" /> |
||||
<span class="input-group-addon">到</span> |
||||
<input type="text" class="input-sm form-control" name="insurer1_end" value="" autocomplete="off" /> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="control-label col-sm-1">范围</label> |
||||
<div class="col-sm-11"> |
||||
<div class="checkbox checkbox-inline"> |
||||
<input type="checkbox" name="b_lib" id="b_lib" value="1"> |
||||
<label for="b_lib">B库</label> |
||||
</div> |
||||
<div class="checkbox checkbox-inline"> |
||||
<input type="checkbox" name="c_lib" id="c_lib" value="1"> |
||||
<label for="c_lib">C库</label> |
||||
</div> |
||||
<div class="checkbox checkbox-inline"> |
||||
<input type="checkbox" name="d_lib" id="d_lib" value="1"> |
||||
<label for="d_lib">D库</label> |
||||
</div> |
||||
<div class="checkbox checkbox-inline"> |
||||
<input type="checkbox" name="e_lib" id="e_lib" value="1"> |
||||
<label for="e_lib">E库</label> |
||||
</div> |
||||
<div class="checkbox checkbox-inline"> |
||||
<input type="checkbox" name="invalid_lib" id="invalid_lib" value="1"> |
||||
<label for="invalid_lib">无效库</label> |
||||
</div> |
||||
<div class="checkbox checkbox-inline"> |
||||
<input type="checkbox" name="unsel_lib" id="unsel_lib" value="1"> |
||||
<label for="unsel_lib">未分配</label> |
||||
</div> |
||||
<div class="checkbox checkbox-inline"> |
||||
<input type="checkbox" name="has_phone" id="has_phone" value="1"> |
||||
<label for="has_phone">有电话号码</label> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<div class="col-sm-3 col-sm-offset-5"> |
||||
<button type="submit" class="btn btn-primary">搜索</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script type="text/javascript" language="javascript"> |
||||
function search() { |
||||
var o = {}; |
||||
var params = $("#searchFrm").serializeArray(); |
||||
$.each(params, function(index) { |
||||
o[this['name']] = this['value']; |
||||
}); |
||||
parent.o = o; |
||||
parent.refreshList(); |
||||
layer_close(); |
||||
} |
||||
|
||||
$(function () { |
||||
$('.input-daterange').datepicker({ |
||||
keyboardNavigation: false, |
||||
forceParse: false, |
||||
autoclose: true |
||||
}); |
||||
}) |
||||
</script> |
||||
<?php $this->endBlock('footer_js'); ?> |
@ -1,302 +1,193 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<style> |
||||
.act_btn1{ |
||||
width: 120px; |
||||
background-repeat: round; |
||||
} |
||||
</style> |
||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/func.js"></script> |
||||
<script type="text/javascript" language="javascript"> |
||||
//编辑 |
||||
function edit(id) { |
||||
var params = $('#searchForm').serialize(); |
||||
window.location.href = '/car/edit?id=' + id + '&back_params=' + encodeURIComponent(params); |
||||
} |
||||
//删除 |
||||
function del(id) { |
||||
if(confirm('是否确认删除?')) { |
||||
$.post('/car/delete',{id:id},function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
} |
||||
},'json'); |
||||
} |
||||
} |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
$(function(){ |
||||
$("#search-btn").click(function(){ |
||||
$('#page').val(0); |
||||
var params = $('#searchForm').serialize(); |
||||
window.location.href = "/database/a-index?" + params; |
||||
}); |
||||
$('#add-btn').click(function(){ |
||||
edit(0); |
||||
}); |
||||
$('#move-b-btn').click(function(){ |
||||
var unsel_lib = $('#unsel_lib').attr('checked'); |
||||
if(unsel_lib != 'checked') { |
||||
alert('请先选择未分配选项'); |
||||
return; |
||||
} |
||||
if(confirm('是否确认批量分配操作?')) { |
||||
var params = $('#searchForm').serialize(); |
||||
$.post('/database/a-move-b',params,function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title"> |
||||
<h5>A库</h5> |
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)"> |
||||
<i class="fa fa-plus"></i> 添加 |
||||
</a> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="searchDlg()"> |
||||
<i class="fa fa-search"></i> 搜索 |
||||
</a> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||
<i class="fa fa-refresh"></i> 刷新 |
||||
</a> |
||||
</div> |
||||
</div> |
||||
<div class="ibox-content"> |
||||
<form role="form" class="form-horizontal" onsubmit="return search();"> |
||||
<div class="form-group"> |
||||
<div class="col-sm-8"> |
||||
<button type="button" class="btn btn-primary btn-a-b">勾选A->B</button> |
||||
<button type="button" class="btn btn-primary btn-a-c">勾选A->C</button> |
||||
<button type="button" class="btn btn-primary btn-a-b-all">批量A->B</button> |
||||
<button type="button" class="btn btn-danger btn-clear">清空搜索条件</button> |
||||
</div> |
||||
<div class="col-sm-4"> |
||||
<div class="col-sm-8"> |
||||
<select class="form-control"> |
||||
<option value="0">请先把无效理由</option> |
||||
<?php foreach($invalid_items as $item) { |
||||
echo '<option value="'.$item->id.'">'.$item->name.'</option>'; |
||||
} |
||||
},'json'); |
||||
?> |
||||
</select> |
||||
</div> |
||||
<div class="col-sm-4"> |
||||
<button type="button" class="btn btn-primary">无效数据</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<table id="listTable"> |
||||
<thead> |
||||
<tr> |
||||
<th data-field="state" data-checkbox="true"></th> |
||||
<th width="50" data-field="id">ID</th> |
||||
<th data-field="car_no">车牌</th> |
||||
<th data-field="factory_model">车型</th> |
||||
<th data-field="car_man">车主</th> |
||||
<th data-field="phone">联系电话</th> |
||||
<th data-field="register_date">初登日期</th> |
||||
<th data-field="insurer1_date">保险日期</th> |
||||
<th data-field="company">保险公司</th> |
||||
<th data-field="engine_no">发动机号</th> |
||||
<th data-field="car_frame_no">车架号</th> |
||||
<th data-field="location">位置</th> |
||||
<th data-formatter="opFormatter">操作</th> |
||||
</tr> |
||||
</thead> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||
<script> |
||||
var o = {}; |
||||
function opFormatter(value, row, index) { |
||||
var opStr = []; |
||||
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-edit" title="编辑"></i>'); |
||||
opStr.push('</a>'); |
||||
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-trash" title="删除"></i>'); |
||||
opStr.push('</a>'); |
||||
|
||||
return opStr.join(' '); |
||||
} |
||||
}); |
||||
$('#move-e-btn').click(function(){ |
||||
var unsel_lib = $('#unsel_lib').attr('checked'); |
||||
if(unsel_lib != 'checked') { |
||||
alert('请先选择未分配选项'); |
||||
return; |
||||
function create() { |
||||
title = '新增车辆'; |
||||
layer_show(title, '/car/edit?id=0'); |
||||
} |
||||
if(confirm('是否确认批量分配操作?')) { |
||||
var params = $('#searchForm').serialize(); |
||||
$.post('/database/a-move-e',params,function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
function searchDlg() { |
||||
title = '综合搜索'; |
||||
layer_show(title, '/database/a-search'); |
||||
} |
||||
},'json'); |
||||
function edit(id) { |
||||
var title = '编辑车辆'; |
||||
layer_show(title, '/car/edit?id=' + id); |
||||
} |
||||
function del(id) { |
||||
parent.layer.confirm('是否确认删除?', { |
||||
btn: ['删除','取消'], //按钮 |
||||
shade: false //不显示遮罩 |
||||
}, function(){ |
||||
$.post('/car/delete',{id:id},function(data) { |
||||
parent.layer.msg(data.msg); |
||||
if(data.success == true) { |
||||
refreshList(); |
||||
} |
||||
}, 'json'); |
||||
}, function(){ |
||||
// |
||||
}); |
||||
$('#move-right-btn').click(function(){ |
||||
var unsel_lib = $('#unsel_lib').attr('checked'); |
||||
if(unsel_lib != 'checked') { |
||||
alert('请先选择未分配选项'); |
||||
return; |
||||
} |
||||
if(confirm('是否确认批量分配操作?')) { |
||||
var params = $('#searchForm').serialize(); |
||||
$.post('/database/a-move-clean',params,function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
|
||||
function refreshList() { |
||||
$('#listTable').bootstrapTable('refresh'); |
||||
} |
||||
},'json'); |
||||
|
||||
function search() { |
||||
$('#listTable').bootstrapTable('destroy'); |
||||
$('#listTable').bootstrapTable({ |
||||
url: "/database/a-index-json", |
||||
pagination: true, |
||||
sidePagination: 'server', |
||||
multipleSelectRow: true, |
||||
queryParams: function(params) { |
||||
o['limit'] = params['limit']; |
||||
o['offset'] = params['offset']; |
||||
return o; |
||||
} |
||||
}); |
||||
$('#move-btn').click(function(){ |
||||
if(confirm('是否确认 A->B 操作?')) { |
||||
var params = $('#listFrm').serialize(); |
||||
$.post('/database/a-b',params,function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
} |
||||
},'json'); |
||||
} |
||||
|
||||
$(function() { |
||||
search(); |
||||
|
||||
$('.btn-a-b').click(function(){ |
||||
var rows = $('#listTable').bootstrapTable('getSelections'); |
||||
var params = []; |
||||
rows.forEach(function(item,index,array){ |
||||
params.push(item.id); |
||||
}); |
||||
$('#clean-btn').click(function(){ |
||||
if(confirm('是否确认 A->清洗库 操作?')) { |
||||
var params = $('#listFrm').serialize(); |
||||
$.post('/database/a-clean',params,function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
$.post('/database/a-b', {ids:params.join(',')}, function(data) { |
||||
parent.layer.msg(data.msg); |
||||
if(data.success == true) { |
||||
refreshList(); |
||||
} |
||||
},'json'); |
||||
} |
||||
}); |
||||
$('#move-a2c-btn').click(function(){ |
||||
if(confirm('是否确认 A->C 操作?')) { |
||||
var params = $('#listFrm').serialize(); |
||||
$.post('/database/a-c',params,function(obj){ |
||||
alert(obj.msg); |
||||
$('.btn-a-b-all').click(function() { |
||||
layer.confirm('是否确认批量移动?', { |
||||
btn: ['确认','取消'], //按钮 |
||||
shade: false //不显示遮罩 |
||||
}, function(){ |
||||
var params = o; |
||||
$.post('/database/a-b-all',params,function(obj){ |
||||
layer.msg(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
layer.msg('保存成功'); |
||||
search(); |
||||
} |
||||
},'json'); |
||||
} |
||||
}, function(){ |
||||
// |
||||
}); |
||||
$('#move-a2e-btn').click(function(){ |
||||
if(confirm('是否确认 A->E 操作?')) { |
||||
var params = $('#listFrm').serialize(); |
||||
$.post('/database/a-e',params,function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
} |
||||
},'json'); |
||||
} |
||||
}); |
||||
$('.invalid-btn').click(function(){ |
||||
if(confirm('是否确认无效?')) { |
||||
var params = $('#listFrm').serialize(); |
||||
var invalid_id = $('#invalid_id').val(); |
||||
params = params + '&invalid_id=' + invalid_id; |
||||
$.post('/database/invalid',params,function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
$('.btn-a-c').click(function() { |
||||
var rows = $('#listTable').bootstrapTable('getSelections'); |
||||
var params = []; |
||||
rows.forEach(function(item,index,array){ |
||||
params.push(item.id); |
||||
}); |
||||
$.post('/database/a-c', {ids:params.join(',')}, function(data) { |
||||
parent.layer.msg(data.msg); |
||||
if(data.success == true) { |
||||
refreshList(); |
||||
} |
||||
},'json'); |
||||
} |
||||
}); |
||||
/* |
||||
$("#output-btn").click(function(){ |
||||
$('#page').val(0); |
||||
var params = $('#searchForm').serialize(); |
||||
window.open("/database/a-index-output?" + params); |
||||
}); |
||||
*/ |
||||
$('#all').click(function(){ |
||||
if($(this).prop('checked')==true) { |
||||
$('.item').each(function() { |
||||
$(this).prop('checked', true); |
||||
}); |
||||
} else { |
||||
$('.item').each(function () { |
||||
$(this).prop('checked',false); |
||||
}); |
||||
} |
||||
$('.btn-clear').click(function() { |
||||
o = {}; |
||||
search(); |
||||
}); |
||||
}); |
||||
</script> |
||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
||||
<form id="searchForm"> |
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<tr> |
||||
<td class="td_bg"> |
||||
车牌:<input name="car_no" type="text" value="<?=$car_no?>" style="width:100px;">
|
||||
发动机号:<input name="engine_no" type="text" value="<?=$engine_no?>" style="width:100px;">
|
||||
车架号:<input name="car_frame_no" type="text" value="<?=$car_frame_no?>" style="width:100px;">
|
||||
车主:<input name="car_man" type="text" value="<?=$car_man?>" style="width:100px;">
|
||||
联系电话:<input name="phone" type="text" value="<?=$phone?>" style="width:100px;">
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="td_bg"> |
||||
初登日期:从<input class="act_date" name="register_begin" type="text" value="<?=$register_begin?>" onclick="WdatePicker()">至<input class="act_date" name="register_end" type="text" value="<?=$register_end?>" onclick="WdatePicker()">截止
|
||||
<!-- 保险日期:从<input class="act_date" name="insurer1_begin" type="text" value="--><?//=$insurer1_begin?><!--" onclick="WdatePicker()">至<input class="act_date" name="insurer1_end" type="text" value="--><?//=$insurer1_end?><!--" onclick="WdatePicker()">截止-->
|
||||
保险日期: |
||||
<input name="insurer1_month" class="day_date" type="text" value="<?=$insurer1_month?>" style="width:30px;" placeholder="月份">月
|
||||
<input name="insurer1_day" class="day_date" type="text" value="<?=$insurer1_day?>" style="width:30px;" placeholder="天数">日
|
||||
至 |
||||
<input name="insurer1_month1" class="day_date" type="text" value="<?=$insurer1_month1?>" style="width:30px;" placeholder="月份">月
|
||||
<input name="insurer1_day1" class="day_date" type="text" value="<?=$insurer1_day1?>" style="width:30px;" placeholder="天数">日
|
||||
|
||||
<!-- 从<input class="act_date" name="insurer1_begin" type="text" value="--><?//=$insurer1_begin?><!--" onclick="WdatePicker()">至<input class="act_date" name="insurer1_end" type="text" value="--><?//=$insurer1_end?><!--" onclick="WdatePicker()">截止-->
|
||||
保险公司:<input name="company" type="text" value="<?=$company?>" style="width:100px;">
|
||||
<!-- <input type="checkbox" name="clean_right" value="1" --=$lean_right?'checked':'清洗岗准确--> |
||||
<!-- <input type="checkbox" name="biaozhu" value="2019417" --//=$biaozhu?'checked':''--特殊数据--> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="td_bg"> |
||||
范围: |
||||
<label> |
||||
<input type="checkbox" name="b_lib" value="1" <?=$b_lib?'checked':''?>>B库
|
||||
</label> |
||||
<label> |
||||
<input type="checkbox" name="c_lib" value="1" <?=$c_lib?'checked':''?>>C库
|
||||
</label> |
||||
<label> |
||||
<input type="checkbox" name="d_lib" value="1" <?=$d_lib?'checked':''?>>D库
|
||||
</label> |
||||
<!-- <label>--> |
||||
<!-- <input type="checkbox" name="e_lib" value="1" --/=$e_lib?'checked':''-E库--> |
||||
<!-- </label>--> |
||||
<label> |
||||
<input type="checkbox" name="invalid_lib" value="1" <?=$invalid_lib?'checked':''?>>无效库
|
||||
</label> |
||||
<label> |
||||
<input type="checkbox" name="unsel_lib" id="unsel_lib" value="1" <?=$unsel_lib?'checked':''?>>未分配
|
||||
</label> |
||||
<label> |
||||
<input type="checkbox" name="has_phone" value="1" <?=$has_phone==1?'checked':''?>>有电话号码
|
||||
</label> |
||||
<label> |
||||
<input type="checkbox" name="no_insurerdate" value="1" <?=$no_insurerdate==1?'checked':''?>>无保险日期
|
||||
</label> |
||||
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="td_bg"> |
||||
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加"> |
||||
<input type="button" class="act_btn" id="move-btn" name="move-btn" value="勾选A库到B库"> |
||||
<input type="button" class="act_btn" id="move-a2c-btn" name="move-a2c-btn" value="勾选A库到C库"> |
||||
<!-- <input type="button" class="act_btn" id="move-a2e-btn" name="move-a2e-btn" value="勾选A库到E库">--> |
||||
<input type="button" class="act_btn" id="move-b-btn" name="move-b-btn" value="批量移到B库"> |
||||
<!-- <input type="button" class="act_btn" id="move-e-btn" name="move-e-btn" value="批量移到E库">--> |
||||
<!-- <input type="button" class="act_btn" id="move-right-btn" name="move-right-btn" value="批量移到清洗库">--> |
||||
<!-- <input type="button" class="act_btn act_btn1" id="clean-btn" name="clean-btn" value="勾选A库到清洗库">--> |
||||
<select name="invalid_id" id="invalid_id"> |
||||
<option value="0">请选择无效理由</option> |
||||
<?php |
||||
foreach($invalid_items as $item) { |
||||
echo '<option value="'.$item->id.'">'.$item->name.'</option>'; |
||||
} |
||||
?> |
||||
</select> |
||||
<input type=button class="ACT_btn invalid-btn" name="invalid-btn" value=" 无效数据 "/> |
||||
</td> |
||||
</tr> |
||||
</form> |
||||
</table> |
||||
<form id="listFrm"> |
||||
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> |
||||
<tr> |
||||
<td align="center" width="24" align="center" class="bg_tr"><input type="checkbox" id="all"></td> |
||||
<td width="78" align="center" align="center" class="bg_tr" nowrap>车牌</td> |
||||
<td width="78" align="center" align="center" class="bg_tr" nowrap>车型</td> |
||||
<td width="78" align="center" align="center" class="bg_tr" nowrap>车主</td> |
||||
<td width="78" align="center" align="center" class="bg_tr" nowrap>联系电话</td> |
||||
<td width="78" align="center" align="center" class="bg_tr" nowrap>初登日期</td> |
||||
<td width="78" align="center" align="center" class="bg_tr" nowrap>保险日期</td> |
||||
<td width="78" align="center" align="center" class="bg_tr" nowrap>保险公司</td> |
||||
<td width="78" align="center" align="center" class="bg_tr" nowrap>发动机号</td> |
||||
<td width="96" align="center" align="center" class="bg_tr" nowrap>车架号</td> |
||||
<td width="78" align="center" align="center" class="bg_tr" nowrap>位置</td> |
||||
<td width="50" align="center" align="center" class="bg_tr" nowrap>操作</td> |
||||
</tr> |
||||
<?php |
||||
foreach($items as $index => $item) { |
||||
?> |
||||
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)> |
||||
<td align="center" class="td_bg"nowrap ><input class="item" type="checkbox" name="ids[]" value="<?=$item->id?>"></td>
|
||||
<td align="left" class="td_bg"nowrap><?=$item->car_no?></td>
|
||||
<td align="left" class="td_bg"nowrap ><?=MyLib::substr_cut($item->factory_model,10)?></td>
|
||||
<td align="left" class="td_bg"nowrap ><?=MyLib::substr_cut($item->car_man,10)?></td>
|
||||
<td align="left" class="td_bg"nowrap ><?=$item->phone?></td>
|
||||
<td align="left" class="td_bg"nowrap ><?=$item->register_date?></td>
|
||||
<td align="left" class="td_bg"nowrap ><?=$item->insurer1_date?></td>
|
||||
<td align="left" class="td_bg"nowrap ><?=$item->company?></td>
|
||||
<td align="left" class="td_bg"nowrap ><?=$item->engine_no?></td>
|
||||
<td align="left" class="td_bg"nowrap ><?=$item->car_frame_no?></td>
|
||||
<td align="center" class="td_bg"nowrap ><?=$item->getLocation()?></td>
|
||||
<td align="center" class="td_bg" nowrap> |
||||
[<a href="javascript:void(0);" onclick="edit(<?=$item->id?>)">修改</a>]
|
||||
<?php |
||||
if($item->location == 1) { |
||||
?> |
||||
[<a href="javascript:void(0);" onclick="del(<?=$item->id?>)">删除</a>]
|
||||
<?php |
||||
} |
||||
?> |
||||
</td> |
||||
</tr> |
||||
<?php |
||||
} |
||||
?> |
||||
<tr > |
||||
<td height="25" colspan="12" align="center" class="td_bg"><?=$page_info?></td>
|
||||
</tr> |
||||
</table> |
||||
</form> |
||||
<script> |
||||
function test() { |
||||
alert(1); |
||||
} |
||||
</script> |
||||
<?php $this->endBlock(); ?> |
||||
|
@ -1,43 +0,0 @@ |
||||
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> |
||||
<tr> |
||||
<td width="50" align="center" class="bg_tr" nowrap>序号</td> |
||||
<td width="80" align="center" class="bg_tr" nowrap>礼品名称</td> |
||||
<td width="80" align="center" class="bg_tr" nowrap>类型</td> |
||||
<td width="50%" align="center" class="bg_tr" nowrap>描述</td> |
||||
<td width="80" align="center" class="bg_tr" nowrap>分类</td> |
||||
<td width="80" align="center" class="bg_tr" nowrap>添加者</td> |
||||
<td width="50" align="center" class="bg_tr" nowrap>操作时间</td> |
||||
<td width="50" align="center" class="bg_tr" nowrap>状态</td> |
||||
<td width="70" align="center" class="bg_tr" nowrap>相关操作</td> |
||||
</tr> |
||||
<?php |
||||
foreach($items as $index => $item) { |
||||
if(!$item->gift) continue; |
||||
?> |
||||
<tr> |
||||
<td align="center" class="td_bg"nowrap ><?=$index+1?></td>
|
||||
<td class="td_bg" nowrap><?=$item->gift->name?></td>
|
||||
<td align="center" class="td_bg" nowrap><?=$item->gift->type->name?></td>
|
||||
<td class="td_bg" nowrap><?=$item->gift->remark?></td>
|
||||
<td align="center" class="td_bg" nowrap><?=$item->strategy_id>0?'公司礼品':'自费礼品'?></td>
|
||||
<td class="td_bg" nowrap><?=$item->user?$item->user->getShowName():''?></td>
|
||||
<td align="center" class="td_bg" nowrap><?=date('Y-m-d H:i:s',$item->submit_time)?></td>
|
||||
<td align="center" class="td_bg" nowrap><?php |
||||
if($item->status == 0) echo '未出库'; |
||||
if($item->status == 1) echo '已出库'; |
||||
if($item->status == 2) echo '正在退换'; |
||||
?></td> |
||||
<td align="center" class="td_bg" nowrap> |
||||
<?php |
||||
if($item->strategy_id > 0 || $item->status > 0) { |
||||
echo ''; |
||||
} else { |
||||
echo '[<a href="javascript:void();" onclick="deleteGift('.$item->id.')">删除</a>]'; |
||||
} |
||||
?> |
||||
</td> |
||||
</tr> |
||||
<?php |
||||
} |
||||
?> |
||||
</table> |
@ -1,46 +0,0 @@ |
||||
<?php |
||||
use common\models\CarGiftT; |
||||
?> |
||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;"> |
||||
<?php |
||||
foreach($items as $item) { |
||||
?> |
||||
<tr> |
||||
<td width="200" height="25" class="bg_tr"><?=$item->name?></td>
|
||||
<td height="25" class="td_bg"> |
||||
<?php |
||||
$my_gifts = CarGiftT::find() |
||||
->where('order_id='.$order_id.' and strategy_id='.$item->id) |
||||
->all(); |
||||
$tmp_ids = array(); |
||||
foreach($my_gifts as $my_gift) { |
||||
$tmp_ids[] = $my_gift->gift_id; |
||||
} |
||||
$my_gift_total = count($tmp_ids); |
||||
for($i = 0; $i < $item->sel_count; $i++) { |
||||
echo '礼品: '; |
||||
echo '<select name="gifts[]">'; |
||||
echo '<option value="0">请选择</option>'; |
||||
$gift_items = $item->gifts; |
||||
$flag = false; |
||||
foreach($gift_items as $gift_item) { |
||||
echo '<option value="'.$item->id.'-'.$gift_item->id.'"'; |
||||
for($j = 0; $j < $my_gift_total; $j++) { |
||||
if(!$flag && $tmp_ids[$j] == $gift_item->id) { |
||||
echo ' selected '; |
||||
$tmp_ids[$j] = ''; |
||||
$flag = true; |
||||
} |
||||
} |
||||
echo '>'.$gift_item->name.'</option>'; |
||||
} |
||||
echo '</select>'; |
||||
} |
||||
?> |
||||
</td> |
||||
</tr> |
||||
<?php |
||||
} |
||||
?> |
||||
</table> |
||||
|
@ -0,0 +1,170 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title"> |
||||
<h5>礼品出库</h5> |
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||
<i class="fa fa-refresh"></i> 刷新 |
||||
</a> |
||||
</div> |
||||
</div> |
||||
<div class="ibox-content"> |
||||
<form role="form" class="form-horizontal" onsubmit="return search();"> |
||||
<div class="form-group"> |
||||
<label class="control-label col-md-1">礼品编号</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="code" name="code" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-md-1">车牌</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="car_no" name="car_no" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-md-1">车架号</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="frame_no" name="frame_no" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-md-1">发动机号</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="engine_no" name="engine_no" class="form-control"> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="control-label col-md-1">状态</label> |
||||
<div class="col-md-2"> |
||||
<select name="status" class="form-control"> |
||||
<option value="0" >全部</option> |
||||
<option value="4">未出库</option> |
||||
<option value="5">已出库</option> |
||||
</select> |
||||
</div> |
||||
<label class="control-label col-md-1">分类</label> |
||||
<div class="col-md-2"> |
||||
<select name="type_id" class="form-control"> |
||||
<option value="0">---请选择---</option> |
||||
<?php |
||||
foreach($type_items as $item) { |
||||
echo '<option value="'.$item->id.'"'; |
||||
echo '>'.$item->name.'</option>'; |
||||
} |
||||
?> |
||||
</select> |
||||
</div> |
||||
<label class="control-label col-md-1">业务工号</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="username" name="username" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-md-1">商业保单号</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="insurer1_no" name="insurer1_no" class="form-control"> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="control-label col-md-1">提单日期</label> |
||||
<div class="col-md-2"> |
||||
<div class="input-daterange input-group" id="datepicker"> |
||||
<input type="text" class="input-sm form-control" id="s_start_date" name="s_start_date" autocomplete="off" value="" /> |
||||
<span class="input-group-addon">到</span> |
||||
<input type="text" class="input-sm form-control" id="s_end_date" name="s_end_date" autocomplete="off" value="" /> |
||||
</div> |
||||
</div> |
||||
<label class="control-label col-md-1">正本日期</label> |
||||
<div class="col-md-2"> |
||||
<div class="input-daterange input-group" id="datepicker"> |
||||
<input type="text" class="input-sm form-control" id="p_start_date" name="p_start_date" autocomplete="off" value="" /> |
||||
<span class="input-group-addon">到</span> |
||||
<input type="text" class="input-sm form-control" id="p_end_date" name="p_end_date" autocomplete="off" value="" /> |
||||
</div> |
||||
</div> |
||||
<div class="col-md-3"> |
||||
<button type="submit" class="btn btn-primary">搜索</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<table id="listTable"> |
||||
<thead> |
||||
<tr> |
||||
<th width="50" data-field="id">ID</th> |
||||
<th data-field="code">礼品编号</th> |
||||
<th data-field="name">礼品</th> |
||||
<th data-field="car_no">车牌号</th> |
||||
<th data-field="car_frame_no">车架号</th> |
||||
<th data-field="use_total">提单人</th> |
||||
<th data-field="use_total">出库时间</th> |
||||
<th data-field="use_total">状态</th> |
||||
<th data-field="use_total">操作员</th> |
||||
<th data-formatter="opFormatter">操作</th> |
||||
</tr> |
||||
</thead> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||
<script> |
||||
function opFormatter(value, row, index) { |
||||
var opStr = []; |
||||
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); |
||||
if(row.use_num > row.finish_num) { |
||||
opStr.push('<i class="fa fa-edit" title="出库"></i>'); |
||||
} else { |
||||
opStr.push('<i class="fa fa-file-o" title="详情"></i>'); |
||||
} |
||||
opStr.push('</a>'); |
||||
|
||||
return opStr.join(' '); |
||||
} |
||||
function refreshList() { |
||||
$('#listTable').bootstrapTable('refresh'); |
||||
} |
||||
|
||||
function search() { |
||||
$('#listTable').bootstrapTable('destroy'); |
||||
$('#listTable').bootstrapTable({ |
||||
url: "/gift/gift-out-json", |
||||
pagination: true, |
||||
sidePagination: 'server', |
||||
queryParams: function(params) { |
||||
params.code = $('#code').val(); |
||||
params.car_no = $('#car_no').val(); |
||||
params.frame_no = $('#frame_no').val(); |
||||
params.engine_no = $('#engine_no').val(); |
||||
params.status = $('#status').val(); |
||||
params.type_id = $('#type_id').val(); |
||||
params.username = $('#username').val(); |
||||
params.insurer1_no = $('#insurer1_no').val(); |
||||
params.s_start_date = $('#s_start_date').val(); |
||||
params.s_end_date = $('#s_end_date').val(); |
||||
params.p_start_date = $('#p_start_date').val(); |
||||
params.p_end_date = $('#p_end_date').val(); |
||||
return params; |
||||
} |
||||
}); |
||||
return false; |
||||
} |
||||
|
||||
$(function() { |
||||
$('.input-daterange').datepicker({ |
||||
keyboardNavigation: false, |
||||
forceParse: false, |
||||
autoclose: true |
||||
}); |
||||
search(); |
||||
}); |
||||
</script> |
||||
<?php $this->endBlock(); ?> |
@ -0,0 +1,96 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title"> |
||||
<h5>礼品统计</h5> |
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||
<i class="fa fa-refresh"></i> 刷新 |
||||
</a> |
||||
</div> |
||||
</div> |
||||
<div class="ibox-content"> |
||||
<form role="form" class="form-horizontal" onsubmit="return search();"> |
||||
<div class="form-group"> |
||||
<label class="control-label col-md-1">范围</label> |
||||
<div class="col-md-2"> |
||||
<select id="date_type" name="date_type" class="form-control"> |
||||
<option value="0">全部</option> |
||||
<option value="1">出库时间</option> |
||||
<option value="2">正本生成时间</option> |
||||
<option value="3">提单时间</option> |
||||
</select> |
||||
</div> |
||||
<div class="col-md-2"> |
||||
<div class="input-daterange input-group" id="datepicker"> |
||||
<input type="text" class="input-sm form-control" id="begin_date" name="begin_date" autocomplete="off" value="" /> |
||||
<span class="input-group-addon">到</span> |
||||
<input type="text" class="input-sm form-control" id="end_date" name="end_date" autocomplete="off" value="" /> |
||||
</div> |
||||
</div> |
||||
<div class="col-md-3"> |
||||
<button type="submit" class="btn btn-primary">搜索</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<table id="listTable"> |
||||
<thead> |
||||
<tr> |
||||
<th width="50" data-field="id">ID</th> |
||||
<th data-field="name">名称</th> |
||||
<th data-field="total">库存</th> |
||||
<th data-field="unout_total">待出库</th> |
||||
<th data-field="out_total">已出库</th> |
||||
</tr> |
||||
</thead> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||
<script> |
||||
function refreshList() { |
||||
$('#listTable').bootstrapTable('refresh'); |
||||
} |
||||
|
||||
function search() { |
||||
$('#listTable').bootstrapTable('destroy'); |
||||
$('#listTable').bootstrapTable({ |
||||
url: "/gift/gift-tj-json", |
||||
pagination: true, |
||||
sidePagination: 'server', |
||||
queryParams: function(params) { |
||||
params.date_type = $('#date_type').val(); |
||||
params.begin_date = $('#begin_date').val(); |
||||
params.end_date = $('#end_date').val(); |
||||
return params; |
||||
} |
||||
}); |
||||
return false; |
||||
} |
||||
|
||||
$(function() { |
||||
$('.input-daterange').datepicker({ |
||||
keyboardNavigation: false, |
||||
forceParse: false, |
||||
autoclose: true |
||||
}); |
||||
search(); |
||||
}); |
||||
</script> |
||||
<?php $this->endBlock(); ?> |
@ -0,0 +1,172 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title"> |
||||
<h5>礼券使用</h5> |
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||
<i class="fa fa-refresh"></i> 刷新 |
||||
</a> |
||||
</div> |
||||
</div> |
||||
<div class="ibox-content"> |
||||
<form role="form" class="form-horizontal" onsubmit="return search();"> |
||||
<div class="form-group"> |
||||
<label class="control-label col-md-1">礼券编号</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="code" name="code" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-md-1">车牌</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="car_no" name="car_no" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-md-1">车架号</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="frame_no" name="frame_no" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-md-1">发动机号</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="engine_no" name="engine_no" class="form-control"> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="control-label col-md-1">状态</label> |
||||
<div class="col-md-2"> |
||||
<select name="status" class="form-control"> |
||||
<option value="0" >全部</option> |
||||
<option value="4">未出库</option> |
||||
<option value="5">已出库</option> |
||||
</select> |
||||
</div> |
||||
<label class="control-label col-md-1">分类</label> |
||||
<div class="col-md-2"> |
||||
<select name="type_id" class="form-control"> |
||||
<option value="0">---请选择---</option> |
||||
<?php |
||||
foreach($type_items as $item) { |
||||
echo '<option value="'.$item->id.'"'; |
||||
echo '>'.$item->name.'</option>'; |
||||
} |
||||
?> |
||||
</select> |
||||
</div> |
||||
<label class="control-label col-md-1">业务工号</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="username" name="username" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-md-1">商业保单号</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="insurer1_no" name="insurer1_no" class="form-control"> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="control-label col-md-1">提单日期</label> |
||||
<div class="col-md-2"> |
||||
<div class="input-daterange input-group" id="datepicker"> |
||||
<input type="text" class="input-sm form-control" id="s_start_date" name="s_start_date" autocomplete="off" value="" /> |
||||
<span class="input-group-addon">到</span> |
||||
<input type="text" class="input-sm form-control" id="s_end_date" name="s_end_date" autocomplete="off" value="" /> |
||||
</div> |
||||
</div> |
||||
<label class="control-label col-md-1">正本日期</label> |
||||
<div class="col-md-2"> |
||||
<div class="input-daterange input-group" id="datepicker"> |
||||
<input type="text" class="input-sm form-control" id="p_start_date" name="p_start_date" autocomplete="off" value="" /> |
||||
<span class="input-group-addon">到</span> |
||||
<input type="text" class="input-sm form-control" id="p_end_date" name="p_end_date" autocomplete="off" value="" /> |
||||
</div> |
||||
</div> |
||||
<div class="col-md-3"> |
||||
<button type="submit" class="btn btn-primary">搜索</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<table id="listTable"> |
||||
<thead> |
||||
<tr> |
||||
<th width="50" data-field="id">ID</th> |
||||
<th data-field="code">礼券编号</th> |
||||
<th data-field="name">礼品</th> |
||||
<th data-field="car_no">车牌号</th> |
||||
<th data-field="car_frame_no">车架号</th> |
||||
<th data-field="use_total">发放日期</th> |
||||
<th data-field="use_total">有效期日期</th> |
||||
<th data-field="use_total">提单人</th> |
||||
<th data-field="use_total">使用日期</th> |
||||
<th data-field="use_total">状态</th> |
||||
<th data-field="use_total">操作员</th> |
||||
<th data-formatter="opFormatter">操作</th> |
||||
</tr> |
||||
</thead> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||
<script> |
||||
function opFormatter(value, row, index) { |
||||
var opStr = []; |
||||
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); |
||||
if(row.use_num > row.finish_num) { |
||||
opStr.push('<i class="fa fa-edit" title="出库"></i>'); |
||||
} else { |
||||
opStr.push('<i class="fa fa-file-o" title="详情"></i>'); |
||||
} |
||||
opStr.push('</a>'); |
||||
|
||||
return opStr.join(' '); |
||||
} |
||||
function refreshList() { |
||||
$('#listTable').bootstrapTable('refresh'); |
||||
} |
||||
|
||||
function search() { |
||||
$('#listTable').bootstrapTable('destroy'); |
||||
$('#listTable').bootstrapTable({ |
||||
url: "/gift/gift-use-json", |
||||
pagination: true, |
||||
sidePagination: 'server', |
||||
queryParams: function(params) { |
||||
params.code = $('#code').val(); |
||||
params.car_no = $('#car_no').val(); |
||||
params.frame_no = $('#frame_no').val(); |
||||
params.engine_no = $('#engine_no').val(); |
||||
params.status = $('#status').val(); |
||||
params.type_id = $('#type_id').val(); |
||||
params.username = $('#username').val(); |
||||
params.insurer1_no = $('#insurer1_no').val(); |
||||
params.s_start_date = $('#s_start_date').val(); |
||||
params.s_end_date = $('#s_end_date').val(); |
||||
params.p_start_date = $('#p_start_date').val(); |
||||
params.p_end_date = $('#p_end_date').val(); |
||||
return params; |
||||
} |
||||
}); |
||||
return false; |
||||
} |
||||
|
||||
$(function() { |
||||
$('.input-daterange').datepicker({ |
||||
keyboardNavigation: false, |
||||
forceParse: false, |
||||
autoclose: true |
||||
}); |
||||
search(); |
||||
}); |
||||
</script> |
||||
<?php $this->endBlock(); ?> |
@ -1,86 +0,0 @@ |
||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
||||
<form id="theFrm"> |
||||
<input type="hidden" name="id" value="<?=$info->id?>">
|
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">编号</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="code" type="text" id="code" value="<?=$info->code?>" style="width:400px;"/>
|
||||
</td> |
||||
<td width="100" height="25" class="td_bg">名称</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="name" type="text" id="name" value="<?=$info->name?>" style="width:400px;"/>
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">车牌号</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="car_no" type="text" id="car_no" value="<?=$info->car_no?>" style="width:400px;"/>
|
||||
</td> |
||||
<td width="100" height="25" class="td_bg">联系电话</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="phone" type="text" id="phone" value="<?=$info->phone?>" style="width:400px;"/>
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">商业保单号</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="insurer1_no" type="text" id="insurer1_no" value="<?=$info->insurer1_no?>" style="width:400px;"/>
|
||||
</td> |
||||
<td width="100" height="25" class="td_bg">交强保单号</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="insurer2_no" type="text" id="insurer2_no" value="<?=$info->insurer2_no?>" style="width:400px;"/>
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">状态</td> |
||||
<td colspan="3" height="25" class="td_bg"> |
||||
<input type="radio" name="status" value="0" <?=$info->status==0?'checked':''?>>未使用
|
||||
<input type="radio" name="status" value="1" <?=$info->status==1?'checked':''?>>出库
|
||||
<input type="radio" name="status" value="2" <?=$info->status==2?'checked':''?>>回收
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">入库时间</td> |
||||
<td colspan="3" height="25" class="td_bg"><?=$info->input_time?></td>
|
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">出库时间</td> |
||||
<td colspan="3" height="25" class="td_bg"><?=$info->output_time?></td>
|
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">回收时间</td> |
||||
<td colspan="3" height="25" class="td_bg"><?=$info->return_time?></td>
|
||||
</tr> |
||||
</form> |
||||
<tr> |
||||
<td height="22" colspan="4" align="center" class="td_bg"> |
||||
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/> |
||||
|
||||
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 "> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/func.js"></script> |
||||
<script type="text/javascript" language="javascript"> |
||||
$(function () { |
||||
//提交按钮 |
||||
$("#submit-btn").click(function(){ |
||||
if(confirm('是否确认提交?')) { |
||||
var params = $("#theFrm").serialize(); |
||||
$.post('/gift/gift2-save',params,function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
$('#back-btn').click(); |
||||
} |
||||
},'json'); |
||||
} |
||||
}); |
||||
|
||||
//返回按钮 |
||||
$('#back-btn').click(function(){ |
||||
window.location.href='/gift/gift2-list'; |
||||
}); |
||||
}) |
||||
</script> |
@ -1,78 +0,0 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/func.js"></script> |
||||
<script type="text/javascript" language="javascript"> |
||||
//详情 |
||||
function edit(id) { |
||||
window.location.href = '/gift/gift2-edit?id=' + id; |
||||
} |
||||
|
||||
$(function(){ |
||||
$("#search-btn").click(function(){ |
||||
$('#page').val(0); |
||||
var params = $('#searchForm').serialize(); |
||||
window.location.href = "/gift/gift2-list?" + params; |
||||
}); |
||||
$('#add-btn').click(function(){ |
||||
edit(0); |
||||
}); |
||||
}); |
||||
</script> |
||||
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> |
||||
<form id="searchForm"> |
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<tr> |
||||
<td class="td_bg"> |
||||
编号:<input name="code" type="text" value="<?=$code?>">
|
||||
名称:<input name="name" type="text" value="<?=$name?>">
|
||||
电话:<input name="phone" type="text" value="<?=$phone?>">
|
||||
车牌:<input name="car_no" type="text" value="<?=$car_no?>">
|
||||
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> |
||||
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加"> |
||||
</td> |
||||
</tr> |
||||
</form> |
||||
</table> |
||||
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> |
||||
<tr> |
||||
<td width="30" align="center" class="bg_tr" nowrap>序号</td> |
||||
<td width="50" align="center" class="bg_tr" nowrap>编号</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>名称</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>车牌号</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>入库时间</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>出库时间</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>回收时间</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>状态</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>操作员</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>操作时间</td> |
||||
<td width="30" align="center" class="bg_tr" nowrap>操作</td> |
||||
</tr> |
||||
<?php |
||||
foreach($items as $index => $item) { |
||||
$start_index = ($page - 1) * 20 + $index; |
||||
?> |
||||
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)> |
||||
<td align="center" class="td_bg"n owrap ><?=$start_index + 1?></td>
|
||||
<td class="td_bg" nowrap><?=$item->code?></td>
|
||||
<td class="td_bg" nowrap><?=$item->name?></td>
|
||||
<td class="td_bg" nowrap><?=$item->car_no?></td>
|
||||
<td class="td_bg" nowrap><?=$item->input_time?></td>
|
||||
<td class="td_bg" nowrap><?=$item->output_time?></td>
|
||||
<td class="td_bg" nowrap><?=$item->return_time?></td>
|
||||
<td class="td_bg" ><?=$item->getStatus()?> </td>
|
||||
<td class="td_bg" ><?=$item->user?$item->user->getShowName():''?></td>
|
||||
<td class="td_bg" ><?=$item->updated_at?></td>
|
||||
<td align="center" class="td_bg" nowrap> |
||||
[<a href="javascript:void(0);" onclick="edit(<?=$item->id?>)">详情</a>]
|
||||
</td> |
||||
</tr> |
||||
<?php |
||||
} |
||||
?> |
||||
<tr > |
||||
<td height="25" colspan="14" align="center" class="td_bg"><?=$page_info?></td>
|
||||
</tr> |
||||
</table> |
@ -1,86 +0,0 @@ |
||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
||||
<form id="theFrm"> |
||||
<input type="hidden" name="id" value="<?=$info->id?>">
|
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">礼券编号</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="code" type="text" id="code" value="<?=$info->code?>" style="width:400px;"/>
|
||||
</td> |
||||
<td width="100" height="25" class="td_bg">礼品名称</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="name" type="text" id="name" value="<?=$info->name?>" style="width:400px;"/>
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">车牌号</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="car_no" type="text" id="car_no" value="<?=$info->car_no?>" style="width:400px;"/>
|
||||
</td> |
||||
<td width="100" height="25" class="td_bg">联系电话</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="phone" type="text" id="phone" value="<?=$info->phone?>" style="width:400px;"/>
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">商业保单号</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="insurer1_no" type="text" id="insurer1_no" value="<?=$info->insurer1_no?>" style="width:400px;"/>
|
||||
</td> |
||||
<td width="100" height="25" class="td_bg">交强保单号</td> |
||||
<td height="25" class="td_bg"> |
||||
<input name="insurer2_no" type="text" id="insurer2_no" value="<?=$info->insurer2_no?>" style="width:400px;"/>
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">状态</td> |
||||
<td colspan="3" height="25" class="td_bg"> |
||||
<input type="radio" name="status" value="0" <?=$info->status==0?'checked':''?>>未使用
|
||||
<input type="radio" name="status" value="1" <?=$info->status==1?'checked':''?>>出库
|
||||
<input type="radio" name="status" value="2" <?=$info->status==2?'checked':''?>>回收
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">入库时间</td> |
||||
<td colspan="3" height="25" class="td_bg"><?=$info->input_time?></td>
|
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">出库时间</td> |
||||
<td colspan="3" height="25" class="td_bg"><?=$info->output_time?></td>
|
||||
</tr> |
||||
<tr> |
||||
<td width="100" height="25" class="td_bg">回收时间</td> |
||||
<td colspan="3" height="25" class="td_bg"><?=$info->return_time?></td>
|
||||
</tr> |
||||
</form> |
||||
<tr> |
||||
<td height="22" colspan="4" align="center" class="td_bg"> |
||||
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/> |
||||
|
||||
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 "> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/func.js"></script> |
||||
<script type="text/javascript" language="javascript"> |
||||
$(function () { |
||||
//提交按钮 |
||||
$("#submit-btn").click(function(){ |
||||
if(confirm('是否确认提交?')) { |
||||
var params = $("#theFrm").serialize(); |
||||
$.post('/gift/gift3-save',params,function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
$('#back-btn').click(); |
||||
} |
||||
},'json'); |
||||
} |
||||
}); |
||||
|
||||
//返回按钮 |
||||
$('#back-btn').click(function(){ |
||||
window.location.href='/gift/gift3-list'; |
||||
}); |
||||
}) |
||||
</script> |
@ -1,78 +0,0 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/func.js"></script> |
||||
<script type="text/javascript" language="javascript"> |
||||
//详情 |
||||
function edit(id) { |
||||
window.location.href = '/gift/gift3-edit?id=' + id; |
||||
} |
||||
|
||||
$(function(){ |
||||
$("#search-btn").click(function(){ |
||||
$('#page').val(0); |
||||
var params = $('#searchForm').serialize(); |
||||
window.location.href = "/gift/gift3-list?" + params; |
||||
}); |
||||
$('#add-btn').click(function(){ |
||||
edit(0); |
||||
}); |
||||
}); |
||||
</script> |
||||
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> |
||||
<form id="searchForm"> |
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<tr> |
||||
<td class="td_bg"> |
||||
礼券编号:<input name="code" type="text" value="<?=$code?>">
|
||||
名称:<input name="name" type="text" value="<?=$name?>">
|
||||
电话:<input name="phone" type="text" value="<?=$phone?>">
|
||||
车牌:<input name="car_no" type="text" value="<?=$car_no?>">
|
||||
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> |
||||
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加"> |
||||
</td> |
||||
</tr> |
||||
</form> |
||||
</table> |
||||
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> |
||||
<tr> |
||||
<td width="30" align="center" class="bg_tr" nowrap>序号</td> |
||||
<td width="50" align="center" class="bg_tr" nowrap>礼券编号</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>名称</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>车牌号</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>入库时间</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>出库时间</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>回收时间</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>状态</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>操作员</td> |
||||
<td width="60" align="center" class="bg_tr" nowrap>操作时间</td> |
||||
<td width="30" align="center" class="bg_tr" nowrap>操作</td> |
||||
</tr> |
||||
<?php |
||||
foreach($items as $index => $item) { |
||||
$start_index = ($page - 1) * 20 + $index; |
||||
?> |
||||
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)> |
||||
<td align="center" class="td_bg"n owrap ><?=$start_index + 1?></td>
|
||||
<td class="td_bg" nowrap><?=$item->code?></td>
|
||||
<td class="td_bg" nowrap><?=$item->name?></td>
|
||||
<td class="td_bg" nowrap><?=$item->car_no?></td>
|
||||
<td class="td_bg" nowrap><?=$item->input_time?></td>
|
||||
<td class="td_bg" nowrap><?=$item->output_time?></td>
|
||||
<td class="td_bg" nowrap><?=$item->return_time?></td>
|
||||
<td class="td_bg" ><?=$item->getStatus()?> </td>
|
||||
<td class="td_bg" ><?=$item->user?$item->user->getShowName():''?></td>
|
||||
<td class="td_bg" ><?=$item->updated_at?></td>
|
||||
<td align="center" class="td_bg" nowrap> |
||||
[<a href="javascript:void(0);" onclick="edit(<?=$item->id?>)">详情</a>]
|
||||
</td> |
||||
</tr> |
||||
<?php |
||||
} |
||||
?> |
||||
<tr > |
||||
<td height="25" colspan="14" align="center" class="td_bg"><?=$page_info?></td>
|
||||
</tr> |
||||
</table> |
@ -1,76 +1,124 @@ |
||||
<?php |
||||
use common\libs\MyLib; |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/func.js"></script> |
||||
<script type="text/javascript" language="javascript"> |
||||
//编辑 |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title"> |
||||
<h5>礼品管理</h5> |
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)"> |
||||
<i class="fa fa-plus"></i> 添加 |
||||
</a> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||
<i class="fa fa-refresh"></i> 刷新 |
||||
</a> |
||||
</div> |
||||
</div> |
||||
<div class="ibox-content"> |
||||
<form role="form" class="form-horizontal" onsubmit="return search();"> |
||||
<div class="form-group"> |
||||
<label class="control-label col-md-1">礼品类型</label> |
||||
<div class="col-md-2"> |
||||
<select id="is_leave" name="is_leave" class="form-control"> |
||||
<option value="">全部</option> |
||||
<option value="1">实名礼品</option> |
||||
<option value="2">礼券</option> |
||||
</select> |
||||
</div> |
||||
<label class="control-label col-md-1">名称</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="name" name="name" class="form-control"> |
||||
</div> |
||||
<div class="col-md-3"> |
||||
<button type="submit" class="btn btn-primary">搜索</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<table id="listTable"> |
||||
<thead> |
||||
<tr> |
||||
<th data-field="id">ID</th> |
||||
<th data-field="name">名称</th> |
||||
<th data-field="type">所属类型</th> |
||||
<th data-field="price">价格</th> |
||||
<th data-field="use_num">使用次数</th> |
||||
<th data-field="remark">描述</th> |
||||
<th data-field="original_img">商品图片</th> |
||||
<th data-formatter="opFormatter">操作</th> |
||||
</tr> |
||||
</thead> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||
<script> |
||||
function opFormatter(value, row, index) { |
||||
var opStr = []; |
||||
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-edit" title="编辑"></i>'); |
||||
opStr.push('</a>'); |
||||
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-trash" title="删除"></i>'); |
||||
opStr.push('</a>'); |
||||
|
||||
return opStr.join(' '); |
||||
} |
||||
function create() { |
||||
title = '新增礼品'; |
||||
layer_show(title, '/gift/edit?id=0'); |
||||
} |
||||
function edit(id) { |
||||
window.location.href = '/gift/edit?id=' + id; |
||||
var title = '编辑礼品'; |
||||
layer_show(title, '/gift/edit?id=' + id); |
||||
} |
||||
//删除 |
||||
function del(id) { |
||||
if(confirm('是否确认删除?')) { |
||||
$.post('/gift/delete',{id:id},function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
parent.layer.confirm('是否确认删除?', { |
||||
btn: ['删除','取消'], //按钮 |
||||
shade: false //不显示遮罩 |
||||
}, function(){ |
||||
$.post('/gift/delete',{id:id},function(data) { |
||||
parent.layer.msg(data.msg); |
||||
refreshList(); |
||||
}, 'json'); |
||||
}, function(){ |
||||
// |
||||
}); |
||||
} |
||||
},'json'); |
||||
function refreshList() { |
||||
$('#listTable').bootstrapTable('refresh'); |
||||
} |
||||
|
||||
function search() { |
||||
$('#listTable').bootstrapTable('destroy'); |
||||
$('#listTable').bootstrapTable({ |
||||
url: "/gift/index-json", |
||||
pagination: true, |
||||
sidePagination: 'server', |
||||
queryParams: function(params) { |
||||
params.type_id = $('#type_id').val(); |
||||
params.name = $('#name').val(); |
||||
return params; |
||||
} |
||||
$(function(){ |
||||
$("#search-btn").click(function(){ |
||||
var params = $('#searchForm').serialize(); |
||||
window.location.href = "/gift/index?" + params; |
||||
}); |
||||
$('#add-btn').click(function(){ |
||||
edit(0); |
||||
}); |
||||
return false; |
||||
} |
||||
|
||||
$(function() { |
||||
search(); |
||||
}); |
||||
</script> |
||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
||||
<form id="searchForm"> |
||||
<tr> |
||||
<td class="td_bg"> |
||||
名称:<input name="name" type="text" value="<?=$name?>">
|
||||
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> |
||||
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加"> |
||||
</td> |
||||
</tr> |
||||
</form> |
||||
</table> |
||||
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table"> |
||||
<tr> |
||||
<td width="50" align="center" align="center" class="bg_tr" nowrap>序号</td> |
||||
<td width="150" align="center" align="center" class="bg_tr">名称</td> |
||||
<td width="50" align="center" align="center" class="bg_tr" nowrap>所属类型</td> |
||||
<td width="50" align="center" align="center" class="bg_tr" nowrap>价格</td> |
||||
<td width="50%" align="center" align="center" class="bg_tr">描述</td> |
||||
<td width="50" align="center" align="center" class="bg_tr" nowrap>总数量</td> |
||||
<td width="70" align="center" align="center" class="bg_tr" nowrap>锁定量</td> |
||||
<td width="30" align="center" class="bg_tr">操作</td> |
||||
</tr> |
||||
<?php |
||||
foreach($items as $index => $item) { |
||||
?> |
||||
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)> |
||||
<td align="center" class="td_bg" nowrap ><?=$index+1?></td>
|
||||
<td align="left" class="td_bg" nowrap ><?=$item->name?></td>
|
||||
<td align="center" class="td_bg" nowrap ><?=$item->type?$item->type->name:''?></td>
|
||||
<td align="left" class="td_bg" nowrap ><?=$item->price?></td>
|
||||
<td align="left" class="td_bg" nowrap ><?=MyLib::substr_cut($item->remark,70)?></td>
|
||||
<td align="left" class="td_bg" nowrap ><?=$item->total?></td>
|
||||
<td align="left" class="td_bg" nowrap ><?=$item->total_lock?></td>
|
||||
<td align="center" class="td_bg" nowrap> |
||||
[<a href="javascript:void(0);" onclick="edit(<?=$item->id?>)">修改</a>]
|
||||
<!-- |
||||
[<a href="javascript:void(0);" onclick="del(<?=$item->id?>)">删除</a>]
|
||||
//--> |
||||
</td> |
||||
</tr> |
||||
<?php |
||||
} |
||||
?> |
||||
</table> |
||||
<?php $this->endBlock(); ?> |
||||
|
@ -0,0 +1,65 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title"> |
||||
<h5>礼品盘库</h5> |
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||
<i class="fa fa-refresh"></i> 刷新 |
||||
</a> |
||||
</div> |
||||
</div> |
||||
<div class="ibox-content"> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<table id="listTable"> |
||||
<thead> |
||||
<tr> |
||||
<th width="50" data-field="id">ID</th> |
||||
<th data-field="name">名称</th> |
||||
<th data-field="total">总数量</th> |
||||
<th data-field="out_total">已出库</th> |
||||
<th data-field="use_total">已使用</th> |
||||
</tr> |
||||
</thead> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||
<script> |
||||
function refreshList() { |
||||
$('#listTable').bootstrapTable('refresh'); |
||||
} |
||||
|
||||
function search() { |
||||
$('#listTable').bootstrapTable('destroy'); |
||||
$('#listTable').bootstrapTable({ |
||||
url: "/gift/stastics-json", |
||||
pagination: true, |
||||
sidePagination: 'server', |
||||
queryParams: function(params) { |
||||
return params; |
||||
} |
||||
}); |
||||
return false; |
||||
} |
||||
|
||||
$(function() { |
||||
search(); |
||||
}); |
||||
</script> |
||||
<?php $this->endBlock(); ?> |
@ -0,0 +1,96 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title"> |
||||
<h5>礼券统计</h5> |
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||
<i class="fa fa-refresh"></i> 刷新 |
||||
</a> |
||||
</div> |
||||
</div> |
||||
<div class="ibox-content"> |
||||
<form role="form" class="form-horizontal" onsubmit="return search();"> |
||||
<div class="form-group"> |
||||
<label class="control-label col-md-1">范围</label> |
||||
<div class="col-md-2"> |
||||
<select id="date_type" name="date_type" class="form-control"> |
||||
<option value="0">全部</option> |
||||
<option value="1">出库时间</option> |
||||
<option value="2">正本生成时间</option> |
||||
<option value="3">提单时间</option> |
||||
</select> |
||||
</div> |
||||
<div class="col-md-2"> |
||||
<div class="input-daterange input-group" id="datepicker"> |
||||
<input type="text" class="input-sm form-control" id="begin_date" name="begin_date" autocomplete="off" value="" /> |
||||
<span class="input-group-addon">到</span> |
||||
<input type="text" class="input-sm form-control" id="end_date" name="end_date" autocomplete="off" value="" /> |
||||
</div> |
||||
</div> |
||||
<div class="col-md-3"> |
||||
<button type="submit" class="btn btn-primary">搜索</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<table id="listTable"> |
||||
<thead> |
||||
<tr> |
||||
<th width="50" data-field="id">ID</th> |
||||
<th data-field="name">名称</th> |
||||
<th data-field="total">库存</th> |
||||
<th data-field="unuse_total">待出库</th> |
||||
<th data-field="use_total">已出库</th> |
||||
</tr> |
||||
</thead> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||
<script> |
||||
function refreshList() { |
||||
$('#listTable').bootstrapTable('refresh'); |
||||
} |
||||
|
||||
function search() { |
||||
$('#listTable').bootstrapTable('destroy'); |
||||
$('#listTable').bootstrapTable({ |
||||
url: "/gift/ticket-tj-json", |
||||
pagination: true, |
||||
sidePagination: 'server', |
||||
queryParams: function(params) { |
||||
params.date_type = $('#date_type').val(); |
||||
params.begin_date = $('#begin_date').val(); |
||||
params.end_date = $('#end_date').val(); |
||||
return params; |
||||
} |
||||
}); |
||||
return false; |
||||
} |
||||
|
||||
$(function() { |
||||
$('.input-daterange').datepicker({ |
||||
keyboardNavigation: false, |
||||
forceParse: false, |
||||
autoclose: true |
||||
}); |
||||
search(); |
||||
}); |
||||
</script> |
||||
<?php $this->endBlock(); ?> |
@ -0,0 +1,95 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/clockpicker/clockpicker.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-content"> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<form role="form" class="form-horizontal data-from" id="theFrm"> |
||||
<input type="hidden" name="op" value="add" /> |
||||
<div class="form-group"> |
||||
<label class="col-md-1 control-label">名称</label> |
||||
<div class="col-md-11"> |
||||
<input type="text" name="name" value="" class="form-control"> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="col-md-1 control-label">开始</label> |
||||
<div class="col-md-5"> |
||||
<div class="input-group"> |
||||
<span class="input-group-addon">日期</span> |
||||
<input type="text" class="input-date form-control" id="begin_date" name="begin_date" autocomplete="off" value="" /> |
||||
<span class="input-group-addon">时间</span> |
||||
<input type="text" class="form-control clockpicker" data-autoclose="true" id="begin_time" name="begin_time" autocomplete="off" value="" /> |
||||
</div> |
||||
</div> |
||||
<label class="col-md-1 control-label">结束</label> |
||||
<div class="col-md-5"> |
||||
<div class="input-group"> |
||||
<span class="input-group-addon">日期</span> |
||||
<input type="text" class="input-date form-control" id="end_date" name="end_date" autocomplete="off" value="" /> |
||||
<span class="input-group-addon">时间</span> |
||||
<input type="text" class="form-control clockpicker" data-autoclose="true" id="end_time" name="end_time" autocomplete="off" value="" /> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="col-md-1 control-label">备注</label> |
||||
<div class="col-md-11"> |
||||
<textarea class="form-control" name="remark" id="remark"></textarea> |
||||
</div> |
||||
</div> |
||||
<div> |
||||
<div class="row"> |
||||
<div class="col-md-5 col-md-offset-5"> |
||||
<button class="btn btn-primary btn-save" type="button"> |
||||
<strong>添 加</strong> |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script src="/assets/js/plugins/clockpicker/clockpicker.js"></script> |
||||
<script type="text/javascript" language="javascript"> |
||||
$(function () { |
||||
$('.input-date').datepicker({ |
||||
keyboardNavigation: false, |
||||
forceParse: false, |
||||
autoclose: true |
||||
}); |
||||
$('.clockpicker').clockpicker(); |
||||
//提交按钮 |
||||
$(".btn-save").click(function(){ |
||||
parent.layer.confirm('是否确认提交?', { |
||||
btn: ['确认','取消'], //按钮 |
||||
shade: false //不显示遮罩 |
||||
}, function(){ |
||||
var params = $("#theFrm").serialize(); |
||||
$.post('/marketing-strategy/save',params,function(obj){ |
||||
if(obj.success) { |
||||
parent.layer.msg('保存成功'); |
||||
parent.refreshList(); |
||||
layer_close(); |
||||
} else { |
||||
parent.layer.msg(data.msg); |
||||
} |
||||
},'json'); |
||||
}, function(){ |
||||
// |
||||
}); |
||||
}); |
||||
}) |
||||
</script> |
||||
<?php $this->endBlock('footer_js'); ?> |
@ -0,0 +1,104 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/clockpicker/clockpicker.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title fixed"> |
||||
<h5>营销策略 - 编辑 - <?=$info->celuo_name?></h5>
|
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs btn-users" data-id="0" href="javascript:void(0);"> |
||||
<i class="fa fa-users"></i> 员工 |
||||
</a> |
||||
<a class="btn btn-primary btn-xs btn-save" data-id="0" href="javascript:void(0);"> |
||||
<i class="fa fa-save"></i> 保存 |
||||
</a> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="history.go(-1)"> |
||||
<i class="fa fa-backward"></i> 返回 |
||||
</a> |
||||
</div> |
||||
</div> |
||||
<div class="ibox-content"> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<form role="form" class="form-horizontal data-from" id="theFrm"> |
||||
<input type="hidden" name="op" value="edit" /> |
||||
<input type="hidden" name="id" value="<?=$info->id?>" />
|
||||
<div class="form-group"> |
||||
<label class="col-md-1 control-label">名称</label> |
||||
<div class="col-md-11"> |
||||
<input type="text" name="name" value="<?=$info->celuo_name?>" class="form-control">
|
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="col-md-1 control-label">开始</label> |
||||
<div class="col-md-5"> |
||||
<div class="input-group"> |
||||
<span class="input-group-addon">日期</span> |
||||
<input type="text" class="input-date form-control" id="begin_date" name="begin_date" autocomplete="off" value="<?=substr($info->begin_date,0,10)?>" />
|
||||
<span class="input-group-addon">时间</span> |
||||
<input type="text" class="form-control clockpicker" data-autoclose="true" id="begin_time" name="begin_time" autocomplete="off" value="<?=substr($info->begin_date,10,6)?>" />
|
||||
</div> |
||||
</div> |
||||
<label class="col-md-1 control-label">结束</label> |
||||
<div class="col-md-5"> |
||||
<div class="input-group"> |
||||
<span class="input-group-addon">日期</span> |
||||
<input type="text" class="input-date form-control" id="end_date" name="end_date" autocomplete="off" value="<?=substr($info->end_date,0,10)?>" />
|
||||
<span class="input-group-addon">时间</span> |
||||
<input type="text" class="form-control clockpicker" data-autoclose="true" id="end_time" name="end_time" autocomplete="off" value="<?=substr($info->end_date,10,6)?>" />
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="col-md-1 control-label">备注</label> |
||||
<div class="col-md-11"> |
||||
<textarea class="form-control" name="remark" id="remark"><?=$info->remark?></textarea>
|
||||
</div> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script src="/assets/js/plugins/clockpicker/clockpicker.js"></script> |
||||
<script type="text/javascript" language="javascript"> |
||||
$(function () { |
||||
function create() { |
||||
title = '员工管理'; |
||||
layer_show(title, '/marketing-strategy/users'); |
||||
} |
||||
$('.input-date').datepicker({ |
||||
keyboardNavigation: false, |
||||
forceParse: false, |
||||
autoclose: true |
||||
}); |
||||
$('.clockpicker').clockpicker(); |
||||
//提交按钮 |
||||
$(".btn-save").click(function(){ |
||||
layer.confirm('是否确认提交?', { |
||||
btn: ['确认','取消'], //按钮 |
||||
shade: false //不显示遮罩 |
||||
}, function(){ |
||||
var params = $("#theFrm").serialize(); |
||||
$.post('/marketing-strategy/save',params,function(obj){ |
||||
if(obj.success) { |
||||
layer.msg('保存成功'); |
||||
location.href = '/marketing-strategy/index'; |
||||
} else { |
||||
layer.msg(data.msg); |
||||
} |
||||
},'json'); |
||||
}, function(){ |
||||
// |
||||
}); |
||||
}); |
||||
}) |
||||
</script> |
||||
<?php $this->endBlock('footer_js'); ?> |
@ -0,0 +1,101 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title"> |
||||
<h5>营销策略</h5> |
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)"> |
||||
<i class="fa fa-plus"></i> 添加 |
||||
</a> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||
<i class="fa fa-refresh"></i> 刷新 |
||||
</a> |
||||
</div> |
||||
</div> |
||||
<div class="ibox-content"> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<table id="listTable"> |
||||
<thead> |
||||
<tr> |
||||
<th data-field="id">ID</th> |
||||
<th data-field="celuo_name">策略名字</th> |
||||
<th data-field="begin_date">开始日期</th> |
||||
<th data-field="end_date">截止日期</th> |
||||
<th data-field="remark">策略描述</th> |
||||
<th data-formatter="opFormatter">操作</th> |
||||
</tr> |
||||
</thead> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||
<script> |
||||
function opFormatter(value, row, index) { |
||||
var opStr = []; |
||||
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-edit" title="编辑"></i>'); |
||||
opStr.push('</a>'); |
||||
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-trash" title="删除"></i>'); |
||||
opStr.push('</a>'); |
||||
|
||||
return opStr.join(' '); |
||||
} |
||||
function create() { |
||||
title = '新增营销策略'; |
||||
layer_show(title, '/marketing-strategy/add'); |
||||
} |
||||
function edit(id) { |
||||
var title = '编辑营销策略'; |
||||
window.location.href = '/marketing-strategy/edit?id=' + id; |
||||
} |
||||
function del(id) { |
||||
parent.layer.confirm('是否确认删除?', { |
||||
btn: ['删除','取消'], //按钮 |
||||
shade: false //不显示遮罩 |
||||
}, function(){ |
||||
$.post('/marketing-strategy/delete',{id:id},function(data) { |
||||
parent.layer.msg(data.msg); |
||||
refreshList(); |
||||
}, 'json'); |
||||
}, function(){ |
||||
// |
||||
}); |
||||
} |
||||
function refreshList() { |
||||
$('#listTable').bootstrapTable('refresh'); |
||||
} |
||||
|
||||
function search() { |
||||
$('#listTable').bootstrapTable('destroy'); |
||||
$('#listTable').bootstrapTable({ |
||||
url: "/marketing-strategy/index-json", |
||||
pagination: true, |
||||
sidePagination: 'server', |
||||
queryParams: function(params) { |
||||
return params; |
||||
} |
||||
}); |
||||
return false; |
||||
} |
||||
|
||||
$(function() { |
||||
search(); |
||||
}); |
||||
</script> |
||||
<?php $this->endBlock(); ?> |
@ -1,192 +1,147 @@ |
||||
<?php |
||||
use \common\libs\MyLib; |
||||
?> |
||||
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> |
||||
<script type="text/javascript" language="javascript" src="/js/func.js"></script> |
||||
<script type="text/javascript" language="javascript"> |
||||
//编辑 |
||||
function edit(id) { |
||||
var params = $('#searchForm').serialize(); |
||||
window.location.href = '/user/edit?id=' + id + '&back_params=' + encodeURIComponent(params); |
||||
} |
||||
//删除 |
||||
function del(id) { |
||||
if(confirm('是否确认删除?')) { |
||||
$.post('/user/delete',{id:id},function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
} |
||||
},'json'); |
||||
} |
||||
} |
||||
|
||||
$(function(){ |
||||
$("#search-btn").click(function(){ |
||||
$('#page').val(0); |
||||
var params = $('#searchForm').serialize(); |
||||
window.location.href = "/user/index?" + params; |
||||
}); |
||||
$('#add-btn').click(function(){ |
||||
window.location.href = "/user/edit?id=0"; |
||||
}); |
||||
$('#del-btn').click(function(){ |
||||
if(confirm('是否确认删除?')) { |
||||
var params = $('#delFrm').serialize(); |
||||
$.post('/user/all-delete',params,function(obj){ |
||||
alert(obj.msg); |
||||
if(obj.success) { |
||||
window.location.reload(); |
||||
} |
||||
},'json'); |
||||
} |
||||
}); |
||||
$('#all').click(function(){ |
||||
if($(this).prop('checked')==true) { |
||||
$('input:checkbox').each(function() { |
||||
$(this).prop('checked', true); |
||||
}); |
||||
} else { |
||||
$('input:checkbox').each(function () { |
||||
$(this).prop('checked',false); |
||||
}); |
||||
} |
||||
}); |
||||
|
||||
//未删除,不让登陆的,可以说是异常 |
||||
$(".abnormal").click(function(){ |
||||
alert('异常,请联系管理员!'); |
||||
return false; |
||||
}); |
||||
}); |
||||
|
||||
<?php $this->beginBlock('header_css'); ?> |
||||
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"> |
||||
<?php $this->endBlock(); ?> |
||||
|
||||
</script> |
||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
||||
<form id="searchForm"> |
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<tr> |
||||
<td class="td_bg"> |
||||
工号:<input name="username" type="text" value="<?=$username?>">
|
||||
真实姓名:<input name="name" type="text" value="<?=$name?>">
|
||||
电话:<input name="phone" type="text" value="<?=$phone?>">
|
||||
是否离职: |
||||
<select name="is_leave"> |
||||
<div class="wrapper wrapper-content animated fadeInRight"> |
||||
<div class="ibox float-e-margins"> |
||||
<div class="ibox-title"> |
||||
<h5>员工管理</h5> |
||||
<div class="ibox-tools"> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)"> |
||||
<i class="fa fa-plus"></i> 添加 |
||||
</a> |
||||
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');"> |
||||
<i class="fa fa-refresh"></i> 刷新 |
||||
</a> |
||||
</div> |
||||
</div> |
||||
<div class="ibox-content"> |
||||
<form role="form" class="form-horizontal" onsubmit="return search();"> |
||||
<div class="form-group"> |
||||
<label class="control-label col-md-1">工号</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="username" name="username" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-md-1">真实姓名</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="name" name="name" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-md-1">电话</label> |
||||
<div class="col-md-2"> |
||||
<input type="text" id="phone" name="phone" class="form-control"> |
||||
</div> |
||||
<label class="control-label col-md-1">是否离职</label> |
||||
<div class="col-md-2"> |
||||
<select id="is_leave" name="is_leave" class="form-control"> |
||||
<option value="">全部</option> |
||||
<option value="1" <?=$is_leave == '1' ? 'selected' : ''?>>是</option>
|
||||
<option value="0" <?=$is_leave == '0' ? 'selected' : ''?>>否</option>
|
||||
<option value="0">在职</option> |
||||
<option value="1">已离职</option> |
||||
</select> |
||||
分组:<select name="group_id"> |
||||
<option value="0">全部</option> |
||||
<?php |
||||
foreach($group_items as $group) { |
||||
echo '<option value="'.$group->id.'"'; |
||||
if($group->id == $group_id) |
||||
echo ' selected '; |
||||
echo '>'.$group->name.'</option>'; |
||||
} |
||||
?> |
||||
</div> |
||||
</div> |
||||
<div class="form-group"> |
||||
<label class="control-label col-md-1">岗位</label> |
||||
<div class="col-md-3"> |
||||
<select id="group_id" name="group_id" class="form-control"> |
||||
<option value="">全部</option> |
||||
<?php foreach($group_items as $item) { ?> |
||||
<option value="<?=$item->id?>"><?=$item->name?></option>
|
||||
<?php } ?> |
||||
</select> |
||||
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td class="td_bg"> |
||||
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加"> |
||||
<input type="button" class="act_btn" id="del-btn" name="del-btn" value="批量删除"> |
||||
</td> |
||||
</tr> |
||||
</div> |
||||
<div class="col-md-3"> |
||||
<button type="submit" class="btn btn-primary">搜索</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
</table> |
||||
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<table id="listTable"> |
||||
<thead> |
||||
<tr> |
||||
<td align="center" width="24" align="center" class="bg_tr"> |
||||
<input type="checkbox" id="all"> |
||||
</td> |
||||
<td width="100" align="center" align="center" class="bg_tr">工号</td> |
||||
<td align="center" class="bg_tr">真实姓名</td> |
||||
<td width="100" align="center" class="bg_tr">联系电话</td> |
||||
<td width="60" align="center" class="bg_tr">允许登录</td> |
||||
<td align="center" class="bg_tr">所属岗位</td> |
||||
<td width="60" align="center" class="bg_tr">角色</td> |
||||
<td width="60" align="center" class="bg_tr">是否离职</td> |
||||
<td width="60" align="center" class="bg_tr">状态</td> |
||||
<td width="30" align="center" class="bg_tr">操作</td> |
||||
</tr> |
||||
<form id="delFrm"> |
||||
<?php |
||||
foreach($items as $index => $item) { |
||||
?> |
||||
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)> |
||||
<td align="center" class="td_bg" nowrap ><input type="checkbox" name="ids[]" value="<?=$item->id?>"></td>
|
||||
<td align="left" class="td_bg" nowrap ><?=$item->username?></td>
|
||||
<td class="td_bg" nowrap><?=$item->name?></td>
|
||||
<td class="td_bg" nowrap><?=$item->phone?></td>
|
||||
<td align="center" class="td_bg" nowrap><?=$item->is_login==1?'是':''?></td>
|
||||
<td align="left" class="td_bg" nowrap><?=$item->group?$item->group->getPath():''?></td>
|
||||
<td class="td_bg" nowrap><?=$item->role?$item->role->name:''?></td>
|
||||
<td class="td_bg" nowrap><?=$item->is_leave?'已离职':''?></td>
|
||||
<td align="center" class="td_bg" nowrap data="<?=$item->id?>">
|
||||
<?php |
||||
if(($item->is_delete === 0) && ($item->is_login === 1)){ |
||||
echo '<a href="javascript:;"><span style="color:#fff;font-size:14px;background:green;padding:0px 25px;" onclick="changeState(0,$(this))">√</span></a>'; |
||||
}else if(($item->is_delete === 1) && ($item->is_login === 0)){ |
||||
echo '<a href="javascript:;"><span style="color:#fff;font-size:14px;background:red;padding:0px 25px;" onclick="changeState(1,$(this))">×</span></a>'; |
||||
}else{ |
||||
echo '<a href="javascript:;"><span style="color:#fff;font-size:14px;background:#b5b5b5;padding:0px 25px;" class="abnormal">?</span></a>'; |
||||
} |
||||
?> |
||||
</td> |
||||
<td align="center" class="td_bg" nowrap> |
||||
[<a href="javascript:void(0);" onclick="edit(<?=$item->id?>)">修改</a>]
|
||||
<?php |
||||
if($item->username != 'admin') { |
||||
?> |
||||
[<a href="javascript:void(0);" onclick="del(<?= $item->id ?>)">删除</a>]
|
||||
<?php |
||||
} |
||||
?> |
||||
</td> |
||||
</tr> |
||||
<?php |
||||
} |
||||
?> |
||||
</form> |
||||
<tr > |
||||
<td height="25" colspan="11" align="center" class="td_bg"><?=$page_info?></td>
|
||||
<th data-field="id">ID</th> |
||||
<th data-field="username">工号</th> |
||||
<th data-field="name">真实姓名</th> |
||||
<th data-field="phone">联系电话</th> |
||||
<th data-field="is_login">允许登录</th> |
||||
<th data-field="group_name">所属岗位</th> |
||||
<th data-field="role_name">角色</th> |
||||
<th data-field="is_leave">是否离职</th> |
||||
<th data-formatter="opFormatter">操作</th> |
||||
</tr> |
||||
</table> |
||||
<script type="text/javascript" language="javascript" src="/js/common2.js"></script> |
||||
<script> |
||||
/** |
||||
* 改变状态 |
||||
*/ |
||||
function changeState(state,this_dom){ |
||||
</thead> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
var this_text = this_dom.parents("td"); |
||||
var father = this_text.parents("tr"); |
||||
var id = this_text.attr("data"); |
||||
|
||||
$.post("/user/deal-state",{id:id,state:state},function(obj){ |
||||
<?php $this->beginBlock('footer_js'); ?> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
||||
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
||||
<script> |
||||
function opFormatter(value, row, index) { |
||||
var opStr = []; |
||||
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-edit" title="编辑"></i>'); |
||||
opStr.push('</a>'); |
||||
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); |
||||
opStr.push('<i class="fa fa-trash" title="删除"></i>'); |
||||
opStr.push('</a>'); |
||||
|
||||
if(obj.success) { |
||||
if(state == 1){ |
||||
this_text.html('<a href="javascript:;"><span style="color:#fff;font-size:14px;background:green;padding:0px 25px;" onclick="changeState(0,$(this))">√</span></a>'); |
||||
father.find("td").eq(4).html('是'); |
||||
}else{ |
||||
this_text.html('<a href="javascript:;"><span style="color:#fff;font-size:14px;background:red;padding:0px 25px;" onclick="changeState(1,$(this))">×</span></a>'); |
||||
father.find("td").eq(4).html(''); |
||||
return opStr.join(' '); |
||||
} |
||||
}else{ |
||||
alert(obj.msg); |
||||
window.location.reload(); |
||||
function create() { |
||||
title = '新增员工'; |
||||
layer_show(title, '/user/edit?id=0'); |
||||
} |
||||
},'json'); |
||||
function edit(id) { |
||||
var title = '编辑员工'; |
||||
layer_show(title, '/user/edit?id=' + id); |
||||
} |
||||
function del(id) { |
||||
parent.layer.confirm('是否确认删除?', { |
||||
btn: ['删除','取消'], //按钮 |
||||
shade: false //不显示遮罩 |
||||
}, function(){ |
||||
$.post('/user/delete',{id:id},function(data) { |
||||
parent.layer.msg(data.msg); |
||||
refreshList(); |
||||
}, 'json'); |
||||
}, function(){ |
||||
// |
||||
}); |
||||
} |
||||
function refreshList() { |
||||
$('#listTable').bootstrapTable('refresh'); |
||||
} |
||||
|
||||
//回车搜索 |
||||
mySearch('username', 'search-btn'); |
||||
mySearch('name', 'search-btn'); |
||||
mySearch('phone', 'search-btn'); |
||||
function search() { |
||||
$('#listTable').bootstrapTable('destroy'); |
||||
$('#listTable').bootstrapTable({ |
||||
url: "/user/index-json", |
||||
pagination: true, |
||||
sidePagination: 'server', |
||||
queryParams: function(params) { |
||||
params.username = $('#username').val(); |
||||
params.name = $('#name').val(); |
||||
params.phone = $('#phone').val(); |
||||
params.group_id = $('#group_id').val(); |
||||
params.is_leave = $('#is_leave').val(); |
||||
return params; |
||||
} |
||||
}); |
||||
return false; |
||||
} |
||||
|
||||
$(function() { |
||||
search(); |
||||
}); |
||||
</script> |
||||
<?php $this->endBlock(); ?> |
||||
|
After Width: | Height: | Size: 211 KiB |
After Width: | Height: | Size: 211 KiB |
After Width: | Height: | Size: 211 KiB |
After Width: | Height: | Size: 211 KiB |
After Width: | Height: | Size: 283 KiB |
After Width: | Height: | Size: 194 KiB |
Loading…
Reference in new issue