@@ -83,7 +83,7 @@ class CfHotelInfo extends Backend | |||||
if($keyValue){ | if($keyValue){ | ||||
return json(['list' => $result]); | return json(['list' => $result]); | ||||
} | } | ||||
return json(['list' => array_merge([['id'=>0,'name'=>'暂无']],$result)]); | |||||
return json(['list' => $result]); | |||||
} | } | ||||
/** | /** | ||||
@@ -56,7 +56,8 @@ class CfItem extends Backend | |||||
$list = $this->model | $list = $this->model | ||||
->alias("a") | ->alias("a") | ||||
->join('hbp_admin c','a.create_id = c.id','left') | ->join('hbp_admin c','a.create_id = c.id','left') | ||||
->field("a.*,c.nickname") | |||||
->join('hbp_admin d','a.purchase_user_id = d.id','left') | |||||
->field("a.*,c.nickname,d.nickname as purchase_user_name") | |||||
->where($where); | ->where($where); | ||||
if ($group_id){ | if ($group_id){ | ||||
$list = $list | $list = $list | ||||
@@ -71,9 +72,12 @@ class CfItem extends Backend | |||||
$config = \think\Config::get("site.item_category"); | $config = \think\Config::get("site.item_category"); | ||||
$config = json_decode($config,true); | $config = json_decode($config,true); | ||||
$config1 = \think\Config::get("site.item_unit"); | |||||
$config1 = json_decode($config1,true); | |||||
$res = $list->items(); | $res = $list->items(); | ||||
foreach ($res as $key=>$val){ | foreach ($res as $key=>$val){ | ||||
$res[$key]["item_type_name"]=$config[$val["item_type"]]; | $res[$key]["item_type_name"]=$config[$val["item_type"]]; | ||||
$res[$key]["item_unit"]=$config1[$val["item_unit"]]; | |||||
} | } | ||||
$result = array("total" => $list->total(), "rows" => $list->items()); | $result = array("total" => $list->total(), "rows" => $list->items()); | ||||
return json($result); | return json($result); | ||||
@@ -221,6 +225,11 @@ class CfItem extends Backend | |||||
foreach ($result as $key=>$value){ | foreach ($result as $key=>$value){ | ||||
$result[$key]["item_type_name"]= $config[$value["item_type"]]; | $result[$key]["item_type_name"]= $config[$value["item_type"]]; | ||||
} | } | ||||
$config = \think\Config::get("site.item_unit"); | |||||
$config = json_decode($config,true); | |||||
foreach ($result as $key=>$value){ | |||||
$result[$key]["item_unit"]= $config[$value["item_unit"]]; | |||||
} | |||||
if($keyValue){ | if($keyValue){ | ||||
return json(['list' => $result]); | return json(['list' => $result]); | ||||
} | } | ||||
@@ -51,7 +51,7 @@ class CfRoomPlan extends Backend | |||||
public function getList(){ | public function getList(){ | ||||
$name=$this->request->post('name'); | $name=$this->request->post('name'); | ||||
$keyValue=$this->request->post('keyValue'); | $keyValue=$this->request->post('keyValue'); | ||||
$this->model->field('id,plan_name as name'); | |||||
$this->model->field('id,plan_name as name,purchase_user_id'); | |||||
if($keyValue){ | if($keyValue){ | ||||
$this->model->where(['id'=>$keyValue]); | $this->model->where(['id'=>$keyValue]); | ||||
}elseif($name){ | }elseif($name){ | ||||
@@ -81,10 +81,10 @@ class CfRoomPlan extends Backend | |||||
$list = $this->model | $list = $this->model | ||||
->alias("a") | ->alias("a") | ||||
->join('hbp_admin c','a.create_id = c.id','left') | ->join('hbp_admin c','a.create_id = c.id','left') | ||||
->join('hbp_admin d','a.charge_person = d.id','left') | |||||
->join('hbp_admin d','a.purchase_user_id = d.id','left') | |||||
->join('hbp_cf_room_info e','a.room_id = e.id','left') | ->join('hbp_cf_room_info e','a.room_id = e.id','left') | ||||
->join('hbp_cf_hotel_info f','a.hotel_id = f.id','left') | ->join('hbp_cf_hotel_info f','a.hotel_id = f.id','left') | ||||
->field("a.*,c.nickname,d.nickname as charge_person_name,e.room_name,f.hotel_name") | |||||
->field("a.*,c.nickname,d.nickname as purchase_user_name,e.room_name,f.hotel_name") | |||||
->where($where); | ->where($where); | ||||
if ($group_id){ | if ($group_id){ | ||||
$list = $list | $list = $list | ||||
@@ -21,7 +21,7 @@ | |||||
<div class="form-group"> | <div class="form-group"> | ||||
<label class="control-label col-xs-12 col-sm-2">{:__('Item_unit')}:</label> | <label class="control-label col-xs-12 col-sm-2">{:__('Item_unit')}:</label> | ||||
<div class="col-xs-12 col-sm-8"> | <div class="col-xs-12 col-sm-8"> | ||||
<input id="c-item_unit" data-rule="required" class="form-control" name="row[item_unit]" type="text" value=""> | |||||
<input id="c-item_unit" data-rule="required" data-source="general/config/getList?key=site.item_unit" class="form-control selectpage" name="row[item_unit]" type="text" value=""> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-group"> | <div class="form-group"> | ||||
@@ -44,7 +44,12 @@ | |||||
<input id="c-detail_address" data-rule="required" class="form-control" name="row[detail_address]" type="text" value=""> | <input id="c-detail_address" data-rule="required" class="form-control" name="row[detail_address]" type="text" value=""> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-group"> | |||||
<label class="control-label col-xs-12 col-sm-2">{:__('采购负责人')}:</label> | |||||
<div class="col-xs-12 col-sm-8"> | |||||
<input id="c-purchase_user_id" data-rule="required" data-source="auth/admin/getList" class="form-control selectpage" name="row[purchase_user_id]" type="text" value=""> | |||||
</div> | |||||
</div> | |||||
<div class="form-group layer-footer"> | <div class="form-group layer-footer"> | ||||
<label class="control-label col-xs-12 col-sm-2"></label> | <label class="control-label col-xs-12 col-sm-2"></label> | ||||
<div class="col-xs-12 col-sm-8"> | <div class="col-xs-12 col-sm-8"> | ||||
@@ -16,7 +16,7 @@ | |||||
<div class="form-group"> | <div class="form-group"> | ||||
<label class="control-label col-xs-12 col-sm-2">{:__('Item_unit')}:</label> | <label class="control-label col-xs-12 col-sm-2">{:__('Item_unit')}:</label> | ||||
<div class="col-xs-12 col-sm-8"> | <div class="col-xs-12 col-sm-8"> | ||||
<input id="c-item_unit" data-rule="required" class="form-control" name="row[item_unit]" type="text" value="{$row.item_unit|htmlentities}"> | |||||
<input id="c-item_unit" data-rule="required" data-source="general/config/getList?key=site.item_unit" class="form-control selectpage" name="row[item_unit]" type="text" value="{$row.item_type|htmlentities}> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-group"> | <div class="form-group"> | ||||
@@ -40,6 +40,12 @@ | |||||
<input id="c-detail_address" data-rule="required" class="form-control" name="row[detail_address]" type="text" value="{$row.detail_address|htmlentities}"> | <input id="c-detail_address" data-rule="required" class="form-control" name="row[detail_address]" type="text" value="{$row.detail_address|htmlentities}"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-group"> | |||||
<label class="control-label col-xs-12 col-sm-2">{:__('采购负责人')}:</label> | |||||
<div class="col-xs-12 col-sm-8"> | |||||
<input id="c-purchase_user_id" data-rule="required" data-source="auth/admin/getList" class="form-control selectpage" name="row[purchase_user_id]" type="text" value="{$row.purchase_user_id|htmlentities}"> | |||||
</div> | |||||
</div> | |||||
<div class="form-group layer-footer"> | <div class="form-group layer-footer"> | ||||
<label class="control-label col-xs-12 col-sm-2"></label> | <label class="control-label col-xs-12 col-sm-2"></label> | ||||
<div class="col-xs-12 col-sm-8"> | <div class="col-xs-12 col-sm-8"> | ||||
@@ -58,7 +58,7 @@ | |||||
<div class="form-group"> | <div class="form-group"> | ||||
<label class="control-label col-xs-12 col-sm-2">{:__('Charge_person')}:</label> | <label class="control-label col-xs-12 col-sm-2">{:__('Charge_person')}:</label> | ||||
<div class="col-xs-12 col-sm-8"> | <div class="col-xs-12 col-sm-8"> | ||||
<input id="c-charge_person" data-rule="required" data-source="auth/admin/getList" class="form-control selectpage" name="row[charge_person]" type="text" value=""> | |||||
<input id="c-purchase_user_id" data-rule="required" data-source="auth/admin/getList" class="form-control selectpage" name="row[purchase_user_id]" type="text" value=""> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -57,7 +57,7 @@ | |||||
<div class="form-group"> | <div class="form-group"> | ||||
<label class="control-label col-xs-12 col-sm-2">{:__('Charge_person')}:</label> | <label class="control-label col-xs-12 col-sm-2">{:__('Charge_person')}:</label> | ||||
<div class="col-xs-12 col-sm-8"> | <div class="col-xs-12 col-sm-8"> | ||||
<input id="c-charge_person" data-rule="required" data-source="auth/admin/getList" class="form-control selectpage" name="row[charge_person]" type="text" value="{$row.charge_person|htmlentities}"> | |||||
<input id="c-purchase_user_id" data-rule="required" data-source="auth/admin/getList" class="form-control selectpage" name="row[purchase_user_id]" type="text" value="{$row.purchase_user_id|htmlentities}"> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-group layer-footer"> | <div class="form-group layer-footer"> | ||||
@@ -3,7 +3,12 @@ | |||||
return [ | return [ | ||||
'autoload' => false, | 'autoload' => false, | ||||
'hooks' => [], | 'hooks' => [], | ||||
'route' => [], | |||||
'route' => [ | |||||
'/example$' => 'example/index/index', | |||||
'/example/d/[:name]' => 'example/demo/index', | |||||
'/example/d1/[:name]' => 'example/demo/demo1', | |||||
'/example/d2/[:name]' => 'example/demo/demo2', | |||||
], | |||||
'priority' => [], | 'priority' => [], | ||||
'domain' => '', | 'domain' => '', | ||||
]; | ]; |
@@ -43,4 +43,5 @@ return array ( | |||||
'custom' => '自定义', | 'custom' => '自定义', | ||||
), | ), | ||||
'item_category' => '{"1":"一日游","2":"交通接驳","3":"租车","4":"门票"}', | 'item_category' => '{"1":"一日游","2":"交通接驳","3":"租车","4":"门票"}', | ||||
'item_unit' => '{"1":"件","2":"份","3":"匝","4":"张"}', | |||||
); | ); |
@@ -1,3 +1,15 @@ | |||||
define([], function () { | define([], function () { | ||||
require.config({ | |||||
paths: { | |||||
'async': '../addons/example/js/async', | |||||
'BMap': ['//api.map.baidu.com/api?v=2.0&ak=mXijumfojHnAaN2VxpBGoqHM'], | |||||
}, | |||||
shim: { | |||||
'BMap': { | |||||
deps: ['jquery'], | |||||
exports: 'BMap' | |||||
} | |||||
} | |||||
}); | |||||
}); | }); |
@@ -33,6 +33,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | |||||
{field: 'city_name', title: __('City_name'), operate: 'LIKE'}, | {field: 'city_name', title: __('City_name'), operate: 'LIKE'}, | ||||
{field: 'area_name', title: __('地区名'), operate: 'LIKE'}, | {field: 'area_name', title: __('地区名'), operate: 'LIKE'}, | ||||
{field: 'detail_address', title: __('Detail_address'), operate: 'LIKE'}, | {field: 'detail_address', title: __('Detail_address'), operate: 'LIKE'}, | ||||
{field: 'purchase_user_name', title: __('采购负责人'), operate: 'LIKE'}, | |||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | ||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | ||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | ||||
@@ -33,7 +33,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | |||||
{field: 'book_end_hour', title: __('Book_end_hour')}, | {field: 'book_end_hour', title: __('Book_end_hour')}, | ||||
{field: 'continuity_type', title: __('Continuity_type')}, | {field: 'continuity_type', title: __('Continuity_type')}, | ||||
{field: 'coutinuity_day', title: __('Coutinuity_day')}, | {field: 'coutinuity_day', title: __('Coutinuity_day')}, | ||||
{field: 'charge_person_name', title: __('Charge_person'), operate: 'LIKE'}, | |||||
{field: 'purchase_user_name', title: __('Charge_person'), operate: 'LIKE'}, | |||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | ||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | ||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | ||||