Commit 5529798c authored by clone's avatar clone

Merge branch 'v2.9.3-0918' into test

# Conflicts: # application/index/controller/Member.php # application/index/service/PerformanceService.php
parents 96bdcfae 9a04ca8d
......@@ -63,8 +63,9 @@ class Shop extends Basic
$params = $this->params;
/*$params = array(
"site_area" => 4, //来源 1c首页 2c搜索
// "title" => "vv", //1,2 external_title ,3,4internal_title
// "title" => "vv", //1,2 external_title ,3,4internal_title
"house_id" => 4,
"business_id" => 4,
"is_carefully_chosen" => 0, //精选商铺--0否1是
"shop_type" => 0, //商铺类型(0商场,1街铺)
"address" => "111",
......@@ -77,9 +78,9 @@ class Shop extends Basic
"rent_price_end" => 10000,//租金
"shop_sign" => "临近地铁,临近地铁2",
"agent_id" => 630, //添加经纪人id
"status" => 1, //1上架or2下架
"start_time" => "2018-05-25",
"end_time" => "2018-05-30",
"status" => 1, //1上架or2下架
"start_time" => "2018-05-25",
"end_time" => "2018-05-30",
"pageNo" => 1,
"pageSize" => 15
);*/
......@@ -134,6 +135,9 @@ class Shop extends Basic
$conditions['disc'] = array( 'eq', trim($params['disc']) );
}
if (isset($params['business_id'])) { //商圈
$conditions['business_district_id'] = array( 'eq', trim($params['business_id']) );
}
if (isset($params['industry_type'])) { //业态
$conditions['industry_type'] = array( 'like', "%" . trim($params['industry_type']) . "%" );
}
......
......@@ -7,7 +7,6 @@ use app\api_broker\service\LookShopService;
use app\api_broker\service\VerifyService;
use app\api_broker\service\VipService;
use app\index\service\HouseService;
use app\index\validate\HouseValidate;
use app\model\AAgents;
use app\model\ACollectHouse;
use app\model\AttentionModel;
......@@ -77,6 +76,12 @@ class Shop extends Basic
"start_time" => "2018-05-25",
"end_time" => "2018-05-30",
"landlord_phone" => "17621970093",
//新增于180919
"p_district_name" => "一部",
"p_store_name" => "门店",
"p_agent_name" => "张三",
"pageNo" => 1,
"pageSize" => 15
);*/
......@@ -200,16 +205,23 @@ class Shop extends Basic
}
$houseIds = "";
if (isset($params['house_id'])) {
$houseIds = $params['house_id'];
} else {
if (isset($params['landlord_phone'])) {
$houseIds = $this->returnHouseId($params['landlord_phone']);
if (empty($houseIds)) {
return $this->response("200", "此条件没有找到数据");
}
} elseif (isset($params['landlord_phone'])) {
$houseIds = $this->returnHouseId($params['landlord_phone']);
if (empty($houseIds)) {
return $this->response("200", "此条件没有找到数据");
}
} elseif (isset($params['p_district_name']) || isset($params['p_store_name']) || isset($params['p_agent_name'])) {
$p_district_name = empty($params['p_district_name']) ? "" : $params['p_district_name'];
$p_store_name = empty($params['p_store_name']) ? "" : $params['p_store_name'];
$p_agent_name = empty($params['p_agent_name']) ? "" : $params['p_agent_name'];
$houseIds = $this->returnHouseIdByPanParty($p_district_name, $p_store_name, $p_agent_name);
if (empty($houseIds)) {
return $this->response("200", "此条件没有找到数据");
}
}
if (!empty($houseIds)) {
$conditions['id'] = array( "in", $houseIds );
......@@ -260,6 +272,45 @@ class Shop extends Basic
return $ids;
}
private function returnHouseIdByPanParty($p_district_name, $p_store_name, $p_agent_name)
{
$agentModel = new AAgents();
$params = [];
if ($p_district_name) {
$params["c.district_name"] = array( "like", "%" . trim($p_district_name) . "%" );
}
if ($p_store_name) {
$params["b.store_name"] = array( "like", "%" . trim($p_store_name) . "%" );
}
if ($p_agent_name) {
$params["a.name"] = array( "like", "%" . trim($p_agent_name) . "%" );
}
$ids = "";
if (empty($params)) {
return $ids;
}
$agentArr = $agentModel->getAgentsInfoByShop("a.id", $params);
$agentIds = "";
if (count($agentArr) < 1) {
return $ids;
} else {
foreach ($agentArr as $item) {
$agentIds .= $item["id"] . ",";
}
$agentIds = rtrim($agentIds, ",");
}
$verifyService = new VerifyService();
$selectParams = array( "in", $agentIds );
$houseIds = $verifyService->getPanpartyByAgentId($selectParams);
if ($houseIds) {
$ids = $houseIds;
}
return $ids;
}
/**
* 楼盘详情
......@@ -467,48 +518,10 @@ class Shop extends Basic
* 新增和编辑商铺
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function editV2()
{
$result['code'] = 200;
$result['msg'] = '';
$result['data'] = [];
if ($this->request->isPost()) {
$validate = new HouseValidate();
if ($this->params['id']) {
$check = $validate->scene('edit')->check($this->params);
} else {
$check = $validate->check($this->params);
}
if (true !== $check) {
return $this->response(101, $validate->getError());
}
$house_id = $this->gHousesModel->app_addV2($this->params, $this->agentId); //添加或编辑商铺
if ($house_id) {
$result['data']['house_id'] = $house_id['house_id'];
$result['data']['internal_title'] = empty($this->params['internal_title']) ? "" : $this->params['internal_title'];
$result['msg'] = '新增或编辑成功';
} else {
$data['code'] = 101;
$data['msg'] = 'Add houses failure';
}
} else {
if (empty($this->params['id'])) {
$result['code'] = 101;
$result['msg'] = 'Id is null';
} else {
//获取商铺详情
$result['data'] = $this->gHousesModel->getHouseById($this->params['id'], 1);
}
}
return $this->response($result['code'], $result['msg'], $result['data']);
return $this->response(101, '请升级至最新版本');
}
/**
......@@ -668,6 +681,7 @@ class Shop extends Basic
$msg = '';
$where['is_del'] = 0;
$where['status'] = 0;
if ($this->params['name'] != NULL) {
$where['name'] = [ 'LIKE', '%' . $this->params['name'] . '%' ];
......
......@@ -65,6 +65,9 @@ class User extends Basic
public function searchUser()
{
$params = $this->params;
//app_request_source_type 1:代表全部客户
$app_request_source_type = !empty($params["app_request_source_type"]) ? $params["app_request_source_type"] : 0;
/*$params = array(
"user_status" => 0,//客户状态(0:求租;1:已租;-1:无效)
"yetai" => "休闲娱乐",
......@@ -151,10 +154,21 @@ class User extends Basic
$is_search = false;
//是我的客户就显示全部
}else{
//不是我的客户排除纯房东
$conditions['user_label'] = array( "neq", 2 );
}
if($app_request_source_type == 1){
//'全部客户列表' 需要排除排除纯房东客户
$conditions['user_label'] = array( "neq", 2 );
if (!isset($conditions['create_time'])){
//1.'全部客户列表' 需要排除排除保护期内的客户
//2.上面流程如果不存在$conditions['create_time'],说明非精确搜索,排除排除保护期内的客户
$time_now = date('Y-m-d H:i:s');//当前时间
$time_before = date("Y-m-d H:i:s",strtotime("-1 day"));//24小时前的时间
$conditions['create_time'] = array( 'not between', array( $time_before, $time_now ) );
}
}
}
//dump($app_request_source_type);exit;
/*if (!$is_search) {
$conditions['user_label'] = array( "neq", 2 );
}*/
......@@ -564,11 +578,12 @@ class User extends Basic
}
//跟进人名字
if (!empty($this->params['remark_name'])) {
if (mb_strlen($this->params['remark_name']) < 2) {
// return $this->response(101, '名字长度不足2位');
return $this->response(101, '名字长度不足2位');
}
$agent_where['a.name'] = [ 'LIKE', '%' . $this->params['remark_name'] . '%' ];
$agent_where['name'] = [ 'LIKE', '%' . $this->params['remark_name'] . '%' ];
}
//跟进人手机号
......@@ -603,7 +618,7 @@ class User extends Basic
}
if (!empty($agent_where)) {
$m_agent = new AAgents();
$m_agent = new AAgents();
$agent_id_arr = $m_agent->getAgentById('id', $agent_where);
if (empty($agent_id_arr)) {
......@@ -627,6 +642,8 @@ class User extends Basic
$where['a.id'] = [ 'lt', $params['id'] ];
$order = 'a.id desc';
}
// dump($where);exit;
$field = 'a.id,a.user_id,b.user_nick,b.user_nick,b.agent_id,b.vip,b.create_time';
$model = new UPhoneFollowPp();
$model_res = $model->getLastOrNextUserIDPhoneFollowP($where, $field, $limit = 1, $order);
......
......@@ -28,7 +28,7 @@ class VerifyService
*/
public function getAgentsByAgentId($agent_id)
{
$params["id"] = $agent_id;
$params["id"] = $agent_id;
$result = $this->agentModel->searchAgentsByKeyword("id,store_id,district_id,level", $params);
if (count($result) > 0) {
$arr_list = [];
......@@ -118,8 +118,7 @@ class VerifyService
$params["a.agents_id"] = $agent_id;
$params["a.type"] = 2;
$params["a.is_del"] = 0;
$house_arr = $houseToAgentModel->getHouseByAgentId("a.houses_id,b.internal_title", $params);
$house_arr = $houseToAgentModel->getHouseByAgentId("a.houses_id,b.internal_title", $params);
$ids = "";
if (count($house_arr) > 0) {
......
......@@ -76,7 +76,7 @@
<span class="b3_span2 gw"></span>
</p>
<p class="b3_font1">
已入驻:
<span class="has-housed">已入驻:</span>
<span class="b3_span3 gw"></span>
</p>
......
......@@ -36,7 +36,7 @@
</tr>
<tr>
<td>业态:{{d.industry_type}}</td>
<td>已入驻:{{d.enter_num}}</td>
<td>{{(d.shop_type==1)?'当前商铺业态':'已入驻'}}:{{dealArea}}</td>
<td></td>
<td></td>
</tr>
......@@ -56,7 +56,9 @@
<td>营业时间:{{d.do_business_date}}</td>
<td v-if="!d.shop_type">招商时间:{{d.opening_date}}</td>
<td v-if="!d.shop_type">开业时间:{{d.start_business_date}}</td>
<!--<td>煤气:{{d.is_has_gas?'没有':'有'}}</td>-->
</tr>
<tr>
<td colspan="4">经纪人对本铺的评价:{{d.external_item_advantage}}</td>
</tr>
<tr>
<td>面宽:{{d.area_width}}米</td>
......@@ -94,10 +96,9 @@
<td colspan="2" v-if="!(d.is_show==1)">对外商铺名称:{{d.external_title}}</td>
<td colspan="2" v-if="!(d.is_show==1)">对外商铺地址:{{d.external_address}}</td>
</tr>
<tr v-if="!(d.is_show==1)">
<td colspan="2">经纪人对本铺的评价:{{d.external_item_advantage}}</td>
<tr>
<td v-if="d.shop_type" colspan="2">对外转让费:{{(d.external_slotting_fee == '-1')?'面议':(d.external_slotting_fee+'元')}}</td>
<td v-else colspan="2"></td>
<td v-else colspan="3"></td>
</tr>
<tr v-if="!(d.is_show==1) && d.cover_plan">
<td colspan="4" class="oh">
......@@ -151,6 +152,11 @@
<td v-if="(d.is_exclusive_type==1)">独家有效期:{{d.agent_start_time+'至'+d.agent_end_time}}</td>
<td v-if="(d.is_exclusive_type==1)"><!--独家方:{{d.exclusive_name}}--></td>
</tr>
<tr v-show='clickPublicUser("index/isShow")'>
<td colspan="4" align="center">
<a href="javascript:;" class="is-public-user" @click="isPublicUser()">C端公开</a>
</td>
</tr>
</tbody>
</table>
</section>
......@@ -187,6 +193,22 @@
<p><a href="javascript:;" @click="saveGenjin">保存</a></p>
</div>
</div>
<!--c端公开-->
<div class="modal-area" v-show="modalShow3">
<div class="public-hide-area">
<span class="is-public-show">是否对客户展示:</span>
<select name="" class="choose-public-user" v-model.trim="select_public">
<option value="0"></option>
<option value="1"></option>
</select>
<span class="color-biaoshi">(请点击进行选择)</span>
<p>
<a href="javascript:;" @click="savePublicUser()" class="save-is-public">保存</a>
<a href="javascript:;" @click="hidePublicUser()" class="cancel-is-public">取消</a>
</p>
</div>
</div>
</div>
<script src="/app/js/libs/require.min.js" data-js="/app/js/shop_detail_pc.js" data-main="/app/js/main" data-norem="yes" defer async="true"></script>
</body>
......
......@@ -362,7 +362,7 @@ class Agent extends Basic
$agent_evaluate_fraction_res = $model->getAgentEvaluateFraction($field, $params);
$agent_evaluate_fraction = 0;
if ($agent_evaluate_fraction_res[0]['agent_evaluate_fraction']) {
$agent_evaluate_fraction = round($agent_evaluate_fraction_res[0]['agent_evaluate_fraction'] / 2 / $agent_evaluate_num, 1);
$agent_evaluate_fraction = floor($agent_evaluate_fraction_res[0]['agent_evaluate_fraction'] / 2 / $agent_evaluate_num);
}
$res['agents_id'] = $v;
......
......@@ -175,7 +175,7 @@ class Broker extends Basic
*
* @return \think\Response
*/
public function delTohouses() {
public function delToHouses() {
$data['status'] = 200;
$data['data'] = '';
$data['msg'] = '';
......@@ -194,29 +194,37 @@ class Broker extends Basic
* 获取经纪人和楼盘关系信息
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentsTohouses() {
public function getAgentsToHouses() {
$data['status'] = 200;
$data['data'] = '';
$data['msg'] = '';
if ($this->params['houses_id']) {
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$hg = new GHousesToAgents();
$fields = 'b.id,b.name,b.phone';
$where['a.is_del'] = ['=',0];
$where['b.status'] = ['=',0];
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$fields = 'b.id,b.name,b.phone';
$where['a.is_del'] = ['=',0];
$where['b.status'] = ['=',0];
if (!empty($this->params['type'])) {
$where['a.type'] = $this->params['type'];
}
if (!empty($this->params['houses_id'])) {
$where['a.houses_id'] = $this->params['houses_id'];
$data['data'] = $hg->getAgentsHousesList($pageNo, $pageSize, 'id DESC', $fields, $where);
} else {
$data['status'] = 101;
$data['msg'] = 'houses_id is null';
}
if (!empty($this->params['agent_id'])) {
$where['a.agents_id'] = $this->params['agents_id'];
}
if (!empty($this->params['agent_name'])) {
$where['b.name'] = ['LIKE', '%'.$this->params['agent_name'].'%'];
}
$m_house = new GHousesToAgents();
$data['data'] = $m_house->getAgentsHousesList($pageNo, $pageSize, 'id DESC', $fields, $where);
return $this->response($data['status'], $data['msg'], $data['data']);
}
......
......@@ -31,10 +31,6 @@ class BusinessDistrict extends Basic
$data['province'] = $params['province'];
$data['city'] = $params['city'];
$data['disc'] = $params['disc'];
$data['province_code'] = $params['province_code'];
$data['city_code'] = $params['city_code'];
$data['disc_code'] = $params['disc_code'];
$data['name'] = $params['business'];
$data['create_time'] = date('Y-m-d H:i:s');
} else {
......@@ -144,6 +140,7 @@ class BusinessDistrict extends Basic
$msg = '';
$where['is_del'] = 0;
$where['status'] = 0;
if ($this->params['name'] != NULL) {
$where['name'] = ['LIKE', '%'.$this->params['name'].'%'];
......
This diff is collapsed.
......@@ -10,7 +10,6 @@ namespace app\index\controller;
use app\api_broker\service\LookShopService;
use app\api_broker\service\PushMessageService;
use app\index\extend\Basic;
use app\index\service\HouseService;
use app\index\validate\HouseValidate;
......@@ -294,13 +293,13 @@ class Houses extends Basic
}
/*根据库存判断是否已租*/
if ($this->params['leased'] != -1) {
if ($this->params['leased'] == 0) {
$where['residue_num'] = 0;
} else {
$where['residue_num'] = [ '<>', 0 ];
}
}
// if ($this->params['leased'] != -1) {
// if ($this->params['leased'] == 0) {
// $where['residue_num'] = 0;
// } else {
// $where['residue_num'] = [ '<>', 0 ];
// }
// }
/*业态*/
if ($this->params['industry_type'] != NULL) {
......@@ -333,6 +332,19 @@ class Houses extends Basic
$agent_where['a.is_del'] = 0;
}
if ($this->params['dish_store_id'] != NULL) {
$agent_where['b.store_id'] = $this->params['dish_store_id'];
$agent_where['a.type'] = 2;
$agent_where['a.is_del'] = 0;
}
if ($this->params['dish_district_id'] != NULL) {
$agent_where['b.district_id'] = $this->params['dish_district_id'];
$agent_where['a.type'] = 2;
$agent_where['a.is_del'] = 0;
}
//盘方搜索
if (!empty($agent_where)) {
$m_to_agent = new GHousesToAgents();
$agent_arr = $m_to_agent->getAgentsHouseField('houses_id', $agent_where);
......@@ -401,7 +413,7 @@ class Houses extends Basic
}
$data['data']['list'] = $this->house->getHouseListDish($pageNo, $pageSize, 'id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getHouseListDishTotal($where);
$data['data']['total'] = $this->house->getHouseListTotal($where);
$look_shop = new LookShopService();
......@@ -726,4 +738,39 @@ class Houses extends Basic
}
return $this->response($code, $msg, $data['data']);
}
/**
* 是否对C端显示
*
* @return \think\Response
*/
public function isShow() {
$code = 200;
$msg = '';
$house_check = new HouseValidate();
$check = $house_check->scene('show')->check($this->params);
if (true !== $check) {
return $this->response(101, $house_check->getError());
}
try {
$house = new GHouses();
$house_data = $house->getHouseDetail('id,is_show', ['id'=>$this->params['id']]);
if (empty($house_data['id'])) {
$code = 101;
$msg = '没有该商铺';
} else {
if ($house_data['is_show'] != $this->params['is_show']) {
$house->editData(['is_show'=> $this->params['is_show']], $this->params['id']);
}
}
} catch (\Exception $e) {
$code = 101;
$msg = $e->getMessage();
}
return $this->response($code, $msg, []);
}
}
\ No newline at end of file
......@@ -170,20 +170,15 @@ class ImageDepot extends Basic
public function ceshi(){
/* $ImageDepotService = new ImageDepotService();
$res = $ImageDepotService->getImage('商场美食1');*/
$indoor_img_id = 1;
// $outdoor_img_id = 2;
if($indoor_img_id){
$arr[]=$indoor_img_id;
$a = 1;
dump($a);
dump('============');
if($a == 2){
}
dump('============');
if($outdoor_img_id){
$arr[]=$outdoor_img_id;
}
dump(implode(',',$arr));
dump($a);
}
......
......@@ -222,8 +222,8 @@ class Member extends Basic{
//客方姓名
if (!empty($params['user_agent_name'])) {
$where['b.name'] = $params['user_agent_name'];//2018年09月18日之前根据姓名搜索
//$where['b.id'] = $params['user_agent_name'];
//$where['b.name'] = $params['user_agent_name'];//2018年09月18日之前根据姓名搜索
$where['b.id'] = $params['user_agent_name'];
$type = 3;
}
......@@ -288,6 +288,9 @@ class Member extends Basic{
$where['a.referrer_source'] = 10 ;
}
//'客户列表' 需要排除排除纯房东客户
$where['a.user_label'] = array( "neq", 2 );
$fields = 'a.id,a.user_nick,a.create_time,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.user_label,
a.user_name,a.status,a.first_login_time,a.last_login_time,a.agent_id,a.vip,a.price_demand,a.industry_type,a.area_demand,a.user_status,a.source';
......
......@@ -128,14 +128,14 @@ class OperationData extends Basic
}
$where['status'] = array( 'neq', 3 );//排除删除的商铺
// 商铺总量
$house_res = $this->gHousesModel->getHouseNum($where);
$house_res = $this->gHousesModel->getHouseListTotal($where);
$result["house_num"] = $house_res;
// 待租商铺数量
/*$where['residue_num'] = array( 'neq', 0 );
$where['total'] = array( 'neq', 0 );*/
$where['status'] = 1;
$house_res = $this->gHousesModel->getHouseNum($where);
$house_res = $this->gHousesModel->getHouseListTotal($where);
$result["have_not_rent_num"] = $house_res;
return $this->response(200, 'success', $result);
......
......@@ -68,6 +68,10 @@ class Performance extends Basic
"end_day" => "",
"start_day" =>"",
);*/
$checkResult = $this->validate($params, "PerformanceServiceValidate.selectStorePerformance");
if (true !== $checkResult) {
return $this->response(101, $checkResult);
}
$params["type"] = 3;
......@@ -80,7 +84,7 @@ class Performance extends Basic
$father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ;
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$params);
//dump($list);
if (count($list) > 0) {
$result["list"] = $list['list'];
......@@ -108,7 +112,10 @@ class Performance extends Basic
"start_day" => '2018-08-08',
"end_day" => '2018-08-08',
);*/
$checkResult = $this->validate($params, "PerformanceServiceValidate.selectStorePerformance");
if (true !== $checkResult) {
return $this->response(101, $checkResult);
}
$params["type"] = 2;
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
......@@ -116,7 +123,7 @@ class Performance extends Basic
$end_day = !empty($params["end_day"]) ? $params["end_day"] : date("Y-m-d", time());
$start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time());
$father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ;
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$params);
if (count($list) > 0) {
$result["list"] = $list['list'];
$result["total"] = $list['total'];
......@@ -145,7 +152,10 @@ class Performance extends Basic
"start_day" => "",
);*/
$checkResult = $this->validate($params, "PerformanceServiceValidate.selectStorePerformance");
if (true !== $checkResult) {
return $this->response(101, $checkResult);
}
$params["type"] = 1;
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
......@@ -155,7 +165,7 @@ class Performance extends Basic
$start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time());
$father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ;
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$params);
//dump($list);
if (count($list) > 0) {
$result["list"] = $list['list'];
......
......@@ -10,6 +10,7 @@ namespace app\index\controller;
use app\index\extend\Basic;
use app\index\validate\StoreValidate;
use app\model\AStore;
class Store extends Basic
......@@ -81,6 +82,16 @@ class Store extends Basic
return $this->response(101, '参数错误,修改失败!');
}
$store_validate = new StoreValidate();
if (empty($this->params['id'])) {
if (!$store_validate->scene('add')->check($this->params)) {
return $this->response(101, $store_validate->getError());
}
} else {
if (!$store_validate->scene('edit')->check($this->params)) {
return $this->response(101, $store_validate->getError());
}
}
$store = new AStore();
$this->data = $store->addStoreAgents($this->params, $this->params['agents_id']);
......
......@@ -49,7 +49,13 @@ class HouseService
$result = [];
$validate = new HouseValidate();
if (!$validate->check($data)) {
if (empty($data['id'])) {
$check = $validate->scene('add')->check($data);
} else {
$check = $validate->scene('edit')->check($data);
}
if (!$check) {
$result['status'] = 'fail';
$result['msg'] = $validate->getError();
return $result;
......@@ -61,17 +67,65 @@ class HouseService
return $result;
}
$house_id = $this->house->addHouse($data, $agent_id);
if (!empty($data['id'])) {
$house_data = $this->house->getHouseInfo('id,internal_address,internal_title', ['id'=>$data['id']]);
if (empty($house_data[0]['id'])) {
$result['status'] = 'fail';
$result['msg'] = '没有该商铺信息';
return $result;
}
$m_operating = new GOperatingRecords();
$remark = '修改为:剩余铺数'.$data['residue_num'];
if ($data['is_exclusive_type'] == 1) {
$remark .= ',独家有效期 '.$data['agent_start_time'].'—'.$data['agent_end_time'];
}
$m_operating->record($agent_id, 6, $remark, $house_id);
if ($data['internal_title'] != $house_data[0]['internal_title']) {
$remark .= ',商铺名改为:'.$data['internal_title'];
}
if ($data['internal_address'] != $house_data[0]['internal_address']) {
$remark .= ',地址改为:'.$data['internal_address'];
}
$house_ext = new GHousesExt();
$house_data_ext = $house_ext->getInfo('landlord_phone', ['house_id'=>$data['id']]);
if (!empty($house_data_ext['landlord_phone'])) {
$landlord_phone_arr = $landlord_phone_new_arr = $landlord_phone_old = [];
$landlord_phone = json_decode($house_data_ext['landlord_phone'], true);
if ($is_app == 1) {
$landlord_phone_new = json_decode($data['landlord_phone'], true);
} else {
$landlord_phone_new = $data['landlord_phone'];
}
foreach ($landlord_phone as $v) {
$landlord_phone_arr[] = $v['phone'];
}
foreach ($landlord_phone_new as $v2) {
$landlord_phone_new_arr[] = $v2['phone'];
}
foreach ($landlord_phone_arr as $v3) {
if (!empty($v3) && !in_array($v3, $landlord_phone_new_arr)) {
$landlord_phone_old[] = $v3;
}
}
if (!empty($landlord_phone_old)) {
$remark .= ',删除房东手机号:'. implode(',', $landlord_phone_old);
}
}
$m_operating->record($agent_id, 6, $remark, $data['id']);
}
$house_id = $this->house->addHouse($data, $agent_id);
if (empty($house_id)) {
$result['status'] = 'fail';
$result['msg'] = '新增或编辑商铺失败';
......
......@@ -14,73 +14,83 @@ use think\Validate;
class HouseValidate extends Validate
{
protected $rule = [
'internal_title' => 'require|length:1,125',
'internal_title' => 'require|length:1,125',
'internal_address' => 'require|length:1,125',
'province' => 'require|length:1,60',
'city' => 'require|length:1,60|in:上海市,杭州市',
'disc' => 'require|length:1,60',
'market_area' => 'require|between:0,9999999',
'shop_area_start' => 'require|between:0,9999999',
'rent_type' => 'require',
'rent_price' => 'require',
'industry_type' => 'require',
'shop_type' => 'require|in:0,1',
'shop_sign' => 'require',
'management_fee' => 'require|between:0,9999999999',
'slotting_fee' => 'require|between:0,9999999999',
'residue_num' => 'require|between:0,9999999999',
'total' => 'require|between:0,9999999999',
'longitude' => 'require|min:1',
'latitude' => 'require|min:1',
'is_show' => 'require|in:0,1',
'fee_rule' => 'require',
'internal_item_advantage' => 'require',
// 'business_district_id' => 'require'
'province' => 'require|length:1,60',
'city' => 'require|length:1,60|in:上海市,杭州市',
'disc' => 'require|length:1,60',
'market_area' => 'require|between:0,9999999',
'shop_area_start' => 'require|between:0,9999999',
'rent_type' => 'require',
'rent_price' => 'require',
'industry_type' => 'require',
'shop_type' => 'require|in:0,1',
'shop_sign' => 'require',
'management_fee' => 'require|between:0,9999999999',
'slotting_fee' => 'require|between:0,9999999999',
'residue_num' => 'require|between:0,9999999999',
'total' => 'require|between:0,9999999999',
'longitude' => 'require|min:1',
'latitude' => 'require|min:1',
'is_show' => 'require|in:0,1',
'fee_rule' => 'require|length:1,500',
'internal_item_advantage' => 'require|length:1,500',
'business_district_id' => 'require|between: 1,99999999999',
'id' => 'require|between: 1,99999999999'
];
protected $message = [
'internal_title.require' => '对内商铺名为必填',
'internal_title.length' => '名称字数在1至125个字',
'internal_address.require'=> '对内商铺地址为必填',
'internal_title.require' => '对内商铺名为必填',
'internal_title.length' => '名称字数在1至125个字',
'internal_address.require' => '对内商铺地址为必填',
'internal_address.length' => '对内地址要在1至255个字',
'province.require' => '省份为必填',
'province.length' => '省份要在1至60个字',
'city.require' => '市为必填',
'city.length' => '对内地址要在1至60个字',
'city.in' => '只能添加上海和杭州的商铺',
'disc.require' => '区为必填',
'disc.length' => '对内地址要在1至60个字',
'market_area.require' => '商场面积为必填',
'market_area.between' => '商场面积值在0至9999999',
'province.require' => '省份为必填',
'province.length' => '省份要在1至60个字',
'city.require' => '市为必填',
'city.length' => '对内地址要在1至60个字',
'city.in' => '只能添加上海和杭州的商铺',
'disc.require' => '区为必填',
'disc.length' => '对内地址要在1至60个字',
'market_area.require' => '商场面积为必填',
'market_area.between' => '商场面积值在0至9999999',
'shop_area_start.require' => '店铺面积为必填',
'shop_area_start.between' => '店铺面积值在0至9999999',
'rent_type.require' => '租金模式为必填',
'rent_price.require' => '租金均价为必填',
'industry_type.require' => '业态为必填',
'shop_type.require' => '商铺类型为必填',
'shop_type.in' => '商铺类型值错误',
'shop_sign.require' => '商铺标签为必填',
'management_fee.require' => '物业费为必填',
'management_fee.between' => '物业费钱为0至9999999999',
'slotting_fee.require' => '进场费为必填',
'slotting_fee.between' => '进场费值为0至9999999999',
'residue_num.require' => '剩余铺数为必填',
'residue_num.between' => '剩余铺数值为0至9999999999',
'total.require' => '总铺数量为必填',
'total.between' => '总铺数量为0至9999999999',
'is_show.require' => '是否显示在c端必填',
'is_show.in' => '是否显示在c端参数不对',
'fee_rule.require' => '佣金规则必填',
'fee_rule.between' => '佣金规则字数为0至500',
'rent_type.require' => '租金模式为必填',
'rent_price.require' => '租金均价为必填',
'industry_type.require' => '业态为必填',
'shop_type.require' => '商铺类型为必填',
'shop_type.in' => '商铺类型值错误',
'shop_sign.require' => '商铺标签为必填',
'management_fee.require' => '物业费为必填',
'management_fee.between' => '物业费钱为0至9999999999',
'slotting_fee.require' => '进场费为必填',
'slotting_fee.between' => '进场费值为0至9999999999',
'residue_num.require' => '剩余铺数为必填',
'residue_num.between' => '剩余铺数值为0至9999999999',
'total.require' => '总铺数量为必填',
'total.between' => '总铺数量为0至9999999999',
'is_show.require' => '是否显示在c端必填',
'is_show.in' => '是否显示在c端参数不对',
'fee_rule.require' => '佣金规则必填',
'fee_rule.length' => '佣金规则字数为1至500',
'internal_item_advantage.require' => '对内项目优势必填',
'internal_item_advantage.between' => '对内项目优势字数为1至500',
'longitude' => '无法获取商铺坐标,请重新修改地址',
'latitude' => '无法获取商铺坐标,请重新修改地址',
// 'business_district_id' => '商圈必选'
'internal_item_advantage.length' => '对内项目优势字数为1至500',
'longitude.require' => '无法获取商铺坐标,请重新修改地址',
'longitude.min' => '商铺坐标参数错误',
'latitude.require' => '无法获取商铺坐标,请重新修改地址',
'latitude.min' => '商铺坐标参数错误',
'business_district_id.require' => '商圈必选',
'business_district_id.between' => '商圈参数错误',
'id.require' => '商铺id必传',
'id.between' => '商铺id错误'
];
protected $scene = [
'edit'=>['internal_title','internal_address','province','city','disc','market_area','shop_area_start','rent_type',
'rent_price','industry_type','shop_type','shop_sign','management_fee','slotting_fee','residue_num','total','is_show',
'fee_rule','internal_item_advantage','business_district_id']
'edit' => ['internal_title', 'internal_address', 'province', 'city', 'disc', 'market_area', 'shop_area_start', 'rent_type',
'rent_price', 'industry_type', 'shop_type', 'shop_sign', 'management_fee', 'slotting_fee', 'residue_num', 'total',
'fee_rule', 'internal_item_advantage', 'business_district_id'],
'add' => ['internal_title', 'internal_address', 'province', 'city', 'disc', 'market_area', 'shop_area_start', 'rent_type',
'rent_price', 'industry_type', 'shop_type', 'shop_sign', 'management_fee', 'slotting_fee', 'residue_num',
'total', 'longitude', 'latitude', 'fee_rule', 'fee_rule', 'internal_item_advantage', 'business_district_id'],
'show' => 'id,is_show'
];
}
\ No newline at end of file
<?php
namespace app\index\validate;
use think\Validate;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018-09-19
* Time: 上午10:58:12
*/
class PerformanceServiceValidate extends Validate
{
protected $rule = [
'order' => 'require|in:desc,asc',
];
protected $message = [
'order.require' => '排序必传',
'order.in' => '排序只能为desc或asc',
];
protected $scene = [
'selectDistrictPerformance' => [ 'order' ],
];
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/9/19
* Time: 16:02
*/
namespace app\index\validate;
use think\Validate;
class StoreValidate extends Validate
{
protected $rule = [
'id' => 'require|between:1,9999999999',
'agents_id' => 'require|between:1,9999999999',
'province' => 'require|length:1,60',
'city' => 'require|length:1,125',
'district' => 'require|length:1,125',
'address' => 'require|length:1,125',
'longitude' => 'require|length:1,125',
'latitude' => 'require|length:1,125',
'store_name' => 'require|length:1,125',
'scale' => 'require|length:1,12 5',
'district_id' => 'require|between:1,9999999999',
];
protected $message = [
'id.require' => '门店id必填',
'id.between' => '门店id参数错误',
'agents_id.require' => '经纪人id必填',
'agents_id.between' => '经纪人id参数错误',
'province.require' => '省份必填',
'province.length' => '省份字数太长',
'city.require' => '城市必填',
'city.length' => '城市字数太长',
'district.require' => '区域必填',
'district.length' => '区域字数太长',
'address.require' => '地址必填',
'address.length' => '地址字数太长',
'longitude.require' => '经纬度必填',
'longitude.length' => '经纬度字数太长',
'latitude.require' => '经纬度必填',
'latitude.length' => '经纬度字数太长',
'store_name.require' => '门店名必填',
'store_name.length' => '门店名字数太长',
'scale.require' => '门店规模必填',
'scale.length' => '门店规模字数太长',
'district_id.require' => '部门必选',
'district_id.length' => '部门字数太长',
];
protected $scene = [
'add' => ['agents_id','province','city','district','address','longitude','latitude','store_name','scale','district_id'],
'edit' => ['id','agents_id','province','city','district','address','longitude','latitude','store_name','scale','district_id']
];
}
\ No newline at end of file
......@@ -71,7 +71,8 @@
<thead>
<tr>
<td colspan="12" class="maintable-top-sub-tr">
<a class="btn btn-info liudan_pic_btn">第一级审核</a>
<a class="btn btn-info liudan_pic_btn">全部</a>
<a class="btn btn-default liudan_pic_btn">第一级审核</a>
<a class="btn btn-default liudan_pic_btn">第二级审核</a>
<a class="btn btn-default liudan_pic_btn">第三级审核</a>
<a class="btn btn-default liudan_pic_btn">已结单</a>
......@@ -258,6 +259,7 @@
<th class="text-center">慈善基金(元)</th>
<th class="text-center">现金奖(元)</th>
<th class="text-center">实收佣金(元)</th>
<th class="text-center">收佣日期</th>
<th class="text-center">确认时间</th>
<th class="text-center">操作</th>
</tr>
......@@ -312,12 +314,13 @@
<td class="text-center" id="maid_count_total_shishou"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
</tfoot>
</table>
<div class="detail-modal-maid-bottom-btn-area text-right">
<div href="#modal_date_select" data-toggle="modal">打开收佣日期选择框(默认隐藏)</div>
<a id="maid_ok_btn" class="btn btn-primary" data-toggle="modal">确认分佣</a>
<a id="maid_save_btn" class="btn btn-primary" data-toggle="modal">保存</a>
</div>
......@@ -483,6 +486,24 @@
<!-- /.modal -->
</div>
<!-- 弹出框 分佣提成选择收佣日期 -->
<div class="modal fade" id="modal_date_select" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop='static'>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">选择一个日期</h4>
</div>
<div class="modal-body">
<ul id="modal_date_select_ul">
</ul>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- 弹出框 开票税费新增 -->
<div class="modal fade" id="modal_new_tax" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
......
......@@ -208,6 +208,7 @@
<th class="text-center">慈善基金(元)</th>
<th class="text-center">现金奖(元)</th>
<th class="text-center">实收佣金(元)</th>
<th class="text-center">收佣日期</th>
<th class="text-center">确认时间</th>
<th class="text-center">操作</th>
......
......@@ -221,6 +221,7 @@
<th class="text-center">现金奖(元)</th>
<th class="text-center">实收佣金(元)</th>
<th class="text-center">确认时间</th>
<th class="text-center">确认时间</th>
<th class="text-center">操作</th>
</tr>
......
......@@ -192,6 +192,7 @@
<th class="text-center">慈善基金(元)</th>
<th class="text-center">现金奖(元)</th>
<th class="text-center">实收佣金(元)</th>
<th class="text-center">收佣日期</th>
<th class="text-center">确认时间</th>
<th class="text-center">操作</th>
</tr>
......@@ -246,6 +247,7 @@
<td class="text-center" id="maid_count_total_shishou"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
</tfoot>
......
......@@ -27,9 +27,10 @@
<option value="0">商场</option>
</select>
</div>
<div class="form-group">
<!--<div class="form-group">-->
<div class="form-group" style="display: none;">
<label for="show_all">是否给商户公开</label>
<select class="form-control" name="showCd" id="showCd" data-alert="请选择是否给商户公开">
<select class="form-control" name="showCd" id="showCd" disabled="">
<option value="">请选择</option>
<option value="0"></option>
<option value="1"></option>
......@@ -402,7 +403,7 @@
<input type="text" class="form-control input-100-width address-relate area-choose-btn-modal" data-toggle="modal" data-target=".bs-example-modal-lg" title="通过地址定位获取" readonly="readonly" id="province_internal" />
<input type="text" class="form-control input-100-width address-relate area-choose-btn-modal" data-toggle="modal" data-target=".bs-example-modal-lg" title="通过地址定位获取" readonly="readonly" id="city_internal" />
<input type="text" class="form-control input-100-width address-relate area-choose-btn-modal" data-toggle="modal" data-target=".bs-example-modal-lg" title="通过地址定位获取" readonly="readonly" id="disc_internal" />
<input type="text" class="form-control area-choose-btn-modal" id="address_internal" placeholder="请输入详细地址" data-alert="请填写对内详细地址!">
<input type="text" class="form-control area-choose-btn-modal" id="address_internal" placeholder="详细地址(格式xx路xx号xx)" data-alert="请填写正确格式的对内详细地址(xx路xx号xx)!">
</div>
<div class="form-group">
<label for="longitude">经度</label>
......@@ -434,7 +435,7 @@
<textarea class="form-control textarea-500-width" rows="3" id="traffic" data-alert="请填写交通内容!" placeholder="请输入"></textarea>
</div>
<div class="form-group full-width-100">
<label for="">已入驻</label>
<label for="" class="has-housed">已入驻</label>
<textarea class="form-control textarea-500-width" rows="3" id="hasMoved" data-alert="请填写已入住内容!" placeholder="请输入"></textarea>
</div>
</li>
......@@ -469,7 +470,7 @@
<label for="">对内项目优势</label>
<textarea class="form-control textarea-500-width" rows="3" id="internalYoushi" data-alert="请输入该商铺周边配套、所处地段和该商铺的优势!" placeholder="请输入"></textarea>
</div>
<div class="form-group full-width-100 show-c-part">
<div class="form-group full-width-100">
<label for=""> 经纪人对本铺的评价</label>
<textarea class="form-control textarea-500-width" rows="3" id="foreignYoushi" data-alert="请输入该商铺周边配套、所处地段和该商铺的优势!" placeholder="1、商铺周边配套(附近有什么)&#10;2、商铺所处地段怎么样&#10;3、商铺附近的人流怎么样"></textarea>
</div>
......
......@@ -144,6 +144,30 @@
height: 600px;
overflow-y: scroll;
}
/*盘方员工 姓名 下拉式 搜索*/
/*经纪人 搜索 下拉式*/
.left-phone{
margin-left: 10px;
float: left;
width: 230px;
position: relative;
}
.user-ul-agent{
width: 223px;
height: auto;
float: left;
position: absolute;
background: #fff;
border: .5px solid #ccc;
border-top: none;
left: 4px;
z-index: 999;
}
.user-ul-agent li{
list-style: none;
line-height: 30px;
margin-left: -28px;
}
</style>
<div id="page-content-wrapper">
<div class="container">
......@@ -152,7 +176,6 @@
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li><a href="#">商铺列表</a></li>
<li class="active">新增商铺</li>
<div class="pull-right">
<ul class="bread_btn">
<li>
......@@ -169,7 +192,7 @@
<tr>
<td colspan="10">
<form id="form_search">
<div class="col-xs-12 ld-Marheight" style="padding:0px">
<div class="col-xs-12" style="padding:0px">
<select class="form-control btn2" id="shop_area_id">
<option value="" selected="selected">区域</option>
</select>
......@@ -182,9 +205,9 @@
<option value="1">街铺</option>
</select>
<select class="form-control btn2" id="leased">
<option value="-1">商铺状态</option>
<option value="1" selected="selected">待租</option>
<option value="0">已租</option>
<option value="">商铺状态</option>
<option value="1" selected="selected">上架</option>
<option value="2">下架</option>
</select>
<select class="form-control btn2" id="rent_price">
<option value="-1">月租金</option>
......@@ -202,7 +225,7 @@
<input class="form-control btn2 " data-rule-phoneus="false" data-rule-required="false" id="internal_title" placeholder="对内商铺名称" type="text" value="">
<input class="form-control btn2 " data-rule-phoneus="false" data-rule-required="false" id="landlord_phone" placeholder="房东手机号" type="tel" value="">
</div>
<div class="main-select col-xs-12 ld-Marheight" style="padding:0px;">
<div class="main-select col-xs-12" style="padding:0px;">
<select class="form-control btn11 ld-Marheight" id="is_carefully_chosen">
<option value="-1"">是否显示在首页</option>
<option value="1"></option>
......@@ -228,8 +251,18 @@
<option value="310100">上海市</option>
<option value="330100">杭州市</option>
</select>-->
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish_name" placeholder="盘方(员工)姓名" type="text" value="">
<!--新增盘方部门 盘方门店 -->
<!--二级联动-->
<select class="form-control btn4 ld-Marheight input" name="" id="district_id_panfang" >
<option value="">盘方部门</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores_panfang" value="">
</select>
<div class="left-phone">
<input class="form-control margin-top-ld" data-rule-phoneus="false" data-rule-required="false" id="dish_name" placeholder="盘方(员工)姓名" type="text" value="">
<ul class="user-ul-agent"></ul>
</div>
<!--盘方员工姓名 下拉式 搜索-->
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish_phone" placeholder="盘方(员工)手机号" type="tel" value="">
<span class="fore-span ld-Marheight">创建时间:</span>
......@@ -272,11 +305,10 @@
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
......
......@@ -6,7 +6,28 @@
overflow-y: auto;
padding-bottom: 60px;
}
/*客方姓名 搜索*/
.left-phone{
margin-left: 10px;
float: left;
position: relative;
}
.user-ul-agent{
width: 100%;
height: auto;
position: absolute;
width: 192px;
border: 1px solid #ccc;
border-top: none;
background: #fff;
z-index: 999;
left: 2px;
}
.user-ul-agent li{
margin-left: -28px;
list-style: none;
line-height: 26px;
}
.modal-body-details {
width: 850px;
}
......@@ -250,7 +271,6 @@
background-color: orange;
}
/*上一条 下一条 样式*/
#user_up,
#user_down {
color: #337ab7;
......@@ -431,7 +451,6 @@
<select class="form-control btn2 margin-top-ld input" name="" id="guest_stores" title="客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项" value="">
</select>
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" name="user_agent_name" placeholder="客方(员工)姓名" type="text" value="">
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" name="user_agent" placeholder="客方手机号" type="text" value="">
<!--邀请人-->
<select class="form-control btn2 margin-top-ld input" name="" id="district_id2" title="
......@@ -459,6 +478,10 @@
<option value="310100">上海市</option>
<option value="330100">杭州市</option>
</select>-->
<div class="left-phone">
<input class="form-control margin-top-ld" data-rule-phoneus="false" data-rule-required="false" id="user_agent_name" placeholder="客方(员工)姓名" type="text" value="">
<ul class="user-ul-agent"></ul>
</div>
</div>
<div class="col-xs-12" style="padding:0px">
<span class="btn btn-info btn3 margin-top-ld" id="search">搜索</span>
......
......@@ -65,26 +65,20 @@
收款记录
view-->Collection-->getCollection.html
测绘路公交报告审核
view-->Finance-->toReportListOne.html
交报告审核
view-->Finance-->account_statement.html
审核撤销成交报告-第一级审核
view-->Collection-->getCollection.html
审核撤销成交报告-第二级审核
view-->Collection-->getCollection.html
审核撤销成交报告-第三级审核
view-->Collection-->getCollection.html
view-->Finance-->wait_back_out.html
业绩明细
view-->PerformanceSubsidiary-->performancesubsidiaryList.html
实收明细
view-->Finance-->partialCommissionList.html
实收明细(分佣提成明细)
view-->Finance-->commission.html
税费明细
view-->Finance-->getTallAgeList.html
view-->Finance-->tax.html
实收汇总
view-->Finance-->getCommissionTotalList.html
......
......@@ -233,6 +233,7 @@
<th class="text-center">慈善基金(元)</th>
<th class="text-center">现金奖(元)</th>
<th class="text-center">实收佣金(元)</th>
<th class="text-center">收佣日期</th>
<th class="text-center">确认时间</th>
<th class="text-center">操作</th>
</tr>
......@@ -287,6 +288,7 @@
<td class="text-center" id="maid_count_total_shishou"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
</tfoot>
......
......@@ -37,6 +37,30 @@
left: -25px;
}
/*经纪人 搜索 下拉式*/
.left-phone{
margin-left: 10px;
float: left;
margin-top: -5px;
width: 230px;
position: relative;
}
.user-ul-agent{
width: 223px;
height: auto;
float: left;
position: absolute;
background: #fff;
border: .5px solid #ccc;
border-top: none;
left: 4px;
z-index: 999;
}
.user-ul-agent li{
list-style: none;
line-height: 30px;
margin-left: -28px;
}
</style>
<div id="page-content-wrapper">
......@@ -70,8 +94,21 @@
<input class="form-control btn4" value="" data-rule-phoneus="false" data-rule-required="false" id="maintable_create_time" name="start_date" type="date">
<span class="fore-span margin-left-10">-</span>
<input class="form-control btn4" value="" data-rule-phoneus="false" data-rule-required="false" id="maintable_end_time" name="end_date" type="date">
<span class="btn btn-primary btn3 search" id="maintable_search">搜索</span>
<span class="btn btn-primary btn3" id="maintable_reset">重置</span>
<!--部门 门店 搜索 门店 经纪人 显示-->
<!--二级联动-->
<select class="form-control btn4 ld-Marheight input" name="" id="district_id" >
<option value="">选择部门</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
</select>
<div class="left-phone">
<input class="form-control margin-top-ld" data-rule-phoneus="false" data-rule-required="false" id="user_agent_name" placeholder="选择经纪人" type="text" value="">
<ul class="user-ul-agent"></ul>
</div>
<!--经纪人搜索 门店显示-->
<span class="btn btn-primary btn3 search left" id="maintable_search">搜索</span>
<span class="btn btn-primary btn3 left" id="maintable_reset">重置</span>
<!--<span class="btn btn-info btn3" id="maintable_export">导出excel</span>-->
</form>
</td>
......@@ -464,6 +501,7 @@
<th class="text-center">慈善基金</th>
<th class="text-center">现金奖</th>
<th class="text-center">实收佣金</th>
<th class="text-center">收佣日期</th>
<th class="text-center">确认时间</th>
<th class="text-center">操作</th>
</tr>
......@@ -485,6 +523,7 @@
<td class="text-center" id="maid_count_total_shishou"></td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
</tfoot>
......
......@@ -305,7 +305,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary submit_edit" data-dismiss="modal">
<button type="button" class="btn btn-primary submit_edit">
提交
</button>
</div>
......
......@@ -529,6 +529,28 @@ class AAgents extends BaseModel
->select();
return $result;
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentsInfoByShop($field, $params)
{
$where_["a.status"] = 0;
$result = Db::table($this->table)
->field($field)
->alias("a")
->join("a_store b", "a.store_id = b.id", "left")
->join("a_district c", "a.district_id = c.id", "left")
->where($params)
->select();
return $result;
}
/**
......
......@@ -258,8 +258,7 @@ class GHouses extends BaseModel
*/
public function getHouseListTotal($params = '')
{
return $this->alias('a')
->where($params)
return $this->where($params)
->count();
}
......@@ -349,25 +348,6 @@ class GHouses extends BaseModel
return $result;
}
/**
* 查询属于盘方的商铺列表总记录数
*
* @param string $params
* @return int|string
*/
public function getHouseListDishTotal($params = '')
{
// $data = $this->alias('a')
// ->join('g_houses_to_agents b', 'a.id=b.houses_id', 'left')
// ->join('a_agents c', 'b.agents_id=c.id', 'left')
// ->join('g_houses_ext d', 'a.id=d.house_id', 'left')
// ->where($params)
// ->group('a.id')
// ->count();
// return $data;
return $this->where($params)->count();
}
/**
* 添加和编辑商铺
*
......@@ -546,7 +526,6 @@ class GHouses extends BaseModel
public function addHouse(array $data, int $agent_id)
{
$save_data = [];
$house_id = 0;
//楼盘名针对内部
if (isset($data['internal_title'])) {
$save_data['internal_title'] = trim($data['internal_title']);
......@@ -672,9 +651,10 @@ class GHouses extends BaseModel
}
//0是1否显示在c端用户
if (isset($data['is_show'])) {
$save_data['is_show'] = $data['is_show'];
}
// if (isset($data['is_show'])) {
// $save_data['is_show'] = $data['is_show'];
// }
// $save_data['is_show'] = 1; //默认不对C端显示
//是否可以报备,如果可以就为0否则为1
if (isset($data['is_can_records'])) {
......@@ -1567,20 +1547,5 @@ class GHouses extends BaseModel
->select();
return $result;
}
public function getHouseNum($params)
{
$result = Db::table($this->table)
->field($field)
->where($params)
->count();
return $result;
}
}
......@@ -180,7 +180,11 @@ class GHousesExt extends BaseModel
//对外转让费:-1面议
if (isset($data['external_slotting_fee'])) {
$save_data['external_slotting_fee'] = trim($data['external_slotting_fee']);
if ($data['external_slotting_fee'] != -1) {
$save_data['external_slotting_fee'] = $data['external_slotting_fee'] * 100; //存分
} else {
$save_data['external_slotting_fee'] = $data['external_slotting_fee'];
}
}
//面宽
......@@ -236,9 +240,9 @@ class GHousesExt extends BaseModel
$ext_id = $this->where('house_id', $house_id)->value('id');
if ($ext_id > 0) {
$num = $this->where('id', $ext_id)->update($save_data);
$num = $this->db_->where('id', $ext_id)->update($save_data);
} else {
$num = $this->insert($save_data);
$num = $this->db_->insert($save_data);
}
if ($num > 0) {
......@@ -249,4 +253,18 @@ class GHousesExt extends BaseModel
return $result;
}
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getInfo($field, $where) {
return $this->db_->field($field)
->where($where)
->find();
}
}
\ No newline at end of file
......@@ -202,21 +202,26 @@ class GHousesToAgents extends BaseModel
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @return mixed
*/
public function getAgentsHousesList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '')
{
return $this->field($field)
->alias('a')
->join('a_agents b', 'a.agents_id = b.id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
try {
$result['data'] = $this->field($field)
->alias('a')
->join('a_agents b', 'a.agents_id = b.id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->group('a.agents_id')
->select();
$result['status'] = 'successful';
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
/**
......
......@@ -1027,7 +1027,7 @@ class OBargainModel extends Model
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getBargainPartial($pageNo, $pageSize, $order_ = 'id desc', $fields, $where)
public function getBargainPartial($pageNo, $pageSize, $order_ = 'id desc', $fields, $where, $bargain_id = 0)
{
$data = $this->field($fields)
->alias('a')
......@@ -1042,6 +1042,7 @@ class OBargainModel extends Model
$m_agent = new AAgents();
$m_partial = new OPartialCommission();
$m_real = new ORealIncome();
$fields_str = 'a.id,a.name,a.phone,b.store_name,c.district_name';
foreach ($data as $k => $v) {
$result[$k] = $v;
......@@ -1080,11 +1081,29 @@ class OBargainModel extends Model
}
}
$partial_commission = $m_partial->field('id,scale,practical_fee,cash,service_charge,charity_fund,real_fee,confirm_date,confirm_status,should_commission')
$partial_commission = $m_partial->field('id,scale,practical_fee,cash,service_charge,charity_fund,real_fee,confirm_date,confirm_status,should_commission,real_income_id')
->where('bargain_id', $v['id'])
->where('is_del', 0)
->order("id asc")
->select();
foreach ($partial_commission as $k2 => $v2) {
if (empty($v2['real_income_id'])) {
$income_time = $m_real->field('id,income_time')->where('bargain_id', $bargain_id)->select();
//当只有一个收入日期,给前端显示用
if (count($income_time) == 1) {
$income_time_add['id'] = $income_time[0]['id'];
$income_time_add['income_time'] = $income_time[0]['income_time'];
$partial_commission[$k2]['income_time_add'] = $income_time_add;
}
} else {
$income_time = $m_real->field('id,income_time')->find($v2['real_income_id']);
if (empty($income_time)) {
$partial_commission[$k2]['income_time'] = [];
} else {
$partial_commission[$k2]['income_time'] = $income_time;
}
}
}
//todo 最后一个分佣提成如果不为空则取其值
$i = count($partial_commission) - 1;
if ($partial_commission && $partial_commission[$i]["scale"] > 0) {
......
......@@ -36,6 +36,7 @@ class OPartialCommission extends BaseModel
->join('o_order c', 'b.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.agent_id = e.id', 'left')
->join('o_real_income f', 'a.real_income_id = f.id', 'left')
->where($where)
->order($order_)
->limit($pageSize)
......@@ -44,7 +45,7 @@ class OPartialCommission extends BaseModel
$result = [];
$m_agent = new AAgents();
$m_bargain = new OBargainModel();
$m_real = new ORealIncome();
$fields_str = 'a.id,a.name,a.phone,b.store_name,c.district_name';
foreach ($data as $k => $v) {
$result[$k] = $v;
......@@ -76,6 +77,9 @@ class OPartialCommission extends BaseModel
$data[$k]['role_name'] = '无';
}
}
if ($v['father_id'] != 0) {
$result[$k]['bargain_id'] = $v['father_id'];
}
}
return $result;
}
......@@ -109,21 +113,22 @@ class OPartialCommission extends BaseModel
$result = [];
$m_agent = new AAgents();
$m_real = new ORealIncome();
$fields_str = 'a.id,a.name,a.phone,b.store_name,c.district_name';
foreach ($data as $k => $v) {
$result[$k]['confirm_date'] = $v['confirm_date'];
$result[$k]['income_time'] = $m_real->where('id', $v['real_income_id'])->value('income_time');
if ($v['agent_id']) {
$agent_data = $m_agent->getStoreDistrict($fields_str, [ 'a.id' => $v['agent_id'] ]);
$result[$k]['district_store'] = $agent_data['store_name'] . '-' . $agent_data['store_name'];
$result[$k]['agent'] = $agent_data['name'] . '-' . $agent_data['phone'];
}
$result[$k]['practical_fee'] = $v['practical_fee'];
$result[$k]['scale_fee'] = $v['scale_fee'];
$result[$k]['should_commission'] = $v['should_commission'];
$result[$k]['real_fee'] = $v['real_fee'];
$result[$k]['service_charge'] = $v['service_charge'];
$result[$k]['charity_fund'] = $v['charity_fund'];
$result[$k]['practical_fee'] = $v['practical_fee'];
$result[$k]['cash'] = $v['cash'];
$result[$k]['real_fee'] = $v['real_fee'];
$result[$k]['practical_fee'] = $v['practical_fee'];
}
return $result;
}
......@@ -139,6 +144,7 @@ class OPartialCommission extends BaseModel
->join('o_order c', 'b.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.agent_id = e.id', 'left')
->join('o_real_income f', 'a.real_income_id = f.id', 'left')
->where($where)
->count();
}
......@@ -147,7 +153,8 @@ class OPartialCommission extends BaseModel
* 增加和编辑实收佣金
*
* @param $data
* @return int|string
* @return array|false
* @throws \Exception
*/
public function addCommission($data)
{
......@@ -286,6 +293,88 @@ class OPartialCommission extends BaseModel
return $data;
}
/**
* 分佣提成汇总表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @param $operation_start_data
* @param $operation_end_data
* @return mixed
*/
public function getCommissionTotalListV2($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field = '', $params = '', $operation_start_data, $operation_end_data)
{
try {
$data = $this->alias('a')
->field($field)
->join('a_agents b', 'a.agent_id = b.id', 'left')
->join('o_bargain c', 'a.bargain_id = c.id', 'left')
->join('o_real_income d', 'a.real_income_id = d.id', 'left')
->join('o_taxes f', 'a.bargain_id = f.bargain_id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->group('b.id')
->select();
$m_agent = new AAgents();
$m_tax = new OTaxes();
foreach ($data as $k => $v) {
if (isset($v['agent_id'])) {
$district_store = $m_agent->getStoreDistrict('store_name,district_name', [ 'a.id' => $v['agent_id'] ]);
$data[$k]['district_store'] = $district_store['district_name'] . '-' . $district_store['store_name'];
//税费
$data[$k]['fee'] = $m_tax->where('operation_date', 'between time', [ $operation_start_data, $operation_end_data ])
->where('agent_id', $v['agent_id'])
->where('is_del',0)
->sum('fee');
//去除多次应分佣金
$should_commission = $this->where('confirm_date', 'between time', [ $operation_start_data, $operation_end_data ])
->where('agent_id', $v['agent_id'])
->where('confirm_status', 1)
->where('is_del', 0)
->group('bargain_id')
->column('should_commission');
$data[$k]['should_commission'] = 0;
foreach ($should_commission as $kk => $vv) {
$data[$k]['should_commission'] += $vv;
}
$field_sum = 'sum(practical_fee) as practical_fee,sum(cash) as cash,sum(real_fee) as real_fee,sum(service_charge) as service_charge,
sum(charity_fund) as charity_fund';
//应分佣金
$partial_commission = $this->field($field_sum)
->where('confirm_date', 'between time', [ $operation_start_data, $operation_end_data ])
->where('agent_id', $v['agent_id'])
->where('confirm_status', 1)
->where('is_del', 0)
->find();
$data[$k]['practical_fee'] = $partial_commission['practical_fee'];
$data[$k]['cash'] = $partial_commission['cash'];
$data[$k]['real_fee'] = $partial_commission['real_fee'];
$data[$k]['service_charge'] = $partial_commission['service_charge'];
$data[$k]['charity_fund'] = $partial_commission['charity_fund'];
}
}
$result['status'] = 'successful';
$result['data'] = $data;
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
/**
* @param $params
* @return int|string
......@@ -301,6 +390,22 @@ class OPartialCommission extends BaseModel
->count();
}
/**
* @param $params
* @return int|string
*/
public function getCommissionTotalListTotalV2($params)
{
return $this->alias('a')
->join('a_agents b', 'a.agent_id = b.id', 'left')
->join('o_bargain c', 'a.bargain_id = c.id', 'left')
->join('o_real_income d', 'a.real_income_id = d.id', 'left')
->join('o_taxes f', 'a.bargain_id = f.bargain_id', 'left')
->where($params)
->group('a.agent_id')
->count();
}
/**
* 检查是否有未结单分佣
*
......@@ -337,4 +442,18 @@ class OPartialCommission extends BaseModel
return $result;
}
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getPartialDetail($field, $where) {
return $this->field($field)
->where($where)
->find();
}
}
\ No newline at end of file
......@@ -37,4 +37,24 @@ class ORealIncome extends BaseModel
->select();
}
/**
* @param string $field
* @param $where
* @return mixed
*/
public function getRealIncomeBargain($field = 'id as fee_id,money,income_time', $where) {
try {
$where['is_del'] = 0;
$result['data'] = $this->field($field)
->where($where)
->select();
$result['status'] = 'successful';
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
}
\ No newline at end of file
......@@ -106,7 +106,12 @@ class Regions extends Model
//区和商圈
foreach ($data[$k]['city'] as $k2=>$v2) {
$data[$k]['business_district'][$k2]['district'] = $v2;
$business_arr = $business->field('id,name')->where('city',$v['fullName'])->where('disc', $v2)->select();
$business_arr = $business->field('id,name')
->where('city',$v['fullName'])
->where('disc', $v2)
->where('is_del', 0)
->where('status', 0)
->select();
$data[$k]['business_district'][$k2]['business'] = array_merge($all_arr, $business_arr);
}
}
......
......@@ -104,8 +104,8 @@ Route::group('index', [
'getBrokerList' => [ 'index/broker/getBrokerList', [ 'method' => 'get' ] ],//门店列表的经纪人
'addHousesAgents' => [ 'index/broker/AddHousesAgents', [ 'method' => 'POST' ] ], //新增楼盘与经纪人关系(案场权限人)
'addHousesAgentsDish' => [ 'index/broker/AddHousesAgents', [ 'method' => 'POST' ] ], //新增楼盘与经纪人关系(盘方)
'delTohouses' => [ 'index/broker/delTohouses', [ 'method' => 'POST' ] ], //解除经纪人和楼盘关系
'getAgentsTohouses' => [ 'index/broker/getAgentsTohouses', [ 'method' => 'GET' ] ], //获取经纪人和楼盘关系信息
'delTohouses' => [ 'index/broker/delToHouses', [ 'method' => 'POST' ] ], //解除经纪人和楼盘关系
'getAgentsTohouses' => [ 'index/broker/getAgentsToHouses', [ 'method' => 'GET' ] ], //获取经纪人和楼盘关系信息
'getAgentDistrictStore' => [ 'index/broker/getAgentDistrictStore', [ 'method' => 'GET' ] ], //获取经纪人id获取部门门店名称
'getCurrentCity' => [ 'index/broker/getCurrentCity', [ 'method' => 'GET' ] ], //获取所属城市
'settingCity' => [ 'index/broker/settingCity', [ 'method' => 'POST' ] ], //设置所属城市
......@@ -113,6 +113,7 @@ Route::group('index', [
'transformLandlord' => [ 'index/houses/transformLandlord', [ 'method' => 'post' ] ],//转换房东手机号
'lockHouse' => [ 'index/houses/lockHouse', [ 'method' => 'post' ] ],//锁盘
'getEditLog' => [ 'index/houses/getEditLog', [ 'method' => 'get' ] ],//商铺修改日志
'isShow' => [ 'index/houses/isShow', [ 'method' => 'POST' ] ],//是否对C端显示
//版本管理
'version' => [ 'index/version/index', [ 'method' => 'get' ] ],
......@@ -209,6 +210,7 @@ Route::group('index', [
'reportListTwo/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 2 ] ], //财务 成交报告-未结单-第二级审核
'reportListThree/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 3 ] ], //财务 成交报告-未结单-第三级审核
'reportListStatement/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 4 ] ], //财务 成交报告-已结单
'reportListAll/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 10 ]], //财务 成交报告-全部
'backOutToOne' => [ 'index/Finance/backOutToOne', [ 'method' => 'POST' ] ], //财务 成交报告-撤销成交报告
'backOutOne/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 5 ] ], //财务 成交报告-待撤销-第一级数据
'backOutTwo/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 7 ] ], //财务 成交报告-待撤销-第二级数据
......@@ -218,7 +220,7 @@ Route::group('index', [
'refundListManager/:check_status' => [ 'index/Finance/refundList', [ 'method' => 'get|post' ], [ 'check_status' => 1 ] ], //退款列表-财务经理
'refundListMajordomo/:check_status' => [ 'index/Finance/refundList', [ 'method' => 'get|post' ], [ 'check_status' => 2 ] ], //退款列表-总监审核
'refundListCashier/:check_status' => [ 'index/Finance/refundList', [ 'method' => 'get|post' ], [ 'check_status' => 3 ] ], //退款列表-出纳审核
'refundOrderList' => [ 'index/Finance/refundOrderList', [ 'method' => 'get' ] ], //财务 已退款
'refundOrderList' => [ 'index/Finance/refundOrderList', [ 'method' => 'get' ]], //财务 已退款
'checkReportAttache/:check_status' => [ 'index/Finance/checkReport', [ 'method' => 'post' ], [ 'check_status' => 1 ] ], //审核成交报告-第一级审核
'checkReportManager/:check_status' => [ 'index/Finance/checkReport', [ 'method' => 'post' ], [ 'check_status' => 2 ] ], //审核成交报告-第二级审核
'checkReportMajordomo/:check_status' => [ 'index/Finance/checkReport', [ 'method' => 'post' ], [ 'check_status' => 3 ] ], //审核成交报告-第三级审核
......@@ -244,7 +246,7 @@ Route::group('index', [
'searchBargainAgents' => [ 'index/Finance/searchBargainAgents', [ 'method' => 'GET' ] ], //成交报告id获取盘方,客方,反签,独家,合作方
'searchOrderAgents' => [ 'index/Finance/searchOrderAgents', [ 'method' => 'GET' ] ], //order_id获取盘方,客方,反签,独家,合作方
'getTallAgeList' => [ 'index/Finance/getTallAgeList', [ 'method' => 'GET' ] ], //税费承担明细表
'getCommissionTotalList' => [ 'index/Finance/getCommissionTotalList', [ 'method' => 'GET' ] ], //分佣提成汇总表
'getCommissionTotalList' => [ 'index/Finance/getCommissionTotalListV2', [ 'method' => 'GET' ] ], //分佣提成汇总表
'getCollection' => [ 'index/Collection/getCollection', [ 'method' => 'post|get' ] ],//收款记录
'addRealMoney' => [ 'index/Collection/addRealMoney', [ 'method' => 'post|get' ] ],//新增实收
'visitShop' => [ 'index/Supervise/visitShop', [ 'method' => 'get' ] ],//门店拜访
......@@ -264,6 +266,7 @@ Route::group('index', [
'getTaxesById' => [ 'index/Finance/getTaxesById', [ 'method' => 'POST|GET' ] ], //财务结单
'financeUpdateLog' => [ 'index/Finance/financeUpdateLog', [ 'method' => 'POST|GET' ] ], //财务结单
'getRealIncome' => [ 'index/Finance/getRealIncome', [ 'method' => 'GET' ] ], //获取实收日期
'noticeIndex' => [ 'index/notice/index', [ 'method' => 'GET' ] ], //公告列表
'getNoticeInfo' => [ 'index/notice/getNoticeInfo', [ 'method' => 'GET' ] ], //公告详情
'delNotice' => [ 'index/notice/delNotice', [ 'method' => 'POST' ] ], //删除公告
......
......@@ -17,12 +17,12 @@ table td{
.tr-seat{
height: 20px;
}
tbody>tr:nth-of-type(9),
tbody>tr:nth-of-type(13),
tbody>tr:nth-of-type(15),
tbody>tr:nth-of-type(17),
tbody>tr:nth-of-type(19),
tbody>tr:nth-of-type(21){
tbody>tr:nth-of-type(10),
tbody>tr:nth-of-type(14),
tbody>tr:nth-of-type(16),
tbody>tr:nth-of-type(18),
tbody>tr:nth-of-type(20),
tbody>tr:nth-of-type(22){
margin-top: 20px;
border-top: 1px solid #999;
}
......@@ -232,4 +232,60 @@ html{
color: white;
margin-left: .3rem;
}
/*c端公开样式*/
.is-public-user{
display: inline-block;
background-color: #286090;
color: white;
padding: 0 3px;
border-radius: 6px;
width: 83px;
height: 34px;
line-height: 34px;
font-size: 15px;
}
.public-hide-area{
width: 440px;
background-color: white;
padding: 20px;
padding-top: 69px;
height: 260px;
box-sizing: border-box;
border-radius: 3px;
}
.choose-public-user{
width: 138px;
align-items: center;
text-rendering: auto;
border: 1px solid #ccc;
text-indent: 6px;
height: 36px;
border-radius: 5px;
font-size: 15px;
border-image: initial;
}
.is-public-show{
font-size: 17px;
}
.save-is-public,.cancel-is-public{
text-align: center;
float: right;
width: 58px;
height: 34px;
line-height: 34px;
border-radius: 5px;
margin-top: 100px;
margin-left: 10px;
font-size: 15px;
}
.cancel-is-public{
color: #000;
background: rgba(204, 204, 204,.9);
}
.save-is-public{
color: #fff;
background: #337ab7;
}
.color-biaoshi{
color: #337ab7;
}
......@@ -272,4 +272,21 @@ function loginCs(phone, pwd){
complete: function(xhr, textStatus) {
}
});
};
\ No newline at end of file
};
//判断权限
function check_auth(auth_rule) {
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
var result = false;
if (user_info_obj.id != 1) {
$.each(user_info_obj.auth,function (i, val) {
if (val['name'] == auth_rule) {
result = true;
}
});
} else {
result = true;
}
return result;
}
\ No newline at end of file
......@@ -37,7 +37,7 @@
$(".b3_span").html("商场");
$('.pu_area_type').html('商铺面积');
$('.b3_span_build_type').html('项目总面积'+':');
$('has-housed').html('已入驻'+':');
} else if(shang == "1") {
//街铺
// shanpu = '<span class="a_fontd">转让费:' + response.data.slotting_fee + '元</span>';
......@@ -52,6 +52,8 @@
$(".b3_span").html("街铺");
$('.pu_area_type').html('使用面积');
$('.b3_span_build_type').html('建筑面积'+':');
$('.has-housed').html('当前商铺业态'+':');
}
var title = response.data.external_title ? response.data.external_title : "";
......
......@@ -10,6 +10,7 @@ require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'], functio
dataCode: '',
modalShow2: false, //第二个弹出框是否显示
modalShow1: false,//第一个弹出框是否显示
modalShow3:false,//点击 C端公开 出现弹窗
isCallFlag: false,//是否正在拨打
isGenjinSave: false,//是否正在保存跟进
selectPhone: '',//所选中的号码
......@@ -17,44 +18,13 @@ require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'], functio
tempFollowId: '',//临时的跟进id
activeLandlord: '',//当前点击的房东
content: '',//跟进的内容,填写
select_public:'',//c端公开选择
select_public_var:'',//记录c端公开 的变量
d: {}
},
created: function() {
var _this = this;
$.ajax({
type: 'get',
url: '/broker/getShopDetail',
data: {
'id': shop_id,
'site_area': 4, //pc后台固定传4
'AuthToken': _this.user_info_obj.AuthToken
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
document.body.style.display = 'block';
if(typeof _data === 'object') {
_this.dataCode = _data['code'];
if(_data['code'] == '200') {
_this.d = _data.data;
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
_this.refreshHouseDetails();
},
mounted: function() {
......@@ -194,7 +164,96 @@ require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'], functio
_this.activeLandlord = t;
_this.modalShow1 = true;
},
isPublicUser(){//点击c端公开
let _this = this;
_this.modalShow3 = true;
_this.select_public=_this.select_public_var;
// _this.refreshHouseDetails();
},
hidePublicUser(){//取消c端公开
let _this = this;
_this.modalShow3 = false;
},
savePublicUser(){
var _this = this;
$.ajax({
type: 'post',
url: '/index/isShow',
data: {
'id': shop_id,
'is_show': _this.select_public
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
_this.dataCode = _data['code'];
if(_data['code'] == '200') {
layerTipsX('修改成功');
_this.modalShow3 = false;
_this.refreshHouseDetails();
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
},
refreshHouseDetails(){//是否对客户公开 保存后 刷新商铺详情页面
var _this = this;
$.ajax({
type: 'get',
url: '/broker/getShopDetail',
data: {
'id': shop_id,
'site_area': 4, //pc后台固定传4
'AuthToken': _this.user_info_obj.AuthToken
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
document.body.style.display = 'block';
if(typeof _data === 'object') {
_this.dataCode = _data['code'];
if(_data['code'] == '200') {
_this.select_public=_data.data.is_show;
_this.select_public_var=_data.data.is_show;
_this.d = _data.data;
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
},
clickPublicUser(t){//判断有权限的人 才能点击 c端公开
return check_auth(t);
},
switchSource(t){
switch(Number(t)){
case 0:return"无";
......
......@@ -203,7 +203,7 @@ a:hover{
width: 100%;
}
.sidebar-nav .dropdown-menu li:before {
background:rgba(255,148,25,0.1) !important;
background:#FF9419!important;
}
.sidebar-nav li:hover:before {
......@@ -346,7 +346,9 @@ a:hover{
}
.menu-sub-alink.active-a{
background-color: #ff9419!important;
/*background-color: #ff9419!important;*/
background-color: rgba(255, 148, 25,.7)!important;
}
/*商铺列表,商铺动态,跟进信息样式*/
......@@ -667,3 +669,11 @@ p{margin: 0;}
float: left;
margin-left: 10px;
}
/*去掉 内容区距离 顶部的距离*/
.breadcrumb{
margin-bottom: 0px!important;
}
/*去掉每个页面的 表格头部的边框 宽度*/
.table-bordered > thead > tr > th, .table-bordered > thead > tr > td{
border-bottom-width: 0px!important;
}
\ No newline at end of file
......@@ -153,7 +153,7 @@ addtax_
#maid_count_btn{
margin-right: 10px;
}
#maid_table_main>thead th:nth-last-of-type(-n+7){
#maid_table_main>thead th:nth-last-of-type(-n+8){
width: 91px;
}
#maid_table_main>thead th:nth-of-type(1){
......@@ -162,8 +162,11 @@ addtax_
#maid_table_main>thead th:nth-of-type(2){
width: 170px;
}
#maid_table_main>thead th:nth-last-of-type(3){
width: 91px;
}
#maid_table_main>thead th:nth-last-of-type(2){
width: 149px;
width: 91px;
}
#maid_table_main>thead th:nth-last-of-type(1){
width: 100px;
......@@ -205,12 +208,22 @@ addtax_
.detail-modal-maid-mix-td>div:nth-last-of-type(1)>span{
border-bottom: none;
}
.detail-modal-maid-mix-td>div>span:nth-last-of-type(2){
width: 91px;
}
.detail-modal-maid-mix-td>div>span:nth-last-of-type(1){
width: 146px;
width: 88px;
border-right: none;
}
.detail-modal-maid-span-date{
cursor: pointer;
}
[href="#modal_date_select"]{
display: none;
}
/*详情弹出框,开票税费*/
.addtax-modal-tax-table{
width:600px;
......@@ -276,17 +289,21 @@ addtax_
display: none;
}
#addmaid_select_ul{
#addmaid_select_ul,
#modal_date_select_ul{
list-style: none;
padding: 0;
margin: 0;
}
#addmaid_select_ul>li{
#addmaid_select_ul>li,
#modal_date_select_ul>li{
text-align: center;
height: 50px;
line-height: 50px;
cursor: pointer;
}
#addmaid_select_ul>li:hover{
#addmaid_select_ul>li:hover,
#modal_date_select_ul>li:hover{
background-color: rgba(0, 0, 0, .2);
}
......@@ -339,7 +356,7 @@ addtax_
#modal_detail>div {
width: 1180px;
width: 1350px;
}
/*成交信息tab*/
......
body{
}
\ No newline at end of file
.modal-body1 {
height: 716px;
overflow-y: auto;
padding-bottom: 60px;
}
/*客方姓名 搜索*/
.left-phone{
margin-left: 10px;
float: left;
position: relative;
}
.user-ul-agent{
width: 100%;
height: auto;
position: absolute;
width: 192px;
border: 1px solid #ccc;
border-top: none;
background: #fff;
z-index: 999;
left: 2px;
}
.user-ul-agent li{
margin-left: -28px;
list-style: none;
line-height: 26px;
}
.modal-body-details {
width: 850px;
}
.modal-body-new-user{
width: 639px;
}
.user-ul,.user-ul-new-introduce{
width: 100%;
height: auto;
float: left;
position: relative;
left: -40px;
}
.user-ul li, .user-ul-new-introduce li, .user-ul-edit-introduce li{
list-style: none;
line-height: 30px;
}
.user-ul2,
.look-shop-ul,.user-ul-edit-introduce{
width: 100%;
height: auto;
padding-bottom: 6px;
float: left;
position: relative;
left: -40px;
}
.user-ul2 li,
.look-shop-ul li {
list-style: none;
line-height: 30px;
}
.input {
width: 16%!important;
}
.text-right {
float: right;
display: inline-block;
}
#batch {
float: left;
height: 34px;
line-height: 34px;
}
.ld-Marheight {
margin-top: 15px;
}
.phone_list {
margin-top: 32px;
width: 182px;
margin-left: -182px;
}
.phone_jia {
width: 182px;
}
.phone_list li {
height: 22px;
line-height: 22px;
}
.phone_list li:nth-of-type(even) {
display: none;
}
.modal-dialog-one {
width: 668px;
}
.clear {
clear: both;
}
.left {
float: left;
}
.bottom {
margin-top: 30px;
}
/*客户列表商 约带看*/
.detail-modal-bargaininfo-main-left {
float: left;
width: 340px;
line-height: 36px;
}
#bargaininfo_is_open,
#bargaininfo_type {
width: 100px !important;
display: inline-block;
}
#bargaininfo_expect_payback_time {
height: 32px;
}
.detail-modal-bargaininfo-main-right {
line-height: 36px;
width: 700px;
}
#bargaininfo_yetai {
width: 150px;
display: inline-block;
height: 26px;
padding: 3px 6px
}
#bargaininfo_chengjiao_price,
#bargaininfo_total_commission {
width: 120px;
display: inline-block;
height: 26px;
padding: 3px 6px
}
.detail-modal-bargaininfo-form {
line-height: 48px;
width: 620px;
margin: 0 auto;
}
.detail-modal-bargaininfo-commission-inputpar {
width: 100%;
overflow: hidden;
clear: both;
}
.detail-modal-bargaininfo-commission-sec,
.addtax-modal-tax-commission-sec {
overflow: hidden;
}
.detail-modal-bargaininfo-commission-sec>label,
.addtax-modal-tax-commission-sec>label {
float: left;
}
.detail-modal-bargaininfo-commission-sec>label:nth-of-type(2),
.addtax-modal-tax-commission-sec>label:nth-of-type(2) {
margin-left: 50px;
}
.detail-modal-bargaininfo-commission-sec>div,
.addtax-modal-tax-commission-sec>div {
float: left;
width: 380px;
}
.detail-modal-bargaininfo-commission-sec>mark,
.addtax-modal-tax-commission-sec>mark {
float: left;
overflow: hidden;
background-color: transparent;
padding-top: 5px;
padding-left: 10px;
}
.detail-modal-bargaininfo-commission-sec>mark>img,
.addtax-modal-tax-commission-sec>mark>img {
float: left;
width: 20px;
}
#bargaininfo_commission_add_btn {
width: 70%;
margin-bottom: 20px;
}
#note_look{
margin-left: 67px;
}
#bargaininfo_commission_add_btn>img {
display: block;
margin: 0 auto;
}
.opacity-0 {
opacity: 0;
}
.user_call {
height: 20px;
width: 30px;
border-radius: 3px;
line-height: 20px;
margin-top: 7px;
font-size: 10px;
text-align: center;
cursor: pointer
}
/*客户动态*/
.followup-modal-list-area {
height: 258px;
overflow-y: scroll;
}
/*客户详情 头像*/
.user_pic {
width: 30px;
height: 30px;
border-radius: 15px;
}
/*拨打电话样式*/
.modal-body-width {
width: 460px;
}
#phone_title2 {
width: 100%;
height: 186px;
line-height: 186px;
text-align: center;
font-weight: 600;
font-size: 43px;
}
#phone_title {
font-weight: 600;
}
/*控制放大镜的*/
#preview {
z-index: 9999!important;
}
.modal-title-genjing {
height: 36px;
line-height: 36px;
border-top: 3px solid #ccc;
}
.center-btn {
margin-top: 10px;
text-align: center;
}
#caozuo_table_scroll {
height: 188px;
overflow-y: scroll;
}
/*查看过的 客户详情 按钮变色*/
.btn-user-details {
background-color: orange;
}
/*上一条 下一条 样式*/
#user_up,
#user_down {
color: #337ab7;
cursor: pointer;
}
.detail-modal-header-tab {
width: 220px;
float: left;
}
.user_up_con {
float: left;
margin-top: 5px;
font-size: 16px;
}
#user_area_add {
margin-left: 5px;
}
.call-user-five {
color: red;
font-size: 20px;
font-weight: 700;
}
/*查看详情 样式优化*/
.modal-header{
padding: 8px;
}
.modal-body{
padding: 10px;
}
.input-border-0{
border: 0;
}
.ld-Marheight-city{
margin-top: 8px;
}
.form-control[disabled]{
background-color: #fff;
}
.main-select {
display : none ;
}
.btn2 {
width : 10% !important;
}
.btn4 {
width : 16% !important;
}
/*适配 不同屏幕*/
@media screen and (min-width:1680px){
.btn4 {
width : 12% !important;
}
.btn2 {
width : 8% !important;
}
}
.btn6-yuedaikan{
width: 46% !important;
cursor: pointer;
}
.btn-guanbi{
margin-left: 20px;
}
.form-group-bottom{
margin-bottom: 9px;
}
\ No newline at end of file
......@@ -1357,7 +1357,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
}
} else {
alert('获取失败!');
alert('获取客户信息失败!');
}
}
});
......@@ -1694,6 +1694,7 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
params.remark_phone = $.trim($("#remark_phone").val());
params.remark_store_id = $.trim($("#guest_stores").val());
params.remark_district_id = $.trim($("#district_id").val());
params.content=$.trim($("#follow_content").val());
if($('#user_city_choose').val() == 310100){//城市
params.city = '上海市';
}
......@@ -1720,15 +1721,16 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
if(data.code == 200 || data.code == 201) {
user.remark_id=data.data.id;
user.user_id=data.data.user_id;
if(data.code == 200){
if(data.code == 200){//点击 上一条 下一条 有数据的时候 则显示客户的信息 没有则显示 接口返回的异常信息
$('.call-user-five').html('');
$('.detail-modal-body-sec-2').show();
user.Caozuo();
user.getGenjincon();
}else{
$('.call-user-five').html(data.msg);
$('.detail-modal-body-sec-2').hide();
}
user.Caozuo();
user.getGenjincon();
// if(data.data.user_id==data.data.max_user_id){
// user.user_id=data.data.max_user_id-1;
// };
......
......@@ -19,8 +19,9 @@ define (['doT', 'text!temp/business_district_template_tpl.html', 'css!style/home
});
$("#modal_add").click(function () {
$("#add_business_form")[0].reset();
$("#title").html('新增商圈');
business.getRegionsProvince(310000, 310100, 310101); //默认上海,上海,黄浦
business.getRegionsProvince('上海市', '上海市', '黄浦'); //默认上海,上海,黄浦
});
$("#province").change(function () {
......@@ -36,11 +37,29 @@ define (['doT', 'text!temp/business_district_template_tpl.html', 'css!style/home
params.province = $("#province").find("option:selected").text();
params.city = $("#city").find("option:selected").text();
params.disc = $("#disc").find("option:selected").text();
params.province_code = $("#province").val();
params.city_code = $("#city").val();
params.disc_code = $("#disc").val();
params.business = $("#business").val();
params.id = business.id;
if (params.province == '' || params.province == '请选择'){
alert('请选择省');
return ;
}
if (params.city == '' || params.city == '请选择'){
alert('请选择市');
return ;
}
if (params.disc == '' || params.disc == '请选择'){
alert('请选择区');
return ;
}
if (params.business == '' || params.business == '请选择'){
alert('请填写商区名');
return ;
}
$.ajax({
url : '/index/editBusinessDistrict.html',
type : 'POST',
......@@ -75,7 +94,7 @@ define (['doT', 'text!temp/business_district_template_tpl.html', 'css!style/home
success : function (data) {
if (data.code == 200) {
$("#business").val(data.data.name);
business.getRegionsProvince(data.data.province_code,data.data.city_code,data.data.disc_code);
business.getRegionsProvince(data.data.province,data.data.city,data.data.disc);
} else {
alert(data.msg);
}
......@@ -98,14 +117,7 @@ define (['doT', 'text!temp/business_district_template_tpl.html', 'css!style/home
business.id = $ (this).attr ("data-id");
var params ={};
params.id = $ (this).attr ("data-id");
var str = $.trim($(this).html());
if (str === "不显示") {
params.type = 1;
$(this).html('显示');
} else {
params.type = 0;
$(this).html('不显示');
}
params.type = $ (this).attr ("data-type");
$.ajax ({
url: '/index/editBusinessDistrict.html',
type: 'POST',
......@@ -153,36 +165,36 @@ define (['doT', 'text!temp/business_district_template_tpl.html', 'css!style/home
}
});
},
getRegionsProvince : function (code_province, code_city, code_disc) {
getRegionsProvince : function (province, city, disc) {
$.ajax ({
url: '/index/regions.html',
type: 'GET',
dataType: 'json',
success: function (data) {
if (data.code == 200) {
var _html = '';
$("#province").empty();
var _html = '<option>请选择</option>';
$.each(data.data, function (i,n) {
if (n.code == code_province) {
_html += '<option selected="selected" value="'+n.code+'">'+n.name+'</option>';
if (n.fullName == province) {
_html += '<option selected="selected" value="'+n.code+'">'+n.fullName+'</option>';
} else {
_html += '<option value="'+n.code+'">'+n.name+'</option>';
_html += '<option value="'+n.code+'">'+n.fullName+'</option>';
}
});
$("#province").html(_html);
business.getRegionsCity(code_city,code_disc);
$("#province").append(_html);
business.getRegionsCity(city, disc);
} else {
alert('请求省市区错误');
}
}
});
},
getRegionsCity : function (code_city, code_disc) {
getRegionsCity : function (city, disc) {
var params = {};
params.parent_code = $("#province").val();
if (params.parent_code == '请选择') {
params.parent_code = 310000;
}
$.ajax ({
url: '/index/regions.html',
type: 'GET',
......@@ -191,16 +203,17 @@ define (['doT', 'text!temp/business_district_template_tpl.html', 'css!style/home
dataType: 'json',
success: function (data) {
if (data.code == 200) {
var _html = '';
$("#city").empty();
var _html = '<option>请选择</option>';
$.each(data.data, function (i,n) {
if (n.code == code_city) {
_html += '<option selected="selected" value="'+n.code+'">'+n.name+'</option>';
if (n.fullName == city) {
_html += '<option selected="selected" value="'+n.code+'">'+n.fullName+'</option>';
} else {
_html += '<option value="'+n.code+'">'+n.name+'</option>';
_html += '<option value="'+n.code+'">'+n.fullName+'</option>';
}
});
$("#city").html(_html);
business.getRegionsDisc(code_disc);
$("#city").append(_html);
business.getRegionsDisc(disc);
} else {
alert('请求省市区错误');
}
......@@ -221,15 +234,16 @@ define (['doT', 'text!temp/business_district_template_tpl.html', 'css!style/home
dataType: 'json',
success: function (data) {
if (data.code == 200) {
var _html = '';
$("#disc").empty();
var _html = '<option>请选择</option>';
$.each(data.data, function (i,n) {
if (n.code == code) {
_html += '<option selected="selected" value="'+n.code+'">'+n.name+'</option>';
if (n.fullName == code) {
_html += '<option selected="selected" value="'+n.code+'">'+n.fullName+'</option>';
} else {
_html += '<option value="'+n.code+'">'+n.name+'</option>';
_html += '<option value="'+n.code+'">'+n.fullName+'</option>';
}
});
$("#disc").html(_html);
$("#disc").append(_html);
} else {
alert('请求省市区错误');
}
......
......@@ -1068,13 +1068,17 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'text!temp/reportList_n
data: params,
dataType: 'json',
success: function(data) {
console.log(data);
var temp = document.getElementById('commission_list_tpl').innerHTML;
var doTtmpl = doT.template(temp);
$("#business_list").html(doTtmpl(data.data.data.list));
if (data.code == 200) {
var temp = document.getElementById('commission_list_tpl').innerHTML;
var doTtmpl = doT.template(temp);
$("#business_list").html(doTtmpl(data.data.data.list));
/*分页代码*/
add_page(data.data.data.total, pageNo, bargain.pageSize, bargain.getList);
} else {
alert(data.msg);
}
/*分页代码*/
add_page(data.data.data.total, pageNo, bargain.pageSize, bargain.getList);
}
});
},
......@@ -1088,7 +1092,9 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'text!temp/reportList_n
var agent = $('#user_name').val();
var user_phone = $('#user_phone').val();
var house_number = $('#internal_num').val();
window.open('/index/exportExcel?create_time=' + create_time + '&end_time=' + end_time + '&internal_address=' + internal_address + '&name=' + agent + '&phone=' + user_phone + '&house_number=' + house_number);
var bargain_id = $('#bargain_id').val();
window.open('/index/exportExcel?create_time=' + create_time + '&end_time=' + end_time + '&internal_address=' + internal_address + '&name=' + agent + '&phone=' + user_phone + '&house_number=' + house_number + '&bargain_id=' + bargain_id);
},
};
......
......@@ -407,14 +407,15 @@ define(['doT', 'text!temp/commissionTotal_template_tpl.html', 'css!style/home.cs
data: params,
dataType: 'json',
success: function(data) {
console.log(data);
var temp = document.getElementById('commissionTotal_list_tpl').innerHTML;
var doTtmpl = doT.template(temp);
$("#business_list").html(doTtmpl(data.data.list));
console.log(data.data.list);
/*分页代码*/
add_page(data.data.total, pageNo, business.pageSize, business.getList);
if (data.code == 200) {
var temp = document.getElementById('commissionTotal_list_tpl').innerHTML;
var doTtmpl = doT.template(temp);
$("#business_list").html(doTtmpl(data.data.list));
/*分页代码*/
add_page(data.data.total, pageNo, business.pageSize, business.getList);
} else {
alert(data.msg);
}
}
});
},
......
......@@ -38,6 +38,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
main_select : false , // true : 开启高级搜索 ,false :关闭高级搜索
file_id_str:'',
file_id_arr:[],
agent_id_choose:'',
init: function() {
//初始化dot
......@@ -99,9 +100,38 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
$('#business_circle_id').html('');
business.agent_id_choose='';
});
_doc.on("input", "#dish_name", function() { //客户列表 客方员工姓名 下拉式搜索
if($("#dish_name").val() == '') {
business.agent_id_choose='';
$(".user-ul-agent").html('');
} else {
business.search_phone_agent();
}
});
_doc.delegate(".addphone-agent", "click", function() { //客户列表 客户员工 下拉式 搜索 点击li事件 获取id ul消失
business.addphoneAgent(this);
});
//部门 门店 二级联动
business.getDistrictPanFang(function(){//有了列表 点击 调用门店列表
_doc.on('input', '#district_id_panfang', function(){
var _this = $(this);
var _id = _this.val();
_this.next().html('');//先清空
if(_id && _id != '0'){
business.getDistrictStoreListPanFang(_id, function(_data){
var _str = '<option value="">盘方门店</option>';
$.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>';
});
_this.next().html(_str);
});
}else{
};
});
});
$('#modal-dujia').on('show.bs.modal', function () {
business.showOrHideDujia();
});
......@@ -1093,9 +1123,7 @@ if(data.code == 200) {
}
});
},
//==============批量修改客方===========
getList: function(pageNo, type) {
getList: function(pageNo, type) {//商铺列表 搜索
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo')));
business.pageNo = pageNo;
var params = {};
......@@ -1108,7 +1136,8 @@ if(data.code == 200) {
params.is_carefully_chosen = $('#is_carefully_chosen option:selected').val(); //首页显示
params.is_show = $('#is_show option:selected').val(); //c端显示
params.shop_type = $('#shop_type option:selected').val(); //商铺类型
params.leased = $('#leased option:selected').val(); //商铺状态
// params.leased = $('#leased option:selected').val(); 商铺状态
params.status = $('#leased option:selected').val(); //商铺状态 上架 下架
params.rent_price = $('#rent_price option:selected').val(); //月租金
params.is_exclusive_type = $('#is_exclusive_type option:selected').val(); //是否独家
params.id = $('#id').val(); //商铺编号
......@@ -1116,7 +1145,6 @@ if(data.code == 200) {
params.internal_title = $('#internal_title').val(); //对内商铺名称
params.external_title = $('#internal_title_open').val(); //对外商铺名称
params.area = $('#area_id').val(); //面积筛选
//添加个人商铺和所有商铺选择功能
params.dish_id = business.all_shop ? '' : user_info_obj.id ;
......@@ -1129,12 +1157,13 @@ if(data.code == 200) {
params.disc = $('#shop_area_id').val(); //区域筛选
params.business_id=$('#business_circle_id').val();//商圈筛选
params.industry_type = $('#yetai_id').val(); //业态筛选
params.dish_name = $('#dish_name').val(); //盘方姓名
params.dish_phone = $('#dish_phone').val(); //盘方手机号
params.landlord_phone = $('#landlord_phone').val(); //房东手机号
params.start_date = $('#start_date').val(); //时间1
params.end_date = $('#end_date').val(); //时间2
params.dish_district_id = $('#district_id_panfang').val(); //盘方 部门 id
params.dish_store_id = $('#guest_stores_panfang').val(); //盘方 门店 id
params.dish_name = business.agent_id_choose; //盘方姓名 下拉式
$.ajax({
url: '/index/getHouseList.html', //获取列表
type: 'GET',
......@@ -1240,6 +1269,74 @@ if(data.code == 200) {
}
});
},
getDistrictPanFang: function (fn) {//调用接口 产生列表 部门
$.ajax ({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {"pageSize":1000},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>';
});
$("#district_id_panfang").append(str);
fn && fn();
}
}
});
},
getDistrictStoreListPanFang: function(id, fn){
$.ajax ({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id':id,
"pageSize":1000
},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
},
search_phone_agent: function() { //客户列表 客方员工 姓名的下拉式搜索
$.ajax({
url: '/index/getAgentsTohouses',
type: 'GET',
async: true,
data: {
"type":2,
"agent_name":$('#dish_name').val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data.data, function(i, item) {
user_ul += '<li class="addphone-agent" data-id="' + item.name + '">' + item.id + '-' + item.name + '-' + item.phone + '</li>';
});
$(".user-ul-agent").html(user_ul);
} else {
alert(data.msg);
}
}
});
},
addphoneAgent: function(obj) {//客户列表 客方姓名 搜索 input赋值
var user_ht = $(obj).html();
$("#dish_name").val(user_ht);
$(".user-ul-agent").html('');
business.agent_id_choose = $(obj).attr("data-id");
},
//初始化 城市
initializationCityFunction: function(params) {
$.ajax({
......
......@@ -29,7 +29,7 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
//回调部分
//记录tab的点击状态,对应的标签内容展开,并高亮显示
var _hash = location.pathname.replace('/admin.php/', '/');
var _tempObj = $('[data-href="'+_hash+'"]');
var _tempObj = $('[href="'+_hash+'"]');
_tempObj.addClass('active-a').siblings().removeClass('active-a');
_tempObj.closest('.dropdown-menu').prev().attr('aria-expanded', true).parents().addClass('open').siblings().removeClass('open');
......
......@@ -20,6 +20,8 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
order_id: '',
switchType:3,
district_store_agent_id:'',
agent_id_choose:'',
order_ranking:'desc',
init: function() {
//初始化dot
$(document.body).append(template + template_tax);
......@@ -28,6 +30,40 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
},
event: function() {
var _doc = $(document);
$('.left-phone,#district_id,#guest_stores').hide();//初始化 隐藏 部门 门店的搜索
$('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id
realtime.agent_id_choose='';//将业绩排行的 经纪人id置空
//二级联动
realtime.getDistrict(function(){//有了列表 点击 调用门店列表
_doc.on('input', '#district_id', function(){
var _this = $(this);
var _id = _this.val();
_this.next().html('');//先清空
if(_id && _id != '0'){
realtime.getDistrictStoreList(_id, function(_data){
var _str = '<option value="">选择门店</option>';
$.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>';
});
_this.next().html(_str);
});
}else{
};
});
});
_doc.on("input", "#user_agent_name", function() { //客户列表 客方员工姓名 下拉式搜索
if($("#user_agent_name").val() == '') {
realtime.agent_id_choose='';
$(".user-ul-agent").html('');
} else {
realtime.search_phone_agent();
}
});
_doc.delegate(".addphone-agent", "click", function() { //客户列表 客户员工 下拉式 搜索 点击li事件 获取id ul消失
realtime.addphoneAgent(this);
});
//主页面 部门业绩 门店业绩 个人业绩 三个tab的点击事件
_doc.on('click', '.maintable-top-sub-tr>a', function(e){
e.preventDefault();
......@@ -35,6 +71,26 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
var _this = $(this);
_this.removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
realtime.mainTabIndex = _this.index();
if(realtime.mainTabIndex == 0){
$('.left-phone,#district_id,#guest_stores').hide();
$('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id
realtime.agent_id_choose='';//将业绩排行的 经纪人id置空
}
if(realtime.mainTabIndex == 1){
$('#district_id,#guest_stores').show();
$('.left-phone').hide();
$('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id
realtime.agent_id_choose='';//将业绩排行的 经纪人id置空
};
if(realtime.mainTabIndex == 2){
$('.left-phone,#district_id,#guest_stores').show();
$('#district_id').val('');//置空 部门 id
$('#guest_stores').val('');//置空 门店id
realtime.agent_id_choose='';//将业绩排行的 经纪人id置空
}
realtime.getList(1);
});
//点击部门列表-参数初始化
......@@ -126,6 +182,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
e.preventDefault();
e.stopPropagation();
realtime.orderList=1;
realtime.order_ranking='asc';
realtime.getList(1);
});
//倒序
......@@ -133,13 +190,15 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
e.preventDefault();
e.stopPropagation();
realtime.orderList=0;
realtime.getList(1);
realtime.order_ranking='desc';
realtime.getList(1);
});
//搜索的重置
$("#maintable_reset").click(function() {
document.getElementById("maintable_form_search").reset();
realtime.is_today_yeji=0;
realtime.agent_id_choose='';
});
//部门-业绩-弹出框
_doc.on('click', '.performance-number-details', function(e) {
......@@ -288,7 +347,10 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
'pageSize': realtime.pageSize,
'start_day':$('#maintable_create_time').val(),
'end_day':$('#maintable_end_time').val(),
// 'is_today':realtime.is_today_yeji,
'district_id':$('#district_id').val(),
'store_id':$('#guest_stores').val(),
'agent_id':realtime.agent_id_choose,
'order':realtime.order_ranking
};
$.ajax({
......@@ -304,12 +366,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
var tpl=realtime.switchTpl();
console.log(tpl);
var doTtmpl = doT.template(document.getElementById(tpl).innerHTML);
if(realtime.orderList==0){
$("#maintable_list").html(doTtmpl(data.data.list.slice(0,20)));
}
if(realtime.orderList==1){
$("#maintable_list").html(doTtmpl(data.data.list.reverse().slice(0,20)));
}
$("#maintable_list").html(doTtmpl(data.data.list));
//获取统计时间
$('#rank_start_day').html(data.data.start_time);
$('#rank_end_day').html(data.data.end_time);
......@@ -319,7 +376,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
//不点击 搜索按钮 初始化时间
realtime.time_search_start=$('#maintable_create_time').val();
realtime.time_search_end=$('#maintable_end_time').val();
/*分页代码*/
/*分页代码 后端返回total 值*/
add_page(data.data.total, pageNo, realtime.pageSize, realtime.getList);
} else {
......@@ -882,7 +939,72 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'text!temp/r
}
});
},
getDistrict : function (fn) {//调用接口 产生列表 部门
$.ajax ({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {"pageSize":1000},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>';
});
$("#district_id").append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn){
$.ajax ({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id':id,
"pageSize":1000
},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
},
search_phone_agent: function() { //客户列表 客方员工 姓名的下拉式搜索
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone": $("#user_agent_name").val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data, function(i, item) {
user_ul += '<li class="addphone-agent" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + '</li>';
});
$(".user-ul-agent").html(user_ul);
} else {
alert(data.msg);
}
}
});
},
addphoneAgent: function(obj) {//客户列表 客方姓名 搜索 input赋值
var user_ht = $(obj).html();
$("#user_agent_name").val(user_ht);
$(".user-ul-agent").html('');
realtime.agent_id_choose = $(obj).attr("data-id");
},
bargaininfoShow: function() { //报告详情
$.ajax({
'type': 'GET',
......
......@@ -13,6 +13,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
agent_id_phone:'',//分佣方 姓名搜索
detail_user_id:'',//用户id
detail_shop_id:'',//商铺id
shouyong_date_active_sapn: null,
init: function() {
//初始化dot
$(document.body).append(template);
......@@ -378,6 +379,66 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
bargain.maidCount(1);//1为正常计算的时候
});
//详情弹出框,分佣提成里,收佣日期里的点击选择
_doc.on('click', '.detail-modal-maid-span-date', function(e){
e.preventDefault();
e.stopPropagation();
var _$this = $(this);
bargain.shouyong_date_active_sapn = _$this;
var _id = _$this.closest('tr').attr('data-id');
$.ajax({
type: 'GET',
url: '/index/getRealIncome',
data: {
'bargain_id': _id
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
if(data.data && Array.isArray(data.data) && data.data.length>0){
$('[href="#modal_date_select"]').click();
var _tempHtml = '';
$.each(data.data, function(i, v) {
_tempHtml += '<li data-data="{data}">{0}</li>'.stringFormatObj({
'data': encodeURIComponent(JSON.stringify(v)),
'0': v.income_time
});
});
$('#modal_date_select_ul').html(_tempHtml);
}else{
alert('请先在成交信息里填写收佣日期');
}
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},
error: function() {
//alert('error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
alert('请求超时');
};
}
});
});
//详情弹出框,分佣提成里,收佣日期弹出框里,选择列表触发的事件
_doc.on('click', '#modal_date_select_ul>li', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
var _dataTemp = JSON.parse(decodeURIComponent(_this.attr('data-data')));
bargain.shouyong_date_active_sapn.html(_dataTemp.income_time).attr('data-dateid',_dataTemp.id);
_this.closest('.modal-content').find('button.close').click();
});
//新增分佣提成,业务员input输入搜索,点击之后赋值
_doc.on('click', '#addmaid_input_ywy+ul>li', function() {
var _this = $(this);
......@@ -656,7 +717,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
'industry_type': $.trim($('#bargaininfo_yetai').val()),
'price': $('#bargaininfo_chengjiao_price').val(),
'estimated_receipt_date': $('#bargaininfo_expect_payback_time').val(),
'step': bargain.mainTabIndex+1,
'step': bargain.mainTabIndex,
'house_number': $.trim($('#bargaininfo_shop_num').val())
};
......@@ -732,10 +793,10 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
//通过
pass: function() { //点击通过
var a_url = '';
if(bargain.mainTabIndex == 0) {
if(bargain.mainTabIndex == 1) {
a_url = "/index/checkReportAttache/1"
};
if(bargain.mainTabIndex == 1) {
if(bargain.mainTabIndex == 2) {
a_url = "/index/checkReportManager/2"
};
// if(bargain.mainTabIndex == 2) {
......@@ -754,7 +815,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
"source": 1,
"status": 10,
"remark": $.trim($("#pass_beizhu").val()),
'step': bargain.mainTabIndex+1
'step': bargain.mainTabIndex
},
dataType: "json",
success: function(data) {
......@@ -907,7 +968,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
'scale_fee': $('#addmaid_input_cash').val(),
'role': $('#addmaid_input_servant').val(),
'scale': $('#addmaid_input_ratio').val(),
'step': bargain.mainTabIndex+1,
'step': bargain.mainTabIndex,
'source': 1
},
timeout: 30000,
......@@ -1077,7 +1138,8 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
var _csjj = $.trim(_$v2.find('.detail-modal-maid-span-charity-fund').html());
var _xjj = $.trim(_$v2.find('.detail-modal-maid-span-cash').html());
var _ssyj = $.trim(_$v2.find('.detail-modal-maid-span-practical-fee').html());
if((type == '1') && (_sfyj == ''||_sxf == ''||_csjj == ''||_xjj == ''||_ssyj == '')){
var _syrqid = $.trim(_$v2.find('.detail-modal-maid-span-date').attr('data-dateid'));
if((type == '1') && (_sfyj == ''||_sxf == ''||_csjj == ''||_xjj == ''||_ssyj == ''||!_syrqid)){
//如果是确认分佣,则每项必填。保存,则不加限制
_stopFlag = true;
}else{
......@@ -1092,7 +1154,8 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
'charity_fund': _csjj,//慈善基金
'cash': _xjj,//现金奖
'practical_fee': _ssyj,//实收佣金,
'step': bargain.mainTabIndex+1
'real_income_id': _syrqid,//收佣日期id
'step': bargain.mainTabIndex
};
}
});
......@@ -1103,6 +1166,11 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
_data.push(_dataTemp);
});
};
if(_parObj.find('td[data-role="3"]').length>1){
_stopFlag = true;
_errorTips = '反签方只能有一个';
};
$.each($('.detail-modal-maid-span-scale'), function(i, v) {
_scaleTotal += Number($.trim(v.innerHTML));
});
......@@ -1111,6 +1179,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
_stopFlag = true;
_errorTips = '分佣比例一定要是100%,否则无法提交';
};
return {
'flag': _stopFlag,
'tips': _errorTips,
......@@ -1118,48 +1187,58 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
}
},
maidConfirmOk: function(type){
var _back = bargain.maidTest(type);//获取处理的数据
if(!_back.flag){
var _len = _back.list.length;
! function funTemp(count) {
if(count >= _len) {
//如果递归执行完毕则执行这条
alert(type===0?'保存成功':'确认成功');
bargain.maidShow();
} else {
$.ajax({
type: 'POST',
url: '/index/addRealIncome',
data: _back.list[count],
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
if(_data['code'] == '200') {
funTemp(++count);
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
}
}(0);
if(!bargain.isSaving){
//上一次请求完成后再
var _back = bargain.maidTest(type);//获取处理的数据
if(!_back.flag){
var _len = _back.list.length;
! function funTemp(count) {
if(count >= _len) {
//如果递归执行完毕则执行这条
alert(type===0?'保存成功':'确认成功');
bargain.maidShow();
} else {
$.ajax({
type: 'POST',
url: '/index/addRealIncome',
data: _back.list[count],
timeout: 30000,
dataType: 'json',
beforeSend: function() {
bargain.isSaving = true;
},
success: function(_data) {
if(typeof _data === 'object') {
if(_data['code'] == '200') {
funTemp(++count);
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
bargain.isSaving = false;
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
}
}(0);
}else{
alert(_back.tips);
}
}else{
alert(_back.tips);
//上一次请求没有完成的时候直接退出
return false;
}
},
newAddTax: function(obj) {
var _tempTableObj = $('.addtax-modal-tax-table');
......@@ -1421,12 +1500,14 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
switchUrl: function(){
switch (Number(this.mainTabIndex)){
case 0:
return '/index/reportListOne/1';
return '/index/reportListAll/10';
case 1:
return '/index/reportListTwo/2';
return '/index/reportListOne/1';
case 2:
return '/index/reportListThree/3';
return '/index/reportListTwo/2';
case 3:
return '/index/reportListThree/3';
case 4:
return '/index/reportListStatement/4';
default:
return '';
......
This diff is collapsed.
......@@ -256,6 +256,10 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
par.store_name = $("input[name =name]").val();//门店名
par.scale = $("#pid-select option:selected").val();//规模
par.district_id= $("#ss-store option:selected").val();//部门id
if(!(par.agents_id && par.province && par.city && par.district && par.address && par.longitude && par.latitude && par.store_name && par.scale && par.district_id)){
alert('请将内容填写完整');
return;
}
console.log(par);
$.ajax({
'type': 'POST',
......
......@@ -41,6 +41,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
agentbaohu:'',
user_id_new_introduce:'',
user_id_edit_introduce:'',
agent_id_choose:'',//客户列表 客户姓名搜索 经纪人id
customerInfo: {},
all_custom : true , // true :所有客户 ,false :当前客户
main_select : false , // true : 开启高级搜索 ,false :关闭高级搜索
......@@ -157,8 +158,12 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
e.stopPropagation();
user.user_id = $(this).attr("data-id");
user.user_status = $(this).attr("data-status");
if(!confirm('是否继续?')) {
return;
};
$(this).attr('class', 'btn1 btn-default is_invalid');
if(user.user_status*1 != -1){
$(this).hide();
user.isInvalid();
}
});
......@@ -292,6 +297,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
document.getElementById("form_search").reset();
$('#guest_stores').html('');
$('#guest_stores2').html('');
user.agent_id_choose='';//点击重置 清空客方id
});
$('#persional_custom').unbind('click').bind('click',function(){
......@@ -351,6 +357,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
$(document).delegate(".add_alert", "click", function() { //重置搜索
document.getElementById("add_user_form").reset();
});
//新增客户
$(document).delegate("#add_user", "click", function() { //新增客户
......@@ -446,6 +453,14 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
user.search_phone();
}
});
$(document).on("input", "#user_agent_name", function() { //客户列表 客方员工姓名 下拉式搜索
if($("#user_agent_name").val() == '') {
user.agent_id_choose='';
$(".user-ul-agent").html('');
} else {
user.search_phone_agent();
}
});
$(document).on("input", "#introduce_new_user", function() { //新增客户 转介绍人 搜索客户
if($("#introduce_new_user").val() == '') {
......@@ -515,6 +530,9 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
$(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
user.addphone(this);
});
$(document).delegate(".addphone-agent", "click", function() { //客户列表 客户员工 下拉式 搜索 点击li事件 获取id ul消失
user.addphoneAgent(this);
});
$(document).delegate(".add-user-new-li", "click", function() { //list消失新增客户 点击li事件 获取客户id ul消失
user.addUserNewLi(this);
});
......@@ -1008,6 +1026,12 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
$(".user-ul").html('');
user.agent_id = $(obj).attr("data-id");
},
addphoneAgent: function(obj) {//客户列表 客方姓名 搜索 input赋值
var user_ht = $(obj).html();
$("#user_agent_name").val(user_ht);
$(".user-ul-agent").html('');
user.agent_id_choose = $(obj).attr("data-id");
},
addUserNewLi: function(obj) {//新增客户 input赋值 搜索客户id
var user_ht = $(obj).html();
$("#introduce_new_user").val(user_ht);
......@@ -1129,6 +1153,31 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
}
});
},
search_phone_agent: function() { //客户列表 客方员工 姓名的下拉式搜索
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone": $("#user_agent_name").val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data, function(i, item) {
user_ul += '<li class="addphone-agent" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + '</li>';
});
$(".user-ul-agent").html(user_ul);
} else {
alert(data.msg);
}
}
});
},
introduce_userId: function() { //新增客户 转介绍 客户id搜索
$.ajax({
url: '/broker/searchUser',
......@@ -1628,7 +1677,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'css!style/home.css', 'ckfind
params.pageNo = user.pageNo;
params.pageSize = user.pageSize;
params.user_agent = $.trim($("input[name='user_agent']").val());
params.user_agent_name = $.trim($("input[name='user_agent_name']").val());
params.user_agent_name = user.agent_id_choose;
params.invite_agent_phone = $.trim($("input[name='invite_agent_phone']").val());
params.area_type = $.trim($("select[name=area_type]").val());
params.price_type = $.trim($("select[name=price_type]").val());
......
......@@ -9,22 +9,23 @@
<td>[%= it[item]['disc'] %]</td>
<td>
[% if(it[item]["status"] == 0) { %]
不显示
[% }else{ %]
显示
[% }else{ %]
不显示
[% } %]
</td>
<td>[%= it[item]['create_time']%]</td>
<td>
<a title="编辑" class="btn btn-success btn-xs edit_modal" href="#modal_business" data-toggle="modal" class="btn btn-default" data-id="[%= it[item]['id']%]" style="margin-right:6px;">编辑</a>
<a title="权限分配" class="btn btn-info btn-xs is_show" href="#modal-do" data-id="[%= it[item]['id']%]" style="margin-right:6px;">
[% if(it[item]["status"] == 0) { %]
不显示
[% }else{ %]
显示
[% } %]
<a class="btn btn-success btn-xs edit_modal" href="#modal_business" data-toggle="modal" class="btn btn-default" data-id="[%= it[item]['id']%]" style="margin-right:6px;">编辑</a>
[% if(it[item]["status"] == 0) { %]
<a class="btn btn-info btn-xs is_show" href="#modal-do" data-id="[%= it[item]['id']%]" data-type="1" style="margin-right:6px;">
不显示
[% }else{ %]
<a class="btn btn-info btn-xs is_show" href="#modal-do" data-id="[%= it[item]['id']%]" data-type="0" style="margin-right:6px;">
显示
[% } %]
</a>
<a title="成员授权" class="btn btn-danger btn-xs del_modal" href="#modal-delete" data-toggle="modal" class="btn btn-default" data-id='[%= it[item]["id"] %]' style="margin-right:6px;">删除</a>
<a class="btn btn-danger btn-xs del_modal" href="#modal-delete" data-toggle="modal" class="btn btn-default" data-id='[%= it[item]["id"] %]' style="margin-right:6px;">删除</a>
</td>
</tr>
[% } %]
......
......@@ -7,14 +7,30 @@
<td>[%= it[item]['district_store'] %]</td>
<td>[%= it[item]['name'] %]</td>
<td>[%= it[item]['should_commission'] %]</td>
<td>[%= it[item]['cash'] %]</td>
<td>[%= it[item]['practical_fee'] %]</td>
<td>
[% if (it[item]['fee']){ %]
[% if (it[item]['cash'] ){ %]
[%= it[item]['cash'] %]
[% } else{%]
[%= 0 %]
[% } %]
</td>
<td>
[% if (it[item]['practical_fee'] ){ %]
[%= it[item]['practical_fee'] %]
[% } else{%]
[%= 0 %]
[% } %]
</td>
<td>
[% if (it[item]['fee'] ){ %]
[%= it[item]['fee'] %]
[% } else{%]
[%= 0 %]
[% } %]
</td>
<td>[%= it[item]['over_fee'] %]</td>
<td>
[%= it[item]['over_fee'] %]
</td>
</tr>
[% } %]
[% }else{ %]
......
......@@ -3,7 +3,11 @@
[% for(var item in it){ %]
<tr class="text-center" data-id="[%= it[item]['bargain_id'] %]" data-orderid="[%= it[item]['order_id'] %]" data-fatherid="[%= it[item]['father_id'] %]">
<td>[%= it[item]['bargain_id'] %]</td>
<td>[%= it[item]['confirm_date'] %]</td>
<td>
[% if(it[item]['income_time']) { %]
[%= it[item]['income_time'] %]
[% } %]
</td>
<td>[%= it[item]['district_store'] %]</td>
<td>[%= it[item]['agent'] %]</td>
<td>[%= it[item]['internal_address'] %]</td>
......
......@@ -104,7 +104,7 @@
[% } %]
[% }else{ %]
<tr>
<td colspan="12" style="text-align:center;"> 暂无数据</td>
<td colspan="10" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
\ No newline at end of file
......@@ -93,7 +93,7 @@
<td>[%= it['data'][i]['district_store'] %]</td>
<td><span contenteditable class="detail-modal-maid-span-scale">[%= it['data'][i]['scale'] %]</span><span>%</span></td>
<td contenteditable class="detail-modal-maid-td-should-commission">[%= it['data'][i]['scale_fee'] %]</td>
<td colspan="6" class="detail-modal-maid-mix-td oh">
<td colspan="7" class="detail-modal-maid-mix-td oh">
[% if(it['data'][i]['partial_commission'] && it['data'][i]['partial_commission'].length && it['data'][i]['partial_commission'].length>0) { %]
[% for(var j in it['data'][i]['partial_commission']){ %]
<div class="oh" data-id="[%= it['data'][i]['partial_commission'][j]['id'] %]">
......@@ -102,6 +102,7 @@
<span contenteditable class="detail-modal-maid-span-charity-fund">[%= it['data'][i]['partial_commission'][j]['charity_fund'] %]</span>
<span contenteditable class="detail-modal-maid-span-cash">[%= it['data'][i]['partial_commission'][j]['cash'] %]</span>
<span contenteditable class="detail-modal-maid-span-practical-fee">[%= it['data'][i]['partial_commission'][j]['practical_fee'] %]</span>
<span class="detail-modal-maid-span-date" data-dateid="[%= it['data'][i]['partial_commission'][j]['income_time']['id'] %]">[%= it['data'][i]['partial_commission'][j]['income_time']['income_time'] %]</span>
<span class="detail-modal-maid-span-time">[%= dealT(it['data'][i]['partial_commission'][j]['confirm_date']) %]</span>
</div>
[% } %]
......@@ -112,6 +113,7 @@
<span contenteditable class="detail-modal-maid-span-charity-fund">0</span>
<span contenteditable class="detail-modal-maid-span-cash">0</span>
<span contenteditable class="detail-modal-maid-span-practical-fee"></span>
<span class="detail-modal-maid-span-date" data-dateid=""></span>
<span class="detail-modal-maid-span-time"></span>
</div>
[% } %]
......
<script id="reportList_list_tpl" type="text/template">
[% if(it["list"] && it["list"].length && it["list"].length>0) { %]
[% var sw=function(s){switch(Number(s)){case 10:return"出租";case 20:return"增佣";case 30:return"代理";case 40:return"好处费";default:return s}}; %]
[% var sw2=function(s){switch(Number(s)){case 0:return"一级";case 1:return"二级";case 2:return"三级";case 3:return"已结单";default:return s}}; %]
[% for(var item in it["list"]){ %]
<tr data-id="[%= it['list'][item]['id'] %]" data-orderid="[%= it['list'][item]['order_id'] %]">
<td class="text-center" >行号 </td>
<td class="text-center" >[%= it["list"][item]['id'] %]</td>
<td class="text-center" >
[%= it["list"][item]['id'] %]
[% if(it["step"]==10) { %]
&nbsp;<span class="btn1 btn-success btn-xs">[%= sw2(it["list"][item]['audit_level']) %]</span>
[% } %]
</td>
<td class="text-center" width="10%">[%= it["list"][item]['create_time'] %]</td>
<td class="text-center" width="8%">[%= it["list"][item]['is_open']*1?'是':'否' %]</td>
<td class="text-left">[%= it["list"][item]['internal_address'] %]</td>
......@@ -30,7 +36,7 @@
[% } %]
[% } %]
[% if(it['step'] <= 3 && check_auth('index/backOutToOne')) { %]
[% if((it['step'] <= 3 || it['step'] == 10) && check_auth('index/backOutToOne')) { %]
<a class="btn1 btn-success report-back-out" href="#modal-back-out" data-toggle="modal">撤销</a>&nbsp;
[% } %]
<a class="btn1 btn-success timeline" href="#modal-time" data-toggle="modal">时间轴</a>
......@@ -94,12 +100,12 @@
[% var dealT=function(g){if(g&&(g!="null")){return g}else{return""}}; %]
[% for(var i in it['data']){ %]
<tr class="text-center" data-id="[%= it['data'][i]['id'] %]" data-agentid="[%= it['data'][i]['agent_id'] %]" data-role="[%= it['data'][i]['role'] %]" data-lastid="[%= it['data'][i]['last_commission_id'] %]">
<td>[%= it['data'][i]['role_name'] %]</td>
<td data-role="[%= it['data'][i]['role'] %]">[%= it['data'][i]['role_name'] %]</td>
<td>[%= it['data'][i]['agent'] %]</td>
<td>[%= it['data'][i]['district_store'] %]</td>
<td><span contenteditable class="detail-modal-maid-span-scale">[%= it['data'][i]['scale'] %]</span><span>%</span></td>
<td contenteditable class="detail-modal-maid-td-should-commission">[%= it['data'][i]['scale_fee'] %]</td>
<td colspan="6" class="detail-modal-maid-mix-td oh">
<td colspan="7" class="detail-modal-maid-mix-td oh">
[% if(it['data'][i]['partial_commission'] && it['data'][i]['partial_commission'].length && it['data'][i]['partial_commission'].length>0) { %]
[% for(var j in it['data'][i]['partial_commission']){ %]
<div class="oh" data-id="[%= it['data'][i]['partial_commission'][j]['id'] %]">
......@@ -108,6 +114,16 @@
<span contenteditable class="detail-modal-maid-span-charity-fund">[%= it['data'][i]['partial_commission'][j]['charity_fund'] %]</span>
<span contenteditable class="detail-modal-maid-span-cash">[%= it['data'][i]['partial_commission'][j]['cash'] %]</span>
<span contenteditable class="detail-modal-maid-span-practical-fee">[%= it['data'][i]['partial_commission'][j]['practical_fee'] %]</span>
[% if(!it['data'][i]['partial_commission'][j]['income_time'] || (Array.isArray(it['data'][i]['partial_commission'][j]['income_time']) && it['data'][i]['partial_commission'][j]['income_time'].length<1) ) { %]
[% if(it['data'][i]['partial_commission'][j]['income_time_add']) { %]
<span class="detail-modal-maid-span-date" data-dateid="[%= it['data'][i]['partial_commission'][j]['income_time_add']['id'] %]">[%= it['data'][i]['partial_commission'][j]['income_time_add']['income_time'] %]</span>
[% }else{ %]
<span class="detail-modal-maid-span-date" data-dateid="">请点击选择</span>
[% } %]
[% }else{ %]
<span class="detail-modal-maid-span-date" data-dateid="[%= it['data'][i]['partial_commission'][j]['income_time']['id'] %]">[%= it['data'][i]['partial_commission'][j]['income_time']['income_time'] %]</span>
[% } %]
<span class="detail-modal-maid-span-time">[%= dealT(it['data'][i]['partial_commission'][j]['confirm_date']) %]</span>
</div>
[% } %]
......@@ -118,6 +134,7 @@
<span contenteditable class="detail-modal-maid-span-charity-fund">0</span>
<span contenteditable class="detail-modal-maid-span-cash">0</span>
<span contenteditable class="detail-modal-maid-span-practical-fee"></span>
<span class="detail-modal-maid-span-date" data-dateid="">请点击选择</span>
<span class="detail-modal-maid-span-time"></span>
</div>
[% } %]
......@@ -146,6 +163,7 @@
<span contenteditable class="detail-modal-maid-span-charity-fund">0</span>
<span contenteditable class="detail-modal-maid-span-cash">0</span>
<span contenteditable class="detail-modal-maid-span-practical-fee"></span>
<span class="detail-modal-maid-span-date" data-dateid="">请点击选择</span>
<span class="detail-modal-maid-span-time"></span>
</div>
</script>
\ No newline at end of file
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 to comment