Commit e565fb5d authored by clone's avatar clone

Merge branch '0717-v3.3.5' of https://gitee.com/zwyjjc/tl_estate into 0717-v3.3.5

parents 8396821d ff6410aa
......@@ -162,9 +162,9 @@ class User extends Basic
}
if (isset($params['site_id']) ) {
$conditions['s.site_id'] = $params['site_id'];
$conditions['a.site_id'] = [ 'LIKE', '%' . $params['site_id'] . '%' ];
}else{
$conditions['s.site_id'] = $this->siteId;
$conditions['a.site_id'] = [ 'LIKE', '%' . $this->siteId. '%' ];
}
$return_user_list = $this->userModel->selectUserList($field, $conditions, $pageNo, $pageSize, $order);
break;
......
......@@ -1095,4 +1095,5 @@ class Broker extends Basic
return $this->response($result['code'], $result['msg']);
}
}
\ No newline at end of file
......@@ -10,11 +10,297 @@ namespace app\index\controller;
use app\index\extend\Basic;
use app\index\service\CostService;
use app\index\untils\ExportExcelUntil;
use app\model\FApplyForFee;
use app\model\FApplyForFeeCheck;
class Cost extends Basic
{
/**
* 费用报销列表
*
* @return \think\Response
*/
public function getCostList() {
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
if (!$this->request->isAjax() && $this->params['excel'] != 1) {
return view('cost/costCheck');
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$where = $this->buildWhere($this->params);
$field = 'a.id,a.count_time,a.source,a.type,a.create_time,a.agent_id,a.total_fee,a.fee_item,a.purpose,a.status,';
$field .= 'b.name as agent_name,a.site_id';
$fee_model = new FApplyForFee();
if ($this->params['excel'] != 1) {
$list = $fee_model->getJoinAgentList($pageNo, $pageSize, 'a.ID DESC', $field, $where);
$data['list'] = &$list;
$data['total'] = $fee_model->getJoinAgentListTotal($where);
return $this->response(200, '', $data);
} else {
$list = $fee_model->getJoinAgentList(1, 100000, 'a.ID DESC', $field, $where);
$source = [
0=> 'app申请',
1=>'excel导入'
];
$status = [
0=>'申请中',
1=>'总监通过',
2=>'一审通过',
3=>'二审通过',
4=>'三审通过',
];
foreach ($list as $k=>$v) {
$excel_data[$k] = [
'id'=>$v['id'],
'count_time'=>$v['count_time'],
'create_time'=>$v['create_time'],
'agent_name'=>$v['agent_name'],
'total_fee'=>$v['total_fee'],
'type_name'=>$this->getFeeType($v['type']),
'fee_item_name'=>$this->getFeeItem($v['fee_item']),
'purpose'=>$v['purpose'],
'source_name' => $source[$v['source']],
'status'=>$status[$v['status']]
];
}
if (isset($excel_data)) {
$export = new ExportExcelUntil();
$title = [ '费用总ID', '计入月份', '提交时间', '提交人', '费用总金额', '费用类型', '费用项目', '费用用途','来源','状态' ];
$export->exportTable('费用报销审核', $excel_data, 11, '费用报销审核', $title);
}
}
}
/**
* 构造条件
*
* @param $param
* @return mixed
*/
private function buildWhere($param)
{
if (isset($param['check_status'])) {
switch($param['check_status']) {
case 0 :
$where['a.status'] = 0;break;
case 1 :
$where['a.status'] = 1;break;
case 2 :
$where['a.status'] = 2;break;
case 3 :
$where['a.status'] = 3;break;
case 4 :
$where['a.status'] = 4;break;
}
}
$where['a.is_del'] = 0;
//默认提交的月份
if (isset($params['count_time'])) {
$where['a.count_time'] = $param['count_time'];
}
//申请提交时间
if (isset($param['create_time_start'])) {
$where['a.create_time'] = ['>=', $param['create_time_start']];
}
//申请提交时间
if (isset($param['create_time_end'])) {
$where['a.create_time'] = ['<=', $param['create_time_end']];
}
//申请提交时间
if (isset($param['create_time_start']) && isset($param['create_time_end'])) {
$where['a.create_time'] = ['between', [$param['create_time_start']. ' 00:00:00', $param['create_time_end'].' 23:59:59']];
}
//财务三审通过时间
if (isset($param['pass_time_start'])) {
$check_where['create_time'] = ['>=', $param['pass_time_start']];
}
//财务三审通过时间
if (isset($param['pass_time_end'])) {
$check_where['a.create_time'] = ['<=', $param['pass_time_end']];
}
//财务三审通过时间
if (isset($param['pass_time_start']) && isset($param['pass_time_end'])) {
$check_where['a.create_time'] = ['between', [$param['pass_time_end']. ' 00:00:00', $param['pass_time_end'].' 23:59:59']];
}
if (isset($check_where)) {
$m_fee_check = new FApplyForFeeCheck();
$check_where['is_del'] = 0;
$check_where['type'] = $where['a.status'] = 4;
$fee_id = $m_fee_check->findColumn('apply_for_id', $check_where);
$where['a.id'] = ['in', $fee_id];
}
//费用类型
if (isset($param['type'])) {
$where['a.type'] = $param['type'];
}
//站点
if (isset($param['site_id'])) {
$where['a.site_id'] = $param['site_id'];
}
//编号
if (isset($param['id'])) {
$where['a.id'] = $param['id'];
}
//提交人id
if (isset($param['agent_id'])) {
$where['a.agent_id'] = $param['agent_id'];
}
//提交人门店id
if (isset($param['store_id'])) {
$where['a.store_id'] = $param['store_id'];
}
//提交人部门id
if (isset($param['district_id'])) {
$where['b.district_id'] = $param['district_id'];
}
//费用项目
if (isset($param['fee_item'])) {
$where['a.fee_item'] = $param['fee_item'];
}
//详细用途简述
if (isset($param['purpose'])) {
$check_where['a.purpose'] = ['like', '%'.$param['purpose'].'%'];
}
return $where;
}
/**
* 删除费用报销申请
*
* @return \think\Response
*/
public function delCost()
{
$code = 101;
if (empty($this->params['id'])) {
return $this->response($code, '参数错误');
}
$fee_model = new FApplyForFee();
$is_ok = $fee_model->editData(['is_del'=>1], $this->params['id']);
if ($is_ok) {
$check_model = new FApplyForFeeCheck();
$check_model->editData(['is_del'=>1], $this->params['id'], 'apply_for_id');
$code = 200;
$msg = '删除成功';
} else {
$msg = '删除失败';
}
return $this->response($code, $msg);
}
/**
* 审核
*
* @return \think\Response
*/
public function checkCost()
{
$code = 101;
if (empty($this->params['id'])) {
return $this->response($code, '参数错误');
}
switch($this->params['check_status']) {
case 1 :
$this->params['status'] = 1;break;
case 2 :
$this->params['status'] = 2;break;
case 3 :
$this->params['status'] = 3;break;
case 4 :
$this->params['status'] = 4;break;
default :
return $this->response($code, '请求链接参数错误');
}
$service = new CostService();
$result = $service->check($this->params, $this->userId);
if ($result['status'] != 'fail') {
$code = 200;
}
return $this->response($code, $result['msg']);
}
/**
* 获取费用项目
*
* @param $key
* @return string
*/
private function getFeeItem($key)
{
$item_array = [
100=>'房租租金',
101=>'水电费',
102=>'其他费用',
201=>'总部固定成本',
301=>'分部固定成本',
401=>'同联发展基金',
501=>'家庭基金报销',
502=>'社保报销',
503=>'总经理基薪',
504=>'区域秘书基薪',
505=>'招聘成本',
506=>'区域经理基本工资平摊',
507=>'宿舍成本',
508=>'宿舍亏损',
509=>'手续费',
510=>'员工工资成本',
511=>'网络报销',
512=>'离职员工网络',
513=>'门店独有成本其他费用'
];
if (array_key_exists($key, $item_array)) {
$result = $item_array[$key];
} else {
$result = '未知';
}
return $result;
}
/**
* 获取费用报销类型
*
* @param $key
* @return string
*/
private function getFeeType($key)
{
$type_array = [
0=>'办公室成本',
1=>'总部成本',
2=>'分部成本',
3=>'门店独有成本',
];
if (array_key_exists($key, $type_array)) {
$result = $type_array[$key];
} else {
$result = '未知';
}
return $result;
}
}
\ No newline at end of file
<?php
namespace app\index\controller;
use app\index\extend\Basic;
use app\api\service\ActivityService;
use app\model\CActivity;
use app\model\FStoreCostExt;
use think\Request;
/**
* 成本明细
* Created by PhpStorm.
* User: zw
* Date: 2019-07-19
* Time: 13:22:17
*/
class CostDetail extends Basic
{
private $storeCostExt;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->storeCostExt = new FStoreCostExt();
}
/**
* 成本明细表
* @return \think\Response
*/
public function getCostDetailList()
{
$params = $this->params;
/* $params = array(
);*/
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$activityModel = new CActivity();
$conditions = [];
// if (!empty($params["title"])) {
// $conditions["title"] = array("like", "%" . trim($params['title']) . "%");
// }
// if (!empty($params["id"])) {
// $conditions["id"] = $params['id'];
// }
$field = 'a.id,a.cost_id,b.setting_date,a.create_time,b.operator_name,
';
$list = $this->storeCostExt->getStoreCostExt($field, $conditions, $pageNo, $pageSize);
$count = $this->storeCostExt->getStoreCostExtTotal($field, $conditions);
$result["list"] = $list;
$result["total"] = $count;
return $this->response("200", "success", $result);
}
}
\ No newline at end of file
......@@ -1526,4 +1526,76 @@ class OfficeBargain extends Basic
return $this->response(200, "", $data);
}
/**
* 财务结单
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function checkOver()
{
if (empty($this->params['bargain_id'])) {
return $this->response(101, '参数错误');
}
$m_partial_commission = new OfficeOPartialCommission();
$confirm_status = $m_partial_commission->checkConfirmStatus($this->params['bargain_id']);
if ($confirm_status) {
return $this->response(101, '请确认分佣');
}
$insert_data['audit_id'] = $this->userId;
$insert_data['audit_name'] = $this->userName;
$insert_data['audit_level'] = 3;
$data = $this->m_bargain->addCheckBargain($this->params['bargain_id'], $insert_data, 1, 11);
$code = 200;
$msg = "";
if ($data) {
$this->editRecordLog($this->params['bargain_id'], '[财务结单]', 3); //日志记录
} else {
$code = 101;
$msg = '参数错误结单失败!';
}
return $this->response($code, $msg);
}
/**
* 回到一级审核
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function toReportListOne()
{
if (empty($this->params['bargain_id'])) {
return $this->response(101, '参数错误');
}
$m_financial = new OfficeOFinancialAudit();
$data['status'] = 3;
$data['is_del'] = 1; //去除之前的审核记录
$data = $m_financial->editData($data, $this->params['bargain_id'], 'bargain_id');
$msg = '';
if ($data > 0) {
$update_data['status'] = 10;
$update_data['audit_level'] = 0;
$where[] = [ 'EXP', 'id=' . $this->params['bargain_id'] . ' or father_id=' . $this->params['bargain_id'] ];
$where['status'] = [ '<>', 30 ];
$this->m_bargain->updateBargainByWhere($update_data, $where);
$code = 200;
$this->editRecordLog($this->params['bargain_id'], '[转到一级审核]', 3); //日志记录
} else {
$code = 101;
$msg = '操作失败!';
}
return $this->response($code, $msg);
}
}
\ No newline at end of file
......@@ -239,4 +239,75 @@ class StoreFee extends Basic
}
/**
* 绑定解绑门店
* @return \think\Response
*/
public function bindStore()
{
$params = $this->params;
// $params = array(
// "id" => '1',//id
// );
$checkResult = $this->validate($params, "StoreFeeValidate.bindStore");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$m_store = new AStore();
$store_result = $m_store->getStore(['id'=>$params['store_id']], 'id');
if(!$store_result)
return $this->response("101", "该门店不存在");
if ($params['office_id'] == 0) {
//解绑
$conditions['office_id'] = 0;
$conditions['id'] = $params['store_id'];
$return = $m_store->updateStore($conditions);
} else {
$store_params['id'] = $params['store_id'];
$store_params['office_id'] = array('gt',0);
$store_result = $m_store->getStore($store_params, 'id');
if($store_result)
return $this->response("101", "该门店已绑定或已绑定其他办公室");
//绑定
$conditions['id'] = $params['store_id'];
$conditions['office_id'] = $params['office_id'];
$return = $m_store->updateStore($conditions);
}
return $this->response("200", "成功", $return);
}
/**
* 搜索门店
* @return \think\Response
*/
public function selectStore()
{
$params = $this->params;
/*$params = array(
"store_name" => '测试'
);*/
$conditions = [];
if (!empty($params['store_name'])) {
$conditions['store_name'] = ['LIKE', '%'.$params['store_name'].'%'];
}
$m_store = new AStore();
$store_field = 'id,store_name';
$store_result = $m_store->getStore($conditions, $store_field);
if(!$store_result)
return $this->response("101", "成功",[]);
return $this->response("200", "成功",$store_result);
}
}
\ No newline at end of file
<?php
namespace app\index\service;
use app\model\FApplyForFee;
use app\model\FApplyForFeeCheck;
class CostService
{
private $apply_model;
private $check_model;
public function __construct()
{
$this->apply_model = new FApplyForFee();
$this->check_model = new FApplyForFeeCheck();
}
/**
* 费用报销审核
* status 审核状态 1总监审核 2一审审核 3二审审核 4三审审核
*
* @param $params
* @param $agent_id
* @return mixed
*/
public function check($params, $agent_id)
{
$result['status'] = 'fail';
$where['id'] = $params['id'];
$where['is_del'] = $id = 0;
$cost_data = $this->apply_model->findByOne('id,status', $where);
if (empty($cost_data)) {
$result['msg'] = '无该记录';
return $result;
}
if ($cost_data['status'] == $params['status']) {
$result['msg'] = '已审核过:1';
return $result;
}
$check_where['apply_for_id'] = $cost_data['id'];
$check_where['is_del'] = 0;
try {
$check_data = $this->check_model->findByOneOrder('type', $check_where, 'id desc');
} catch (\Exception $e) {
$result['msg'] = '查询审核记录失败'.$e->getMessage();
return $result;
}
if ($check_data['type'] == $params['status']) {
$result['msg'] = '已审核过:2';
return $result;
}
$save_check['apply_for_id'] = $cost_data['id'];
$save_check['agent_id'] = $agent_id;
$save_check['type'] = $params['status'];
$save_check['remark'] = $params['remark'];
$num = $this->check_model->saveData($save_check);
if ($num) {
try {
$id = $this->apply_model->updateData(['status'=>$params['status']], ['id'=>$cost_data['id']]);
} catch (\Exception $e) {
$result['msg'] = '修改申请记录失败'.$e->getMessage();
return $result;
}
}
if ($id) {
$result['status'] = 'successful';
} else {
$result['msg'] = '审核失败';
}
return $result;
}
}
\ No newline at end of file
......@@ -12,7 +12,9 @@ class StoreFeeValidate extends Validate {
'office_address' => 'require',
'rent' => 'require|number|gt:0',
'id' => 'require|number|gt:0',
'id' => 'require|number|gt:0',
'office_id' => 'require|number',
'store_id' => 'require|number|gt:0',
];
protected $message = [
......@@ -26,12 +28,20 @@ class StoreFeeValidate extends Validate {
'id.require' => 'id为必填字段',
'id.number' => 'id只能为数字',
'id.gt' => 'id必须大于0',
'office_id.require' => 'office_id为必填字段',
'office_id.number' => 'office_id只能为数字',
'store_id.require' => 'store_id为必填字段',
'store_id.number' => 'store_id只能为数字',
'store_id.gt' => 'store_id必须大于0',
];
protected $scene = [
'addOffice' => [ 'site_id', 'office_name', 'office_address', 'rent' ],
'getOfficeInfo' => [ 'id' ],
'editOffice' => [ 'id', 'site_id', 'office_name', 'office_address', 'rent' ],
'bindStore' => [ 'office_id', 'store_id' ],
];
}
\ No newline at end of file
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="costCheck" />
<style>
.choose_total,.choose_siteID,.choose_store{
display: none;
}
.user-ul2 {
width: 100%;
height: auto;
padding-bottom: 15px;
float: left;
}
.user-ul2 li {
list-style: none;
line-height: 30px;
}
.user-ul{
float: right;
text-align:center;
position: relative;
overflow-y:scroll ;
height:100px;
left: 0px;
width:100%;
line-height: 30px;
}
.user-ul li{
list-style: none;
line-height: 20px;
}
ul {
-webkit-padding-start: 0px !important;
}
.margain-10{
margin-bottom: 10px;
}
......@@ -76,12 +111,12 @@
<a href="javascript:;">费用报销审核</a>
</li>
<div class="btn-group">
<button type="button" class="choose_btn btn btn-info" data-value="1" style="margin-left: 20px;">总监通过</button>
<button type="button" class="choose_btn btn btn-default" data-value="3">财务一审通过</button>
<button type="button" class="choose_btn btn btn-default" data-value="2">财务二审通过</button>
<button type="button" class="choose_btn btn btn-default" data-value="4">财务三审通过</button>
<button type="button" class="choose_btn btn btn-default " data-value="5">未审核</button>
<button type="button" class="choose_btn btn btn-default " data-value="-1">全部</button>
<button type="button" class="choose_btn btn btn-info choose_btn1" data-value="/index/getCostListTwo/1" style="margin-left: 20px;">总监通过</button>
<button type="button" class="choose_btn btn btn-default choose_btn2" data-value="/index/getCostListThree/2">财务一审通过</button>
<button type="button" class="choose_btn btn btn-default choose_btn3" data-value="/index/getCostListFour/3">财务二审通过</button>
<button type="button" class="choose_btn btn btn-default choose_btn4" data-value="/index/getCostListFive/4">财务三审通过</button>
<button type="button" class="choose_btn btn btn-default choose_btn5" data-value="/index/getCostListOne/0">未审核</button>
<button type="button" class="choose_btn btn btn-default choose_btn6" data-value="/index/getCostList">全部</button>
</div>
<div class="pull-right">
<ul class="bread_btn">
......@@ -100,40 +135,53 @@
<td colspan="15">
<form id="form_search">
<span class="fore-span ld-Marheight">计入月份:</span>
<input id="comit_time_start" class="form-control btn4 ld-Marheight" type="text" placeholder="请选择"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM',maxDate:'#F{ $dp.$D(\'comit_time_end\')||\'%y-%M-%d\'}',readOnly:'readonly' })">
<input id="count_time" class="form-control btn4 ld-Marheight" type="text" placeholder="请选择"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM',readOnly:'readonly' })">
<span class="fore-span ld-Marheight">申请提交时间:</span>
<input id="comit_time_start" class="form-control btn4 ld-Marheight" type="text" placeholder="开始时间"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',maxDate:'#F{ $dp.$D(\'comit_time_end\')||\'%y-%M-%d\'}',readOnly:'readonly' })">
<input id="create_time_start" class="form-control btn4 ld-Marheight" type="text" placeholder="开始时间"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',maxDate:'#F{ $dp.$D(\'create_time_end\')||\'%y-%M-%d\'}',readOnly:'readonly' })">
<span class="fore-span ld-Marheight">-</span>
<input id="comit_time_end" class="form-control btn4 ld-Marheight" type="text" placeholder="结束时间"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',minDate:'#F{ $dp.$D(\'comit_time_start\' )}',maxDate:'%y-%M-%d',readOnly:'readOnly'})">
<input id="create_time_end" class="form-control btn4 ld-Marheight" type="text" placeholder="结束时间"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',minDate:'#F{ $dp.$D(\'create_time_start\' )}',maxDate:'%y-%M-%d',readOnly:'readonly'})">
<span class="fore-span ld-Marheight">财务三审通过时间:</span>
<input id="into_time_start" class="form-control btn4 ld-Marheight" type="text" placeholder="开始时间"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',maxDate:'#F{ $dp.$D(\'into_time_end\')||\'%y-%M-%d\'}',readOnly:'readonly'})">
<input id="pass_time_start" class="form-control btn4 ld-Marheight" type="text" placeholder="开始时间"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',maxDate:'#F{ $dp.$D(\'pass_time_end\')||\'%y-%M-%d\'}',readOnly:'readonly'})">
<span class="fore-span ld-Marheight">-</span>
<input id="into_time_end" class="form-control btn4 ld-Marheight" type="text" placeholder="结束时间"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',minDate:'#F{ $dp.$D(\'into_time_start\')}',maxDate:'%y-%M-%d',readOnly:'readonly'})">
<select class="form-control btn2 ld-Marheight" id="changed_type">
<input id="pass_time_end" class="form-control btn4 ld-Marheight" type="text" placeholder="结束时间"
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',minDate:'#F{ $dp.$D(\'pass_time_start\' )}',maxDate:'%y-%M-%d',readOnly:'readonly'})">
<select class="form-control btn2 ld-Marheight" id="cost_type">
<option value="">费用类型</option>
<option value="0">退意向金</option>
<option value="1">意向金转定</option>
<option value="2">退保管金</option>
<option value="3">保管金转定</option>
<option value="4">退中介费</option>
<option value="5">退案场费</option>
<option value="0">办公室成本</option>
<option value="1">总部成本</option>
<option value="2">分部成本</option>
<option value="3">门店独有成本</option>
</select>
<select class="form-control btn2 ld-Marheight" id="changed_type">
<select class="form-control btn2 ld-Marheight" id="fee_item">
<option value="">费用项目</option>
<option value="0">退意向金</option>
<option value="1">意向金转定</option>
<option value="2">退保管金</option>
<option value="3">保管金转定</option>
<option value="4">退中介费</option>
<option value="5">退案场费</option>
<!--办公室类型-->
<option value="101" class="choose_office">水电费</option>
<option value="102" class="choose_office">其他费用</option>
<!--总部成本类型-->
<option value="102" class="choose_total">其他费用</option>
<!--分部成本类型-->
<option value="10002" class="choose_siteID">杭州</option>
<option value="10003" class="choose_siteID">深圳</option>
<option value="10004" class="choose_siteID">广州</option>
<option value="10005" class="choose_siteID">北京</option>
<!--门店独有成本类型-->
<option value="506" class="choose_store">区域经理基本工资</option>
<option value="504" class="choose_store">区域秘书基薪</option>
<option value="505" class="choose_store">招聘成本</option>
<option value="507" class="choose_store">宿舍成本</option>
<option value="508" class="choose_store">宿舍亏损</option>
<option value="510" class="choose_store">员工工资成本</option>
<option value="511" class="choose_store">网络报销</option>
<option value="512" class="choose_store">离职员工网络</option>
</select>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="changed_id" placeholder="费用用途" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="back_id_money" placeholder="费用报销ID" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="purpose" placeholder="费用用途" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="cost_id" placeholder="费用报销ID" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="comit_name" placeholder="提交人姓名" type="text" value="">
<ul class="user-ul" style="display:none"></ul>
<select class="form-control btn2 ld-Marheight" id="commit_home">
......@@ -178,26 +226,6 @@
</div>
</div>
</div>
<!--时间轴-->
<div class="modal fade" id="modal-time" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<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" class="iframe-div-parent">
<iframe class="iframe-time-line"></iframe>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- 新增报销 -->
<div class="modal fade" id="modal-check" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="font-size: 16px;">
<div class="modal-dialog" style="width: 900px;font-size: 14px;">
......
......@@ -438,9 +438,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消
</button>
<button type="button" class="btn btn-primary" id="confirm_delete" data-dismiss="modal">
删除
</button>
<a class="btn btn-info newStore" href="#modal_addStore" data-toggle="modal">新增门店</a>
</div>
</div>
<!-- /.modal-content -->
......@@ -448,6 +446,35 @@
<!-- /.modal -->
</div>
<!--新增门店-->
<div class="modal fade" id="modal_addStore" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-one" style="width: 500px;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title" >
新增门店
</h4>
</div>
<div class="modal-body modal-body-one">
<br>
<input class="form-control ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="comit_name" placeholder="请输入门店名称进行搜索" type="text" value="" style="width: 300px;">
<ul class="user-ul" style="display:none"></ul>
<br><br><br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消
</button>
<button type="button" class="btn btn-primary" id="saveStore" data-dismiss="modal">
确定
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<div id="img_mask_area" title="点击任意位置可关闭">
<img />
</div>
<script src='/resource/lib/js/require.min.js' data-main='/resource/js/main?version=20190718' charset='utf-8'></script>
<script src='/resource/lib/js/require.min.js' data-main='/resource/js/main?version=201910718' charset='utf-8'></script>
......@@ -267,6 +267,7 @@ class AStore extends BaseModel
/**
* 获取门店
* @param $params
* @param $field
* @return false|\PDOStatement|string|\think\Collection
*/
public function getStore($params,$field)
......@@ -275,7 +276,6 @@ class AStore extends BaseModel
->field($field)
->where($params)
->select();
//echo Db::table($this->table)->getLastSql();
//dump($this->getLastSql());
return $result;
}
......@@ -337,4 +337,14 @@ class AStore extends BaseModel
->count();
return $store_num;
}
/**
* 更新数据
* @param $params
* @return mixed
*/
public function updateStore($params)
{
return Db::table($this->table)->update($params);
}
}
\ No newline at end of file
......@@ -16,18 +16,29 @@ class FApplyForFee extends BaseModel
$this->db_ = Db::name($this->table);
}
/**
* 新增数据
* @param $data
* @return mixed
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function saveOffice($data) {
$time = date("Y-m-d H:i:s", time());
public function saveData($data) {
$data["is_del"] = 0;
$data['create_time'] = $time;
$data['update_time'] = $time;
return $this->db_->insert($data);
$data['create_time'] = date("Y-m-d H:i:s", time());
$id = $this->db_->insertGetId($data);
return $id;
}
/**
* @param $data
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function updateData($data, $where)
{
$data['update_time'] = date("Y-m-d H:i:s", time());
return $this->db_->update($data);
}
/**
......@@ -41,4 +52,33 @@ class FApplyForFee extends BaseModel
->find();
return $result;
}
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getJoinAgentList($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field = '', $params = '') {
return $this->field($field)->alias('a')
->join('a_agents b', 'a.agent_id=b.id','left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
}
/**
* @param string $params
* @return int|string
*/
public function getJoinAgentListTotal($params = '') {
return $this->alias('a')
->join('a_agents b', 'a.agent_id=b.id','left')
->where($params)
->count('a.id');
}
}
......@@ -22,7 +22,7 @@ class FApplyForFeeCheck extends BaseModel
* @param $data
* @return mixed
*/
public function saveOffice($data) {
public function saveData($data) {
$time = date("Y-m-d H:i:s", time());
$data["is_del"] = 0;
$data['create_time'] = $time;
......@@ -41,4 +41,31 @@ class FApplyForFeeCheck extends BaseModel
->find();
return $result;
}
/**
* @param $field
* @param $params
* @return array
*/
public function findColumn($field,$params) {
return $this->db_
->where($params)
->column($field);
}
/**
* @param $field
* @param $params
* @param string $order
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function findByOneOrder($field, $params, $order = 'id desc') {
return $this->db_->field($field)
->where($params)
->order($order)
->find();
}
}
......@@ -84,57 +84,6 @@ class FOffice extends BaseModel
{
return $this->db_->update($params);
}
//
// /**
// * 根据id获取单个字段值
// *
// * @param $id
// * @param $where
// * @param $fields
// * @return mixed
// */
// public function getOfficeById($fields, $id, $where = [])
// {
// $where['is_del'] = 0;
// if ($id) {
// $where['id'] = $id;
// }
// $return = $this->db_->where($where)->value($fields);
// return $return;
// }
//
// /**
// * @param $id
// * @param $fields
// * @return false|\PDOStatement|string|\think\Collection
// * @throws \think\db\exception\DataNotFoundException
// * @throws \think\db\exception\ModelNotFoundException
// * @throws \think\exception\DbException
// */
// public function getOfficeByIdList($id, $fields)
// {
// $return = $this->db_->field($fields)->where('id', 'in',$id)->select();
// return $return;
// }
//
// /**
// * @param string $fields
// * @param array $where
// * @return bool|false|\PDOStatement|string|\think\Collection
// * User HuJun
// * Date 19-5-9 上午10:00
// */
// public function getOfficeList($fields = 'id,name,city', $where = [])
// {
// if (!isset($where['is_del'])) {
// $where['is_del'] = 0;
// }
// try {
// $result = $this->db_->field($fields)->where($where)->select();
// } catch (\Exception $e) {
// $result = false;
// }
// return $result;
// }
}
<?php
namespace app\model;
use think\Db;
use think\Model;
class FStoreCostExt extends BaseModel
{
protected $table = 'f_store_cost_ext';
private $db_;
public function __construct($data = [])
{
parent::__construct($data);
$this->db_ = Db::name($this->table);
}
/**
* 查询数据
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getStoreCostExt($field,$params,$pageNo, $pageSize)
{
$params["b.status"] = 0;
$result = $this->db_
->field($field)
->alias('a')
->join('f_store_cost b', 'a.cost_id = b.id', 'left')
->where($params)
->limit($pageSize)
->page($pageNo)
->select();
return $result;
}
public function getStoreCostExtTotal($field,$params)
{
$params["b.status"] = 0;
$result = $this->db_
->field($field)
->alias('a')
->join('f_store_cost b', 'a.cost_id = b.id', 'left')
->where($params)
->count();
return $result;
}
}
......@@ -88,6 +88,7 @@ class OPayLogAdjustment extends BaseModel{
* @return int|mixed
*/
public function getFieldColumn($field,$params) {
$params['is_del'] = 0;
return $this->db_->where($params)
->column($field);
}
......
......@@ -391,7 +391,7 @@ class OfficeOBargainModel extends Model
])->find();
if ($bargain_data != '') {
$audit = new OFinancialAudit();
$audit = new OfficeOFinancialAudit();
$audit_data = $audit->getLastStep($bargain_data['id'], $source); //获取最后一次审核等级
$save_data['bargain_id'] = $bargain_data['id'];
......
......@@ -522,8 +522,24 @@ Route::group('index', [
'addOffice' => [ 'index/StoreFee/addOffice', [ 'method' => 'POST|GET' ] ],
'getOfficeList' => [ 'index/StoreFee/getOfficeList', [ 'method' => 'POST|GET' ] ],
'getOfficeInfo' => [ 'index/StoreFee/getOfficeInfo', [ 'method' => 'POST|GET' ] ],
'editOffice' => [ 'index/StoreFee/editOffice', [ 'method' => 'POST|GET' ] ],
'getStoreList' => [ 'index/StoreFee/getStoreList', [ 'method' => 'POST|GET' ] ],
'editOffice' => [ 'index/StoreFee/editOffice', [ 'method' => 'POST|GET' ] ],
'getStoreList' => [ 'index/StoreFee/getStoreList', [ 'method' => 'POST|GET' ] ],
'bindStore' => [ 'index/StoreFee/bindStore', [ 'method' => 'POST|GET' ] ],
'selectStore' => [ 'index/StoreFee/selectStore', [ 'method' => 'POST|GET' ] ],
'getCostList' => ['index/Cost/getCostList', ['method' => 'GET']], //费用报销审核全部
'getCostListOne/:check_status' => ['index/Cost/getCostList', ['method' => 'GET'], ['check_status' => 0]], //费用报销未审核
'getCostListTwo/:check_status' => ['index/Cost/getCostList', ['method' => 'GET'], ['check_status' => 1]], //费用报销审核总监
'getCostListThree/:check_status' => ['index/Cost/getCostList', ['method' => 'GET'], ['check_status' => 2]], //费用报销审核一审
'getCostListFour/:check_status' => ['index/Cost/getCostList', ['method' => 'GET'], ['check_status' => 3]], //费用报销审核二审
'getCostListFive/:check_status' => ['index/Cost/getCostList', ['method' => 'GET'], ['check_status' => 4]], //费用报销审核三审
'delCost' => ['index/Cost/delCost', ['method' => 'POST']], //删除费用报销审核
'checkCostTwo/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 1]], //费用报销审核总监
'checkCostThree/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 2]], //费用报销审核一审
'checkCostFour/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 3]], //费用报销审核二审
'checkCostFive/:check_status' => ['index/Cost/checkCost', ['method' => 'POST'], ['check_status' => 4]], //费用报销审核三审
'getCostDetailList' => [ 'index/CostDetail/getCostDetailList', [ 'method' => 'POST|GET' ] ],
]);
......@@ -1152,6 +1168,8 @@ Route::group('office_index', [
'checkReportAttache/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 1]], //审核成交报告-第一级审核
'checkReportManager/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 2]], //审核成交报告-第二级审核
'checkReportMajordomo/:check_status' => ['index/OfficeBargain/checkReport', ['method' => 'post'], ['check_status' => 3]], //审核成交报告-第三级审核
'checkOver' => ['index/OfficeBargain/checkOver', ['method' => 'POST']], //财务结单
'toReportListOne' => ['index/OfficeBargain/toReportListOne', ['method' => 'POST']], //回到一级审核
'partialCommissionList' => ['index/OfficeFinance/partialCommissionList', ['method' => 'get']], //分佣提成明细表
'performanceInfo' => ['index/OfficePerformanceInfo/performanceInfo', ['method' => 'GET|POST']],//业绩明细办公楼
......
......@@ -177,10 +177,11 @@ class PrivacyNumber
$is_down = '';
foreach ($down_data as $k => $v) {
$date_path = date('Ymd', strtotime($v['call_time']));
if (file_exists(PHONE_VOICE.'/'.$v['voice_file']) && !empty($v['voice_file'])) {
$data['record_down'] = empty($v['record_down']) ? 1 : 2;
if ($data['record_down'] == 1) {
$data['voice_file'] = date('Ymd') . '/' . basename($is_down);
$data['voice_file'] = $date_path . '/' . basename($is_down);
}
$this->m_secret_report->updateDownStatus($v['id'], $data);
continue;
......@@ -205,7 +206,7 @@ class PrivacyNumber
$file_name = explode('/', $v['voice_file']);
$file_name = $file_name[1];
}
$is_down = down_file($result_data->DownloadUrl, PHONE_VOICE, $file_name, $create_time);
$is_down = down_file($result_data->DownloadUrl, PHONE_VOICE, $file_name, $date_path);
}
} elseif ($v['type'] == 2) {
/*容联云音频下载*/
......@@ -216,14 +217,14 @@ class PrivacyNumber
$file_name = explode('/', $v['voice_file']);
$file_name = $file_name[1];
}
$is_down = down_file($v['mp3_url'], PHONE_VOICE, $file_name, $create_time);
$is_down = down_file($v['mp3_url'], PHONE_VOICE, $file_name, $date_path);
}
}
if (file_exists($is_down)) {
$data['record_down'] = empty($v['record_down']) ? 1 : 2;
if ($data['record_down'] == 1) {
$data['voice_file'] = date('Ymd') . '/' . basename($is_down);
$data['voice_file'] = $date_path . '/' . basename($is_down);
}
$this->m_secret_report->updateDownStatus($v['id'], $data);
}
......@@ -1024,4 +1025,23 @@ class PrivacyNumber
return Response::create(['code'=>200, 'msg'=>'修改数量'.$result], 'json');
}
public function dateFilePath(){
$model = new AliYunSecretReport();
$date = $_GET['date'];
$where['voice_file'] = ['like', date('Ymd', strtotime('+1 day', strtotime($date))).'/%'];
$where['create_time'] = ['between', [date('Y-m-d', strtotime($date)).' 00:00:00', date('Y-m-d', strtotime($date)).' 23:59:59']];
$data = $model->secretReportAll('id,call_time,voice_file', $where, 500);
foreach($data as $k=>$v) {
$file_arr = explode('/', $v['voice_file']);
$update_data[$k] = [
'id'=>$v['id'],
'voice_file'=> date('Ymd', strtotime($v['call_time'])).'/'.$file_arr[1]
];
}
if ($_GET['update']) {
$model->saveAll($update_data);
}
return Response::create(['code'=>200, 'msg'=>'', 'data'=>$update_data], 'json');
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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