Commit 8d66aa17 by 朱继来

添加采购首页

parents ed7ea574 aaf5538c
...@@ -65,6 +65,10 @@ class ApiController extends Controller ...@@ -65,6 +65,10 @@ class ApiController extends Controller
public function ApiInquiryItemsClose($input, $id){ public function ApiInquiryItemsClose($input, $id){
Export((new InquiryItemsModel())->inquiryItemsClose($input)); Export((new InquiryItemsModel())->inquiryItemsClose($input));
} }
//询价: 选中 撤销 确认 -》 报价
public function ApiQuoteSure($input, $id){
Export((new QuoteModel())->updateStatus($input));
}
//吹报价 //吹报价
private function ApiUrgePrice($input, $id){ private function ApiUrgePrice($input, $id){
Export((new InquiryItemsModel())->urgePrice($input)); Export((new InquiryItemsModel())->urgePrice($input));
...@@ -93,36 +97,35 @@ class ApiController extends Controller ...@@ -93,36 +97,35 @@ class ApiController extends Controller
} }
//搜索品牌 //搜索品牌
private function ApiBrandList($request, $id){ private function ApiBrandList($input, $id){
(new CommonModel())->BrandList($request->input('k')); (new CommonModel())->BrandList($input['k']);
} }
//搜索型号 //搜索型号
private function ApiSkuList($request, $id){ private function ApiSkuList($input, $id){
(new CommonModel())->SkuList($request->input('k')); (new CommonModel())->SkuList($input['k']);
} }
//搜索采购 //搜索采购
private function ApiUserList($request, $id){ private function ApiUserList($input, $id){
(new CommonModel())->UserList($request->input('k')); (new CommonModel())->UserList($input['k']);
} }
//搜索供应商 //搜索供应商
private function ApiSupplierList($request, $id){ private function ApiSupplierList($input, $id){
(new CommonModel())->SupplierList($request->input('k')); (new CommonModel())->SupplierList($input['k']);
} }
//添加询价 //添加询价
private function ApiAddInquiry($input, $id){ private function ApiEditInquiry($input, $id){
Export((new InquiryModel())->addInquiry($input)); Export((new InquiryModel())->editInquiry($input));
} }
//生成报价/销售 询价单 //生成报价/销售 询价单
private function ApiAddInquiryReport($input, $id){ private function ApiAddInquiryReport($input, $id){
$InquiryItemsReportModel = new InquiryItemsReportModel(); $InquiryItemsReportModel = new InquiryItemsReportModel();
$data = $InquiryItemsReportModel->addOffer(1,$input); $data = $InquiryItemsReportModel->addOffer($input);
if ($data[0] > 0){ if ($data[0] > 0){
Export($data); Export($data);
} }
$report_sn = $data[2]["report_sn"]; $inquiry_id = $data[2]["inquiry_id"];
# $report_sn = "R2021030605803"; $InquiryItemsReportModel->createSalePdf($inquiry_id);
$InquiryItemsReportModel->createSalePdf($report_sn);
} }
//删除询价列表 //删除询价列表
...@@ -131,8 +134,8 @@ class ApiController extends Controller ...@@ -131,8 +134,8 @@ class ApiController extends Controller
} }
//导出询价 //导出询价
private function ApiInquiryExport($request){ private function ApiInquiryExport($input){
(new ExportModel())->InquiryExport($request->input(),$this->user_id); (new ExportModel())->InquiryExport($input,$this->user_id);
} }
//生成报价pdf //生成报价pdf
private function ApiOfferPdf($request){ private function ApiOfferPdf($request){
...@@ -209,4 +212,16 @@ class ApiController extends Controller ...@@ -209,4 +212,16 @@ class ApiController extends Controller
Export((new QuoteModel())->quoteCount($input)); Export((new QuoteModel())->quoteCount($input));
} }
//修改销售报价信息
public function ApiUpdateReport($input, $id)
{
Export((new InquiryItemsReportModel())->updateReport($input));
}
//获取客户信息
public function ApiGetUser($input, $id)
{
(new CommonModel())->getUser($input["k"],$input["types"]);
}
} }
...@@ -9,6 +9,20 @@ use DB; ...@@ -9,6 +9,20 @@ use DB;
//公共模型 //公共模型
class CommonModel extends Model class CommonModel extends Model
{ {
//搜索用户或者公司
public function getUser($k,$types=1)
{
$dbspu = DB::connection("liexin");
if ($types == 2) { #搜索公司
$brandInfo = $dbspu->select("select com_id as value,com_name as name from lie_user_company where com_name like '%".$k."%' limit 10");
echo json_encode($brandInfo,JSON_UNESCAPED_UNICODE) ;
exit();
}else{
$brandInfo = $dbspu->select("select user_id as value,user_name as name from lie_user_main where user_name like '%".$k."%' or mobile like '%".$k."%' limit 10");
echo json_encode($brandInfo,JSON_UNESCAPED_UNICODE) ;
exit();
}
}
//搜索联营品牌 //搜索联营品牌
public function BrandList($k,$types=1) public function BrandList($k,$types=1)
{ {
......
...@@ -117,7 +117,7 @@ class InquiryItemsModel extends Model ...@@ -117,7 +117,7 @@ class InquiryItemsModel extends Model
$data['create_uid'] = $input['user_id']; $data['create_uid'] = $input['user_id'];
$data['create_name'] = $UserModel->FinduserInfoName($input['user_id']); $data['create_name'] = $UserModel->FinduserInfoName($input['user_id']);
OplogModel::log($data); OplogModel::log($data);
} catch (Exception $e) { } catch (Exception $e) {
return [-1, $e->getMessage()]; return [-1, $e->getMessage()];
} }
...@@ -132,6 +132,7 @@ class InquiryItemsModel extends Model ...@@ -132,6 +132,7 @@ class InquiryItemsModel extends Model
} }
if (@$input["inquiry_items_id"]){ if (@$input["inquiry_items_id"]){
$del = $this->where(["id"=>$input["inquiry_items_id"]])->delete(); $del = $this->where(["id"=>$input["inquiry_items_id"]])->delete();
$del = (new InquiryItemsReportModel())->where(["id"=>$input["inquiry_items_id"]])->delete(); #同步输出报价表
} }
return [0,"删除成功"]; return [0,"删除成功"];
} }
...@@ -213,6 +214,12 @@ class InquiryItemsModel extends Model ...@@ -213,6 +214,12 @@ class InquiryItemsModel extends Model
$inquiryItemsId = $this->insertGetId($insertArr); $inquiryItemsId = $this->insertGetId($insertArr);
#插入销售报价表
(new InquiryItemsReportModel())->insert([
"inquiry_id"=>$b["inquiry_id"] ,
"inquiry_items_id"=>$inquiryItemsId ,
]);
#插入指定领取人 #插入指定领取人
if ($b["pur_s"] !== "" ){ if ($b["pur_s"] !== "" ){
$purArr = json_decode($b["pur_s"],true); $purArr = json_decode($b["pur_s"],true);
...@@ -230,6 +237,7 @@ class InquiryItemsModel extends Model ...@@ -230,6 +237,7 @@ class InquiryItemsModel extends Model
} }
} }
#日志 #日志
OplogModel::log([ OplogModel::log([
'types'=>1, 'types'=>1,
...@@ -371,6 +379,12 @@ class InquiryItemsModel extends Model ...@@ -371,6 +379,12 @@ class InquiryItemsModel extends Model
]); ]);
} }
} }
#插入销售报价表
(new InquiryItemsReportModel())->insert([
"inquiry_id"=>$b["inquiry_id"] ,
"inquiry_items_id"=>$inquiryItemsId ,
]);
} }
if(count($assignInsert) >0){ #插入指定人 if(count($assignInsert) >0){ #插入指定人
......
...@@ -21,16 +21,21 @@ class InquiryItemsReportModel extends Model ...@@ -21,16 +21,21 @@ class InquiryItemsReportModel extends Model
* 生成报价单或者销售单插入 report 表 * 生成报价单或者销售单插入 report 表
* @param $types 类型: 1 报价单 2 (销售单)生成订单 * @param $types 类型: 1 报价单 2 (销售单)生成订单
*/ */
public function addOffer($types,$input){ public function addOffer($input){
$inquiry_id = $input["inquiry_id"];
$currency = $input["currency"]; #币种
if ($inquiry_id <= 0){
return [1001,"询价单号不得为空"];
}
try{ try{
$con = DB::connection('rfq'); $con = DB::connection('rfq');
$con->beginTransaction(); $con->beginTransaction();
$inquiry_id = $input["inquiry_id"]; #先批量删除报价
$currency = $input["currency"]; #币种 $this->where("inquiry_id",$inquiry_id)->delete();
$insertArr = []; //批量插入数组 #最后批量添加
foreach ($input["items"] as $k=>$inquiry_items_id){ foreach ($input["items"] as $k=>$inquiry_items_id){
$temp = [ $temp = [
"inquiry_id"=>$inquiry_id , "inquiry_id"=>$inquiry_id ,
...@@ -48,16 +53,15 @@ class InquiryItemsReportModel extends Model ...@@ -48,16 +53,15 @@ class InquiryItemsReportModel extends Model
"create_name"=>$input["user_name"], "create_name"=>$input["user_name"],
"create_time"=>time() , "create_time"=>time() ,
]; ];
if ($currency == 1){ if ($currency == 1){
$temp["price_rmb"] =@$input["quote_price"][$k] ? $input["quote_price"][$k] : 0 ; $temp["price_rmb"] =@$input["quote_price"][$k] ? $input["quote_price"][$k] : 0 ;
}else{ }else{
$temp["price_origin"] =@$input["quote_price"][$k] ? $input["quote_price"][$k] : 0; $temp["price_origin"] =@$input["quote_price"][$k] ? $input["quote_price"][$k] : 0;
} }
array_push($insertArr,$temp); $this->where("inquiry_items_id",$inquiry_items_id)->update($temp); //更新销售报价
} }
$this->insert($insertArr); //批量插入
$con->commit(); $con->commit();
return [0,"成功",["inquiry_id"=>$inquiry_id]]; return [0,"成功",["inquiry_id"=>$inquiry_id]];
}catch (\Exception $e) { }catch (\Exception $e) {
...@@ -98,5 +102,26 @@ class InquiryItemsReportModel extends Model ...@@ -98,5 +102,26 @@ class InquiryItemsReportModel extends Model
Export([0,"成功","/server/DownPdf?file_name=".$name]); Export([0,"成功","/server/DownPdf?file_name=".$name]);
} }
/*
* 更新内容
*/
public function updateReport($data){
$inquiry_items_id = $data["inquiry_items_id"];
if ($inquiry_items_id <= 0) return [1001,"询价明细ID不得为空"];
$temp["price_origin"] = @$data["price_origin"] ? $data["price_origin"] : 0;
$temp["price_rmb"] = @$data["price_rmb"] ? $data["price_rmb"] : 0;
$temp["currency"] = @$data["currency"] ? $data["currency"] : 1;
if ($temp["currency"] == 1){
$temp["price_rmb"] = $data["price"];
}else{
$temp["price_origin"] = $data["price"];
}
$up = $this->where("inquiry_items_id",$inquiry_items_id)->update($temp);
(new QuoteModel())->where("id",$data["quote_id"])->update(["status"=>$data["status"]]); #更新报价选中
return [0,"成功"];
}
} }
\ No newline at end of file
...@@ -32,7 +32,7 @@ class InquiryModel extends Model ...@@ -32,7 +32,7 @@ class InquiryModel extends Model
$list = $rqpConn->table('inquiry as a') $list = $rqpConn->table('inquiry as a')
->join('inquiry_items as b','a.id','=','b.inquiry_id') ->join('inquiry_items as b','a.id','=','b.inquiry_id')
->select(DB::Raw("lie_a.inquiry_sn,lie_a.currency,lie_a.status as status_a,lie_a.customer_name,lie_a.create_name,lie_a.create_time as inquiry_ctime,lie_b.*")) ->select(DB::Raw("lie_a.inquiry_sn,lie_a.currency,lie_a.status as status_a,lie_a.com_name,lie_a.user_name,lie_a.create_name,lie_a.create_time as inquiry_ctime,lie_b.*"))
->where(function ($query) use ($input) { ->where(function ($query) use ($input) {
foreach ($input as $k => $v){ foreach ($input as $k => $v){
$v = trim($v); $v = trim($v);
...@@ -49,7 +49,7 @@ class InquiryModel extends Model ...@@ -49,7 +49,7 @@ class InquiryModel extends Model
case "goods_name": case "goods_name":
case "brand_name": case "brand_name":
case "customer_name": case "customer_name":
$query->whereRaw('lie_b.'.$k.' like "'.$v.'%"'); $query->whereRaw('(lie_b.com_name like "'.$v.'%" or lie_b.user_name like "'.$v.'%" )');
break; break;
case "status": case "status":
$query->where('b.status', '=',$v); $query->where('b.status', '=',$v);
...@@ -76,9 +76,7 @@ class InquiryModel extends Model ...@@ -76,9 +76,7 @@ class InquiryModel extends Model
$list = $list->where('a.create_uid', $user_id)->whereIn('a.status', [-1,1]); $list = $list->where('a.create_uid', $user_id)->whereIn('a.status', [-1,1]);
break; break;
case "2": //我的已关闭询价 case "2": //我的已关闭询价
$list = $list->where('a.create_uid', $user_id)->where("b.status",-1);
$list = $list->where('a.create_uid', $user_id)->whereIn("a.status",[-1]);
break;
case "3": //所有询价 case "3": //所有询价
$perm = new PermController; $perm = new PermController;
$role = $perm->getUserRole($user_id,$user_name); // 用户角色 $role = $perm->getUserRole($user_id,$user_name); // 用户角色
...@@ -100,6 +98,7 @@ class InquiryModel extends Model ...@@ -100,6 +98,7 @@ class InquiryModel extends Model
if (!$list) return [20001, '没有数据']; if (!$list) return [20001, '没有数据'];
$QuoteModel = new QuoteModel(); $QuoteModel = new QuoteModel();
$InquiryItemsUrgeModel = new InquiryItemsUrgeModel; $InquiryItemsUrgeModel = new InquiryItemsUrgeModel;
...@@ -113,6 +112,8 @@ class InquiryModel extends Model ...@@ -113,6 +112,8 @@ class InquiryModel extends Model
$v['create_time'] = timeToDate($v['create_time']); //创建时间 $v['create_time'] = timeToDate($v['create_time']); //创建时间
$v["customer_name"] = $v['com_name'] == "" ? $v['user_name'] : $v['com_name'] ;
$currency_sign = $v['currency'] == 1 ? '¥' : '$'; $currency_sign = $v['currency'] == 1 ? '¥' : '$';
$v['target_price'] = $currency_sign.$v['target_price']; // 客户目标报价 $v['target_price'] = $currency_sign.$v['target_price']; // 客户目标报价
...@@ -145,6 +146,7 @@ class InquiryModel extends Model ...@@ -145,6 +146,7 @@ class InquiryModel extends Model
return [1001,"询价单ID不得为空"]; return [1001,"询价单ID不得为空"];
} }
$this->where("id",$input["inquiry_id"])->update(["status"=>-1,"remark"=>@$input["remark"] ? $input["remark"] : "","update_time"=>time()]); $this->where("id",$input["inquiry_id"])->update(["status"=>-1,"remark"=>@$input["remark"] ? $input["remark"] : "","update_time"=>time()]);
(new InquiryItemsModel())->where("inquiry_id",$input["inquiry_id"])->update(["status"=>-1,"update_time"=>time()]);
return [0,"关闭整个询价单成功"]; return [0,"关闭整个询价单成功"];
} }
...@@ -175,7 +177,7 @@ class InquiryModel extends Model ...@@ -175,7 +177,7 @@ class InquiryModel extends Model
->where('c.assign_uid', $user_id); ->where('c.assign_uid', $user_id);
} }
$list = $list->select(DB::Raw("lie_a.inquiry_sn,lie_a.currency,lie_a.status as status_a,lie_a.create_name,lie_a.create_time as inquiry_ctime,lie_b.*")) $list = $list->select(DB::Raw("lie_a.inquiry_sn,lie_a.currency,lie_a.status as status_a,lie_a.user_name,lie_a.com_name,lie_a.create_name,lie_a.create_time as inquiry_ctime,lie_b.*"))
->where(function ($query) use ($input, $type) { ->where(function ($query) use ($input, $type) {
foreach ($input as $k => $v){ foreach ($input as $k => $v){
$v = trim($v); $v = trim($v);
...@@ -245,6 +247,7 @@ class InquiryModel extends Model ...@@ -245,6 +247,7 @@ class InquiryModel extends Model
$count = $QuoteModel->whereIn("status",QuoteMap::$status_used)->count(); $count = $QuoteModel->whereIn("status",QuoteMap::$status_used)->count();
$v['status_val'] = $v['status_val']."(".$count.")"; $v['status_val'] = $v['status_val']."(".$count.")";
} }
$v["customer_name"] = $v['com_name'] == "" ? $v['user_name'] : $v['com_name'] ;
$v['create_time'] = timeToDate($v['create_time']); //创建时间 $v['create_time'] = timeToDate($v['create_time']); //创建时间
...@@ -326,23 +329,29 @@ class InquiryModel extends Model ...@@ -326,23 +329,29 @@ class InquiryModel extends Model
} }
//从草稿生成正式询价单 //从草稿生成正式询价单
public function addInquiry($input){ public function editInquiry($input){
if (empty($input["inquiry_id"])) return [1001,"缺少询价单号"]; if (empty($input["inquiry_id"])) return [1001,"缺少询价单号"];
if (empty($input["customer_name"])) return [1001,"请选择询价客户名称"]; if (empty($input["user"])) return [1002,"请选择客户"];
if (empty($input["delivery_place"])) return [1002,"请选择交货地"]; if (empty($input["delivery_place"])) return [1002,"请选择交货地"];
$user = \GuzzleHttp\json_decode($input["user"],true);
$data = [ $data = [
"status"=>1, #启用 "status"=>1, #启用
"remark"=>$input["remark"],
"delivery_place"=>$input["delivery_place"], "delivery_place"=>$input["delivery_place"],
"customer_uid"=>$input["customer_uid"], "user_types"=>$input["user_types"], //询价客户类型: 1 个人 2 公司
"customer_name"=>$input["customer_name"],
"create_time"=>time(), "create_time"=>time(),
"update_time"=>time(), "update_time"=>time(),
]; ];
if ($input["user_types"] == 1){ #个人询价
$data["user_id"] = $user[0]["value"];
$data["user_name"] = $user[0]["name"];
}else{
$data["com_id"] = $user[0]["value"];
$data["com_name"] = $user[0]["name"];
}
$check = $inqueryId=$this->where("id",$input["inquiry_id"])->update($data); $check = $inqueryId=$this->where("id",$input["inquiry_id"])->update($data);
return [0,"新增询价成功"]; return [0,"操作成功"];
} }
} }
\ No newline at end of file
...@@ -554,4 +554,32 @@ class QuoteModel extends Model ...@@ -554,4 +554,32 @@ class QuoteModel extends Model
->count(); ->count();
} }
//询价: 选中 撤销 确认 -》 报价
public function updateStatus($input)
{
$id = $input['id'];
$status = $input['status'];
if (!$id) return [-1, '参数缺失'];
try {
$res = $this->where('id', $id)->update(['status' => $status, 'update_time'=>time()]);
$quote_info = $this->find($id);
$UserModel = new UserModel;
$data = [];
$data['types'] = 1;
$data['relation_id'] = $id;
$data['relation_sn'] = $quote_info['quote_sn'];
$data['content'] = '询价操作报价:'.QuoteMap::$status[$status];
$data['create_uid'] = $input['user_id'];
$data['create_name'] = $UserModel->FinduserInfoName($input['user_id']);
OplogModel::log($data);
} catch (Exception $e) {
return [1, $e->getMessage()];
}
return [0, '成功'];
}
} }
\ No newline at end of file
...@@ -3,24 +3,22 @@ namespace App\map; ...@@ -3,24 +3,22 @@ namespace App\map;
//报价枚举 //报价枚举
class QuoteMap{ class QuoteMap{
//状态 -1:已关闭 1:待报价 2:已报价 3:已选中 4:已固定 5:已确认 //状态 -1:已撤销 0:草稿 1:已报价 2:已选中 3:已确认
const status_close = -1; const status_close = -1;
const status_cao = 0;
const status_ready = 1; const status_ready = 1;
const status_replay = 2; const status_fix = 2;
const status_check = 3; const status_sure = 3;
const status_fix = 4;
const status_sure = 5;
static $status =[ static $status =[
self::status_close => "已关闭", self::status_close => "已撤销",
self::status_ready => "待报价", self::status_cao => "草稿",
self::status_replay => "已报价", self::status_ready => "已报价",
self::status_check => "已选中", self::status_fix => "已选中",
self::status_fix => "已固定",
self::status_sure => "已确认", self::status_sure => "已确认",
]; ];
//可用报价状态 //可用报价状态
static $status_used = [self::status_ready,self::status_replay,self::status_check,self::status_fix,self::status_sure]; static $status_used = [self::status_ready,self::status_fix,self::status_fix];
} }
......
...@@ -88,6 +88,18 @@ return [ ...@@ -88,6 +88,18 @@ return [
'prefix' => 'lie_', 'prefix' => 'lie_',
'strict' => false, 'strict' => false,
], ],
'liexin' => [ //liexin 数据库
'driver' => 'mysql',
'host' => env('DB_HOST_LIEXIN', ''),
'database' => env('DB_DATABASE_LIEXIN', ''),
'username' => env('DB_USERNAME_LIEXIN', ''),
'password' => env('DB_PASSWORD_LIEXIN', ''),
'port' => env('DB_PORT_LIEXIN', 3306),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => 'lie_',
'strict' => false,
],
'ass' => [ //ass数据库 'ass' => [ //ass数据库
'driver' => 'mysql', 'driver' => 'mysql',
'host' => env('DB_POOL_HOST', ''), 'host' => env('DB_POOL_HOST', ''),
......
/*
*
* INSPINIA - Responsive Admin Theme
* version 2.4
*
*/
$(document).ready(function () {
// Add body-small class if window less than 768px
if ($(this).width() < 769) {
$('body').addClass('body-small')
} else {
$('body').removeClass('body-small')
}
// MetsiMenu
$('#side-menu').metisMenu();
// Collapse ibox function
$('.collapse-link').click(function () {
var ibox = $(this).closest('div.ibox');
var button = $(this).find('i');
var content = ibox.find('div.ibox-content');
content.slideToggle(200);
button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
ibox.toggleClass('').toggleClass('border-bottom');
setTimeout(function () {
ibox.resize();
ibox.find('[id^=map-]').resize();
}, 50);
});
// Close ibox function
$('.close-link').click(function () {
var content = $(this).closest('div.ibox');
content.remove();
});
// Fullscreen ibox function
$('.fullscreen-link').click(function () {
var ibox = $(this).closest('div.ibox');
var button = $(this).find('i');
$('body').toggleClass('fullscreen-ibox-mode');
button.toggleClass('fa-expand').toggleClass('fa-compress');
ibox.toggleClass('fullscreen');
setTimeout(function () {
$(window).trigger('resize');
}, 100);
});
// Close menu in canvas mode
$('.close-canvas-menu').click(function () {
$("body").toggleClass("mini-navbar");
SmoothlyMenu();
});
// Run menu of canvas
$('body.canvas-menu .sidebar-collapse').slimScroll({
height: '100%',
railOpacity: 0.9
});
// Open close right sidebar
$('.right-sidebar-toggle').click(function () {
$('#right-sidebar').toggleClass('sidebar-open');
});
// Initialize slimscroll for right sidebar
$('.sidebar-container').slimScroll({
height: '100%',
railOpacity: 0.4,
wheelStep: 10
});
// Open close small chat
$('.open-small-chat').click(function () {
$(this).children().toggleClass('fa-comments').toggleClass('fa-remove');
$('.small-chat-box').toggleClass('active');
});
// Initialize slimscroll for small chat
$('.small-chat-box .content').slimScroll({
height: '234px',
railOpacity: 0.4
});
// Small todo handler
$('.check-link').click(function () {
var button = $(this).find('i');
var label = $(this).next('span');
button.toggleClass('fa-check-square').toggleClass('fa-square-o');
label.toggleClass('todo-completed');
return false;
});
// Minimalize menu
$('.navbar-minimalize').click(function () {
$("body").toggleClass("mini-navbar");
SmoothlyMenu();
});
// Tooltips demo
$('.tooltip-demo').tooltip({
selector: "[data-toggle=tooltip]",
container: "body"
});
// Move modal to body
// Fix Bootstrap backdrop issu with animation.css
$('.modal').appendTo("body");
// Full height of sidebar
function fix_height() {
var heightWithoutNavbar = $("body > #wrapper").height() - 61;
$(".sidebard-panel").css("min-height", heightWithoutNavbar + "px");
var navbarHeigh = $('nav.navbar-default').height();
var wrapperHeigh = $('#page-wrapper').height();
if (navbarHeigh > wrapperHeigh) {
$('#page-wrapper').css("min-height", navbarHeigh + "px");
}
if (navbarHeigh < wrapperHeigh) {
$('#page-wrapper').css("min-height", $(window).height() + "px");
}
if ($('body').hasClass('fixed-nav')) {
if (navbarHeigh > wrapperHeigh) {
$('#page-wrapper').css("min-height", navbarHeigh - 60 + "px");
} else {
$('#page-wrapper').css("min-height", $(window).height() - 60 + "px");
}
}
}
fix_height();
// Fixed Sidebar
$(window).bind("load", function () {
if ($("body").hasClass('fixed-sidebar')) {
$('.sidebar-collapse').slimScroll({
height: '100%',
railOpacity: 0.9
});
}
});
// Move right sidebar top after scroll
$(window).scroll(function () {
if ($(window).scrollTop() > 0 && !$('body').hasClass('fixed-nav')) {
$('#right-sidebar').addClass('sidebar-top');
} else {
$('#right-sidebar').removeClass('sidebar-top');
}
});
$(window).bind("load resize scroll", function () {
if (!$("body").hasClass('body-small')) {
fix_height();
}
});
$("[data-toggle=popover]")
.popover();
// Add slimscroll to element
$('.full-height-scroll').slimscroll({
height: '100%'
})
});
// Minimalize menu when screen is less than 768px
$(window).bind("resize", function () {
if ($(this).width() < 769) {
$('body').addClass('body-small')
} else {
$('body').removeClass('body-small')
}
});
// Local Storage functions
// Set proper body class and plugins based on user configuration
$(document).ready(function () {
if (localStorageSupport) {
var collapse = localStorage.getItem("collapse_menu");
var fixedsidebar = localStorage.getItem("fixedsidebar");
var fixednavbar = localStorage.getItem("fixednavbar");
var boxedlayout = localStorage.getItem("boxedlayout");
var fixedfooter = localStorage.getItem("fixedfooter");
var body = $('body');
if (fixedsidebar == 'on') {
body.addClass('fixed-sidebar');
$('.sidebar-collapse').slimScroll({
height: '100%',
railOpacity: 0.9
});
}
if (collapse == 'on') {
if (body.hasClass('fixed-sidebar')) {
if (!body.hasClass('body-small')) {
body.addClass('mini-navbar');
}
} else {
if (!body.hasClass('body-small')) {
body.addClass('mini-navbar');
}
}
}
if (fixednavbar == 'on') {
$(".navbar-static-top").removeClass('navbar-static-top').addClass('navbar-fixed-top');
body.addClass('fixed-nav');
}
if (boxedlayout == 'on') {
body.addClass('boxed-layout');
}
if (fixedfooter == 'on') {
$(".footer").addClass('fixed');
}
}
});
// check if browser support HTML5 local storage
function localStorageSupport() {
return (('localStorage' in window) && window['localStorage'] !== null)
}
// For demo purpose - animation css script
function animationHover(element, animation) {
element = $(element);
element.hover(
function () {
element.addClass('animated ' + animation);
},
function () {
//wait for animation to finish before removing classes
window.setTimeout(function () {
element.removeClass('animated ' + animation);
}, 2000);
});
}
function SmoothlyMenu() {
if (!$('body').hasClass('mini-navbar') || $('body').hasClass('body-small')) {
// Hide menu in order to smoothly turn on when maximize menu
$('#side-menu').hide();
// For smoothly turn on menu
setTimeout(
function () {
$('#side-menu').fadeIn(400);
}, 200);
} else if ($('body').hasClass('fixed-sidebar')) {
$('#side-menu').hide();
setTimeout(
function () {
$('#side-menu').fadeIn(400);
}, 100);
} else {
// Remove all inline style from jquery fadeIn function to reset menu state
$('#side-menu').removeAttr('style');
}
}
// Dragable panels
function WinMove() {
var element = "[class*=col]";
var handle = ".ibox-title";
var connect = "[class*=col]";
$(element).sortable(
{
handle: handle,
connectWith: connect,
tolerance: 'pointer',
forcePlaceholderSize: true,
opacity: 0.8
})
.disableSelection();
}
...@@ -111,7 +111,7 @@ class Connection implements ConnectionInterface ...@@ -111,7 +111,7 @@ class Connection implements ConnectionInterface
* *
* @var bool * @var bool
*/ */
protected $loggingQueries = false; //debug protected $loggingQueries = true; //debug
/** /**
* Indicates if the connection is in a "dry run". * Indicates if the connection is in a "dry run".
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment