first commit
This commit is contained in:
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\api;
|
||||
|
||||
use think\exception\HttpResponseException;
|
||||
use think\facade\Request;
|
||||
use think\facade\Session;
|
||||
use think\facade\View;
|
||||
use think\facade\Db;
|
||||
use think\Response;
|
||||
|
||||
/**
|
||||
* 控制器基础类
|
||||
*/
|
||||
abstract class BaseController
|
||||
{
|
||||
/**
|
||||
* 是否批量验证
|
||||
* @var bool
|
||||
*/
|
||||
protected $batchValidate = false;
|
||||
|
||||
/**
|
||||
* 控制器中间件
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [];
|
||||
|
||||
/**
|
||||
* 分页数量
|
||||
* @var string
|
||||
*/
|
||||
protected $pageSize = 20;
|
||||
|
||||
/**
|
||||
* jwt配置
|
||||
* @var string
|
||||
*/
|
||||
protected $jwt_conf = [
|
||||
'secrect' => 'gouguoa',
|
||||
'iss' => 'www.gougucms.com', //签发者 可选
|
||||
'aud' => 'gouguoa', //接收该JWT的一方,可选
|
||||
'exptime' => 7200, //过期时间,这里设置2个小时
|
||||
];
|
||||
protected $module;
|
||||
protected $controller;
|
||||
protected $action;
|
||||
protected $uid;
|
||||
protected $did;
|
||||
protected $pid;
|
||||
/**
|
||||
* 构造方法
|
||||
* @access public
|
||||
* @param App $app 应用对象
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->module = strtolower(app('http')->getName());
|
||||
$this->controller = strtolower(Request::controller());
|
||||
$this->action = strtolower(Request::action());
|
||||
$this->uid = 0;
|
||||
$this->did = 0;
|
||||
$this->pid = 0;
|
||||
$this->jwt_conf = get_system_config('token');
|
||||
// 控制器初始化
|
||||
$this->initialize();
|
||||
}
|
||||
|
||||
// 初始化
|
||||
protected function initialize()
|
||||
{
|
||||
// 检测权限
|
||||
$this->checkLogin();
|
||||
//每页显示数据量
|
||||
$this->pageSize = Request::param('limit', \think\facade\Config::get('app.page_size'));
|
||||
}
|
||||
|
||||
/**
|
||||
*验证用户登录
|
||||
*/
|
||||
protected function checkLogin()
|
||||
{
|
||||
$session_admin = get_config('app.session_admin');
|
||||
if (!Session::has($session_admin)) {
|
||||
$this->apiError('请先登录');
|
||||
}
|
||||
else{
|
||||
$this->uid = Session::get($session_admin);
|
||||
$login_admin = get_admin($this->uid);
|
||||
$this->did = $login_admin['did'];
|
||||
$this->pid = $login_admin['pid'];
|
||||
View::assign('login_admin', $login_admin);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Api处理成功结果返回方法
|
||||
* @param $message
|
||||
* @param null $redirect
|
||||
* @param null $extra
|
||||
* @return mixed
|
||||
* @throws ReturnException
|
||||
*/
|
||||
protected function apiSuccess($msg = 'success', $data = [])
|
||||
{
|
||||
return $this->apiReturn($data, 0, $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Api处理结果失败返回方法
|
||||
* @param $error_code
|
||||
* @param $message
|
||||
* @param null $redirect
|
||||
* @param null $extra
|
||||
* @return mixed
|
||||
* @throws ReturnException
|
||||
*/
|
||||
protected function apiError($msg = 'fail', $data = [], $code = 1)
|
||||
{
|
||||
return $this->apiReturn($data, $code, $msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回封装后的API数据到客户端
|
||||
* @param mixed $data 要返回的数据
|
||||
* @param integer $code 返回的code
|
||||
* @param mixed $msg 提示信息
|
||||
* @param string $type 返回数据格式
|
||||
* @param array $header 发送的Header信息
|
||||
* @return Response
|
||||
*/
|
||||
protected function apiReturn($data, int $code = 0, $msg = '', string $type = '', array $header = []): Response
|
||||
{
|
||||
$result = [
|
||||
'code' => $code,
|
||||
'msg' => $msg,
|
||||
'time' => time(),
|
||||
'data' => $data,
|
||||
];
|
||||
|
||||
$type = $type ?: 'json';
|
||||
$response = Response::create($result, $type)->header($header);
|
||||
|
||||
throw new HttpResponseException($response);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* 根据IP获取地址
|
||||
*/
|
||||
function get_address($ip)
|
||||
{
|
||||
$res = file_get_contents("http://ip.360.cn/IPQuery/ipquery?ip=" . $ip);
|
||||
$res = json_decode($res, 1);
|
||||
if ($res && $res['errno'] == 0) {
|
||||
return explode("\t", $res['data'])[0];
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据为excel表格
|
||||
* @param $data 一个二维数组,结构如同从数据库查出来的数组
|
||||
* @param $title excel的第一行标题,一个数组,如果为空则没有标题
|
||||
* @param $filename 下载的文件名
|
||||
* @param exportexcel($arr,array('id','账户','密码','昵称'),'文件名!');
|
||||
*/
|
||||
function export_excel($data = array(), $title = array(), $filename = 'report')
|
||||
{
|
||||
header("Content-type:application/octet-stream");
|
||||
header("Accept-Ranges:bytes");
|
||||
header("Content-type:application/vnd.ms-excel");
|
||||
header("Content-Disposition:attachment;filename=" . $filename . ".xls");
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: 0");
|
||||
//导出xls 开始
|
||||
if (!empty($title)) {
|
||||
foreach ($title as $k => $v) {
|
||||
$title[$k] = iconv("UTF-8", "GB2312", $v);
|
||||
}
|
||||
$title = implode("\t", $title);
|
||||
echo "$title\n";
|
||||
}
|
||||
if (!empty($data)) {
|
||||
foreach ($data as $key => $val) {
|
||||
foreach ($val as $ck => $cv) {
|
||||
$data[$key][$ck] = iconv("UTF-8", "GB2312", $cv);
|
||||
}
|
||||
$data[$key] = implode("\t", $data[$key]);
|
||||
}
|
||||
echo implode("\n", $data);
|
||||
}
|
||||
}
|
||||
|
||||
//读取文章分类列表
|
||||
function get_article_cate()
|
||||
{
|
||||
$cate = \think\facade\Db::name('ArticleCate')->order('create_time asc')->select()->toArray();
|
||||
return $cate;
|
||||
}
|
||||
//假期类型
|
||||
function get_leaves_types($id=0)
|
||||
{
|
||||
$types_array = ['未设置','事假','年假','调休假','病假','婚假','丧假','产假','陪产假','其他'];
|
||||
if($id==0){
|
||||
return $types_array;
|
||||
}
|
||||
else{
|
||||
$news_array=[];
|
||||
foreach($types_array as $key => $value){
|
||||
if($key>0){
|
||||
$news_array[]=array(
|
||||
'id'=>$key,
|
||||
'title'=>$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
return $news_array;
|
||||
}
|
||||
}
|
||||
|
||||
//根据假期类型读取名称
|
||||
function leaves_types_name($types=0)
|
||||
{
|
||||
$types_array = get_leaves_types();
|
||||
return $types_array[$types];
|
||||
}
|
||||
|
||||
//销售合同性质
|
||||
function get_contract_types($check_status=0)
|
||||
{
|
||||
$contract_types_array = [
|
||||
["id"=>1,"title"=>"普通合同"],
|
||||
["id"=>2,"title"=>"产品合同"],
|
||||
["id"=>3,"title"=>"服务合同"]
|
||||
];
|
||||
return $contract_types_array;
|
||||
}
|
||||
|
||||
//根据销售合同性质读取销售合同性质名称
|
||||
function contract_types_name($types=1)
|
||||
{
|
||||
$contract_types_array = get_contract_types();
|
||||
return $contract_types_array[$types-1];
|
||||
}
|
||||
|
||||
//采购合同性质
|
||||
function get_purchase_types($check_status=0)
|
||||
{
|
||||
$purchase_types_array = [
|
||||
["id"=>1,"title"=>"普通采购"],
|
||||
["id"=>2,"title"=>"物品采购"],
|
||||
["id"=>3,"title"=>"服务采购"]
|
||||
];
|
||||
return $purchase_types_array;
|
||||
}
|
||||
|
||||
//根据采购合同性质读取采购合同性质名称
|
||||
function purchase_types_name($types=1)
|
||||
{
|
||||
$purchase_types_array = get_purchase_types();
|
||||
return $purchase_types_array[$types-1];
|
||||
}
|
||||
@@ -0,0 +1,654 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\BaseController;
|
||||
use think\facade\Db;
|
||||
|
||||
class Check extends BaseController
|
||||
{
|
||||
//获取审核流程
|
||||
public function get_flows($check_name='')
|
||||
{
|
||||
$cate_id = Db::name('FlowCate')->where(['name' => $check_name,'status'=>1])->value('id');
|
||||
$flow = Db::name('Flow')->where(['cate_id' => $cate_id,'status'=>1,'delete_time'=>0])->select()->toArray();
|
||||
return to_assign(0, '', $flow);
|
||||
}
|
||||
//获取审核步骤人员
|
||||
public function get_flow_users($id=0)
|
||||
{
|
||||
$flow = Db::name('Flow')->where(['id' => $id])->find();
|
||||
$flow_data = unserialize($flow['flow_list']);
|
||||
if(!empty($flow_data)){
|
||||
foreach ($flow_data as $key => &$val) {
|
||||
$val['check_position'] = '';
|
||||
if($val['check_role'] == 1){
|
||||
$val['check_uids'] = get_department_leader($this->uid);
|
||||
}
|
||||
if($val['check_role'] == 2){
|
||||
$val['check_uids'] = get_department_leader($this->uid,1);
|
||||
}
|
||||
if($val['check_role'] == 3){
|
||||
$val['check_position'] = Db::name('Position')->where('id',$val['check_position_id'])->value('title');
|
||||
$check_uids = Db::name('Admin')->where(['position_id'=>$val['check_position_id'],'status'=>1])->column('id');
|
||||
$val['check_uids'] = implode(',',$check_uids);
|
||||
}
|
||||
$val['check_uids_info'] = Db::name('Admin')->field('id,name,thumb')->where('id','in',$val['check_uids'])->select()->toArray();
|
||||
}
|
||||
}
|
||||
else{
|
||||
$flow_data = [];
|
||||
}
|
||||
|
||||
$data['copy_uids'] = $flow['copy_uids'];
|
||||
$data['copy_unames'] ='';
|
||||
if(!empty($flow['copy_uids'])){
|
||||
$copy_unames = Db::name('Admin')->where('id', 'in', $flow['copy_uids'])->column('name');
|
||||
$data['copy_unames'] = implode(',', $copy_unames);
|
||||
}
|
||||
$data['flow_data'] = $flow_data;
|
||||
return to_assign(0, '', $data);
|
||||
}
|
||||
|
||||
//提交审批申请
|
||||
public function submit_check()
|
||||
{
|
||||
$param = get_params();
|
||||
$flow_cate = Db::name('FlowCate')->where(['name' => $param['check_name']])->find();
|
||||
$flow_list = Db::name('Flow')->where('id',$param['flow_id'])->value('flow_list');
|
||||
$flow = unserialize($flow_list);
|
||||
$subject = $flow_cate['title'];
|
||||
$check_table = $flow_cate['check_table'];
|
||||
//var_dump($flow);exit;
|
||||
//删除原来的审核流程和审核记录
|
||||
Db::name('FlowStep')->where(['action_id'=>$param['action_id'],'flow_id'=>$param['flow_id'],'delete_time'=>0])->update(['delete_time'=>time()]);
|
||||
Db::name('FlowRecord')->where(['action_id'=>$param['action_id'],'check_table'=>$check_table,'delete_time'=>0])->update(['delete_time'=>time()]);
|
||||
$recordData=array(
|
||||
'action_id' => $param['action_id'],
|
||||
'check_table' => $check_table,
|
||||
'step_id' => 0,
|
||||
'check_uid' => $this->uid,
|
||||
'flow_id' => $param['flow_id'],
|
||||
'check_time' => time(),
|
||||
'check_status' => 0,
|
||||
'content' => '提交申请',
|
||||
'create_time' => time()
|
||||
);
|
||||
if (!isset($param['check_uids'])) {
|
||||
//非自由审批模式
|
||||
$step=[];
|
||||
$sort=0;
|
||||
foreach ($flow as $key => &$value){
|
||||
if($value['check_role'] == 1){
|
||||
$value['check_uids'] = get_department_leader($this->uid);
|
||||
$value['flow_name'] = '当前部门负责人';
|
||||
$value['check_position_id']=0;
|
||||
}
|
||||
if($value['check_role'] == 2){
|
||||
$value['check_uids'] = get_department_leader($this->uid,1);
|
||||
$value['flow_name'] = '上级部门负责人';
|
||||
$value['check_position_id']=0;
|
||||
}
|
||||
if($value['check_role'] == 3){
|
||||
$check_position = Db::name('Position')->where('id',$value['check_position_id'])->value('title');
|
||||
$check_uids = Db::name('Admin')->where(['position_id'=>$value['check_position_id'],'status'=>1])->column('id');
|
||||
$value['check_uids'] = implode(',',$check_uids);
|
||||
$value['flow_name'] = $check_position;
|
||||
}
|
||||
if($value['check_role'] == 4){
|
||||
$value['flow_name'] = '指定人员';
|
||||
$value['check_position_id']=0;
|
||||
}
|
||||
if($value['check_role'] == 5){
|
||||
$value['flow_name'] = '指定人员';
|
||||
$value['check_position_id']=0;
|
||||
$value['check_types']=1;
|
||||
}
|
||||
if(!empty($value['check_uids'])){
|
||||
$step[]=[
|
||||
'action_id' => $param['action_id'],
|
||||
'flow_id' => $param['flow_id'],
|
||||
'flow_name' => $value['flow_name'],
|
||||
'check_position_id' => $value['check_position_id'],
|
||||
'check_role' => $value['check_role'],
|
||||
'check_types' => $value['check_types'],
|
||||
'check_uids' => $value['check_uids'],
|
||||
'create_time' => time(),
|
||||
'sort'=>$sort
|
||||
];
|
||||
$sort++;
|
||||
}
|
||||
}
|
||||
if(empty($step)){
|
||||
return to_assign(1,'审批流程设置有问题,无法提交审批申请,请联系HR或者管理员重新设置审批流程');
|
||||
}
|
||||
$res = Db::name('FlowStep')->strict(false)->field(true)->insertAll($step);
|
||||
if($res!=false){
|
||||
Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($recordData);
|
||||
Db::name($check_table)->strict(false)->field(true)->update([
|
||||
'id'=>$param['action_id'],
|
||||
'check_flow_id'=>$param['flow_id'],
|
||||
'check_status'=>1,
|
||||
'check_step_sort'=>0,
|
||||
'check_uids'=>$step[0]['check_uids'],
|
||||
'check_copy_uids'=>isset($param['check_copy_uids'])?$param['check_copy_uids']:''
|
||||
]);
|
||||
//发送消息通知
|
||||
if($flow_cate['template_id']>0){
|
||||
$msg=[
|
||||
'from_uid'=>$this->uid,//发送人
|
||||
'to_uids'=>$step[0]['check_uids'],//接收人
|
||||
'template_id'=>$flow_cate['template_id'],//消息模板ID
|
||||
'template_field'=>'0',//消息模板字段
|
||||
'content'=>[ //消息内容
|
||||
'create_time'=>date('Y-m-d H:i:s'),
|
||||
'action_id'=>$param['action_id'],
|
||||
'title' => $subject
|
||||
]
|
||||
];
|
||||
event('SendMessage',$msg);
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
else{
|
||||
return to_assign(1,'操作失败');
|
||||
}
|
||||
}
|
||||
else{
|
||||
//自由审批模式
|
||||
$flow_step = array(
|
||||
'action_id' => $param['action_id'],
|
||||
'flow_id' => $param['flow_id'],
|
||||
'flow_name' => '自由审批',
|
||||
'check_uids' => $param['check_uids'],
|
||||
'create_time' => time()
|
||||
);
|
||||
$res = Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step);
|
||||
if($res!=false){
|
||||
Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($recordData);
|
||||
Db::name($check_table)->strict(false)->field(true)->update([
|
||||
'id'=>$param['action_id'],
|
||||
'check_flow_id'=>$param['flow_id'],
|
||||
'check_status'=>1,
|
||||
'check_step_sort'=>0,
|
||||
'check_uids'=>$param['check_uids'],
|
||||
'check_copy_uids'=>isset($param['check_copy_uids'])?$param['check_copy_uids']:''
|
||||
]);
|
||||
//发送消息通知
|
||||
if($flow_cate['template_id']>0){
|
||||
$msg=[
|
||||
'from_uid'=>$this->uid,//发送人
|
||||
'to_uids'=>$param['check_uids'],//接收人
|
||||
'template_id'=>$flow_cate['template_id'],//消息模板ID
|
||||
'template_field'=>'0',//消息模板字段
|
||||
'content'=>[ //消息内容
|
||||
'create_time'=>date('Y-m-d H:i:s'),
|
||||
'action_id'=>$param['action_id'],
|
||||
'title' => $subject
|
||||
]
|
||||
];
|
||||
event('SendMessage',$msg);
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
else{
|
||||
return to_assign(1,'操作失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//获取审核流程节点
|
||||
public function get_flow_nodes($check_name='',$action_id=0,$flow_id=0)
|
||||
{
|
||||
$flow_cate = Db::name('FlowCate')->where(['name' => $check_name])->find();
|
||||
$did = $this->did;
|
||||
$map = [];
|
||||
$map[] = ['cate_id','=',$flow_cate['id']];
|
||||
$map[] = ['status','=',1];
|
||||
$map[] = ['delete_time','=',0];
|
||||
$map1=[
|
||||
['department_ids','=','']
|
||||
];
|
||||
$map2=[
|
||||
['', 'exp', Db::raw("FIND_IN_SET('{$did}',department_ids)")]
|
||||
];
|
||||
$whereOr =[$map1,$map2];
|
||||
if($action_id==0){
|
||||
$flow = Db::name('Flow')
|
||||
->where($map)
|
||||
->where(function ($query) use($whereOr) {
|
||||
if (!empty($whereOr)){
|
||||
$query->whereOr($whereOr);
|
||||
}
|
||||
})
|
||||
->select()->toArray();
|
||||
foreach ($flow as $k => &$v) {
|
||||
$v['is_copy'] = $flow_cate['is_copy'];
|
||||
}
|
||||
return to_assign(0, '', $flow);
|
||||
}
|
||||
$check_table = $flow_cate['check_table'];
|
||||
$detail = Db::name($check_table)->where('id',$action_id)->field('id,admin_id,check_status,check_flow_id,check_step_sort,check_uids,check_copy_uids')->find();
|
||||
//创建人
|
||||
$is_creater=0;
|
||||
if($detail['admin_id'] == $this->uid){
|
||||
$is_creater=1;
|
||||
}
|
||||
$detail['is_creater'] = $is_creater;
|
||||
$detail['admin_name'] = Db::name('Admin')->where('id',$detail['admin_id'])->value('name');
|
||||
//当前审批人
|
||||
$is_checker=0;
|
||||
if(in_array($this->uid,explode(',',$detail['check_uids']))){
|
||||
$is_checker=1;
|
||||
}
|
||||
$detail['is_checker'] = $is_checker;
|
||||
$detail['is_copy'] = $flow_cate['is_copy'];
|
||||
$detail['is_file'] = $flow_cate['is_file'];
|
||||
$detail['is_export'] = $flow_cate['is_export'];
|
||||
$detail['is_back'] = $flow_cate['is_back'];
|
||||
$detail['is_reversed'] = $flow_cate['is_reversed'];
|
||||
//审批记录
|
||||
$check_record = Db::name('FlowRecord')
|
||||
->field('f.*,a.name')
|
||||
->alias('f')
|
||||
->join('Admin a', 'a.id = f.check_uid', 'left')
|
||||
->where(['f.action_id' => $action_id,'f.check_table'=>$check_table])->select()->toArray();
|
||||
foreach ($check_record as $kk => &$vv) {
|
||||
$vv['check_time_str'] = date('Y-m-d H:i', $vv['check_time']);
|
||||
$vv['status_str'] = '提交';
|
||||
if($vv['check_status'] == 1){
|
||||
$vv['status_str'] = '审核通过';
|
||||
}
|
||||
else if($vv['check_status'] == 2){
|
||||
$vv['status_str'] = '审核拒绝';
|
||||
}
|
||||
if($vv['check_status'] == 3){
|
||||
$vv['status_str'] = '撤销';
|
||||
}
|
||||
if($vv['check_status'] == 4){
|
||||
$vv['status_str'] = '反确认';
|
||||
}
|
||||
if(!empty($vv['check_files'])){
|
||||
$file_array = Db::name('File')->where('id','in',$vv['check_files'])->select()->toArray();
|
||||
$vv['file_array'] = $file_array;
|
||||
}
|
||||
else{
|
||||
$vv['file_array'] = [];
|
||||
}
|
||||
}
|
||||
$detail['check_record'] = $check_record;
|
||||
if($detail['check_status']==0 || $detail['check_status']==4){
|
||||
//$flow = Db::name('Flow')->where(['cate_id' => $flow_cate['id'],'status'=>1,'delete_time'=>0])->select()->toArray();
|
||||
$flow = Db::name('Flow')
|
||||
->where($map)
|
||||
->where(function ($query) use($whereOr) {
|
||||
if (!empty($whereOr)){
|
||||
$query->whereOr($whereOr);
|
||||
}
|
||||
})
|
||||
->select()->toArray();
|
||||
$detail['flow'] = $flow;
|
||||
}
|
||||
else{
|
||||
//当前审批人
|
||||
$detail['check_unames']='-';
|
||||
if(!empty($detail['check_uids'])){
|
||||
$check_unames = Db::name('Admin')->where('id','in',$detail['check_uids'])->column('name');
|
||||
$detail['check_unames'] = implode(',',$check_unames);
|
||||
}
|
||||
//抄送人
|
||||
$detail['copy_unames']='-';
|
||||
if(!empty($detail['check_copy_uids'])){
|
||||
$copy_uids = Db::name('Admin')->where('id','in',$detail['check_copy_uids'])->column('name');
|
||||
$detail['copy_unames'] = implode(',',$copy_uids);
|
||||
}
|
||||
|
||||
//审批节点步骤
|
||||
$nodes = Db::name('FlowStep')->where(['action_id'=>$action_id,'flow_id'=>$flow_id,'delete_time'=>0])->order('sort asc')->select()->toArray();
|
||||
foreach ($nodes as $key => &$val) {
|
||||
$check_uids_info = Db::name('Admin')->field('id,name,thumb')->where('id','in',$val['check_uids'])->select()->toArray();
|
||||
foreach ($check_uids_info as $k => &$v) {
|
||||
$v['check_time'] = 0;
|
||||
$v['content'] = '';
|
||||
$v['check_status'] = 0;
|
||||
$check_array = Db::name('FlowRecord')->where(['check_uid' => $v['id'],'step_id' => $val['id']])->order('check_time desc')->select()->toArray();
|
||||
if(!empty($check_array)){
|
||||
$checked = $check_array[0];
|
||||
$v['check_time'] = date('Y-m-d H:i', $checked['check_time']);
|
||||
$v['content'] = $checked['content'];
|
||||
$v['check_status'] = $checked['check_status'];
|
||||
}
|
||||
}
|
||||
$val['check_uids_info'] = $check_uids_info;
|
||||
|
||||
if(!empty($val['check_position_id'])){
|
||||
$val['check_position'] = Db::name('Position')->where('id',$val['check_position_id'])->value('title');
|
||||
}
|
||||
else{
|
||||
$val['check_position'] = '';
|
||||
}
|
||||
|
||||
$check_list = [];
|
||||
foreach ($check_record as $kkk => $vvv) {
|
||||
if($vvv['step_id'] == $val['id'])
|
||||
$check_list[] = $vvv;
|
||||
}
|
||||
$val['check_list'] = $check_list;
|
||||
}
|
||||
$detail['nodes'] = $nodes;
|
||||
|
||||
//当前审核节点
|
||||
$step = Db::name('FlowStep')->where(['action_id'=>$action_id,'flow_id'=>$flow_id,'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find();
|
||||
$detail['step'] = $step;
|
||||
}
|
||||
return to_assign(0, '', $detail);
|
||||
}
|
||||
|
||||
//流程审核
|
||||
public function flow_check()
|
||||
{
|
||||
$param = get_params();
|
||||
$param['check_files'] = isset($param['check_files']) ? $param['check_files'] : '';
|
||||
$flow_cate = Db::name('FlowCate')->where(['name' => $param['check_name']])->find();
|
||||
$subject = $flow_cate['title'];
|
||||
$action_id = $param['action_id'];
|
||||
$check_table = $flow_cate['check_table'];
|
||||
$param['send_msg'] = 1;
|
||||
//审核内容详情
|
||||
$detail = Db::name($check_table)->where(['id' => $action_id])->find();
|
||||
if (empty($detail)){
|
||||
return to_assign(1,'审批数据错误');
|
||||
}
|
||||
//当前审核节点详情
|
||||
$step = Db::name('FlowStep')->where(['action_id'=>$action_id,'flow_id'=>$detail['check_flow_id'],'sort'=>$detail['check_step_sort'],'delete_time'=>0])->find();
|
||||
//审核通过时
|
||||
if($param['check'] == 1){
|
||||
$check_uids = explode(",",strval($detail['check_uids']));
|
||||
if (!in_array($this->uid, $check_uids)){
|
||||
return to_assign(1,'您没权限审核该审批');
|
||||
}
|
||||
//审批通过
|
||||
if($step['check_role'] == 0){
|
||||
//自由人审批
|
||||
if($param['check_node'] == 2){
|
||||
$next_step = $detail['check_step_sort']+1;
|
||||
$flow_step = array(
|
||||
'action_id' => $action_id,
|
||||
'sort' => $next_step,
|
||||
'flow_id' => $detail['check_flow_id'],
|
||||
'check_uids' => $param['check_uids'],
|
||||
'create_time' => time()
|
||||
);
|
||||
$fid = Db::name('FlowStep')->strict(false)->field(true)->insertGetId($flow_step);
|
||||
//下一步审核步骤
|
||||
$param['check_step_sort'] = $next_step;
|
||||
$param['check_status'] = 1;
|
||||
}
|
||||
else{
|
||||
//不存在下一步审核,审核结束
|
||||
$param['check_status'] = 2;
|
||||
$param['check_uids'] ='';
|
||||
}
|
||||
}
|
||||
else{
|
||||
//查询当前步骤审批记录数
|
||||
$check_count = Db::name('FlowRecord')->where(['action_id'=>$action_id,'flow_id'=>$detail['check_flow_id'],'step_id'=>$step['id']])->count();
|
||||
//当前当前步骤审批应有记录数
|
||||
$flow_count = explode(',', $step['check_uids']);
|
||||
$param['check_status'] = 1;
|
||||
$uids_array = explode(',',$detail['check_uids']);
|
||||
$new_uids= array_diff($uids_array, [$this->uid]);
|
||||
$param['check_uids'] = implode(',',$new_uids);
|
||||
if((($check_count+1) >= count($flow_count) && $step['check_types']==1) || $step['check_types']==2){
|
||||
//会签
|
||||
$next_step = Db::name('FlowStep')->where(['action_id'=>$action_id,'flow_id'=>$detail['check_flow_id'],'sort'=>($detail['check_step_sort']+1),'delete_time'=>0])->find();
|
||||
if($next_step){
|
||||
//存在下一步审核
|
||||
if($next_step['check_role'] == 1){
|
||||
$param['check_uids'] = get_department_leader($detail['admin_id']);
|
||||
}
|
||||
else if($next_step['check_role'] == 2){
|
||||
$param['check_uids'] = get_department_leader($detail['admin_id'],1);
|
||||
}
|
||||
else if($next_step['check_role'] == 3){
|
||||
$uids = Db::name('Admin')->where(['position_id'=>$next_step['check_position_id'],'status'=>1])->column('id');
|
||||
$param['check_uids'] = implode(',' ,$uids);
|
||||
}
|
||||
else{
|
||||
$param['check_uids'] = $next_step['check_uids'];
|
||||
}
|
||||
$param['check_step_sort'] = $detail['check_step_sort']+1;
|
||||
$param['check_status'] = 1;
|
||||
}
|
||||
else{
|
||||
//不存在下一步审核,审核结束
|
||||
$param['check_status'] = 2;
|
||||
$param['check_uids'] ='';
|
||||
}
|
||||
}
|
||||
else{
|
||||
$param['send_msg'] = 0;
|
||||
}
|
||||
}
|
||||
if($param['check_status'] == 1 && empty($param['check_uids'])){
|
||||
return to_assign(1,'找不到下一步的审批人,该审批流程设置有问题,请联系HR或者管理员');
|
||||
}
|
||||
//添加历史审核人
|
||||
if(empty($detail['check_history_uids'])){
|
||||
$param['check_history_uids'] = $this->uid;
|
||||
}
|
||||
else{
|
||||
$param['check_history_uids'] = $detail['check_history_uids'].','.$this->uid;
|
||||
}
|
||||
$res = Db::name($check_table)->strict(false)->field('check_step_sort,check_status,check_history_uids,check_uids')->where(['id' => $action_id])->update($param);
|
||||
|
||||
if($res!==false){
|
||||
$checkData=array(
|
||||
'action_id' => $action_id,
|
||||
'check_table' => $check_table,
|
||||
'step_id' => $step['id'],
|
||||
'check_uid' => $this->uid,
|
||||
'flow_id' => $detail['check_flow_id'],
|
||||
'check_time' => time(),
|
||||
'check_files' => $param['check_files'],
|
||||
'check_status' => $param['check'],
|
||||
'content' => $param['content'],
|
||||
'create_time' => time()
|
||||
);
|
||||
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
|
||||
add_log('check', $action_id, $param,$subject);
|
||||
//发送消息通知
|
||||
if($param['check_status'] == 1){
|
||||
if($flow_cate['template_id']>0 && $param['send_msg']==1){
|
||||
$msg=[
|
||||
'from_uid'=>$detail['admin_id'],//发送人
|
||||
'to_uids'=>$param['check_uids'],//接收人
|
||||
'template_id'=>$flow_cate['template_id'],//消息模板ID
|
||||
'template_field'=>'0',//消息模板字段,审批中
|
||||
'content'=>[ //消息内容
|
||||
'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
|
||||
'action_id'=>$action_id,
|
||||
'title' => $subject
|
||||
]
|
||||
];
|
||||
event('SendMessage',$msg);
|
||||
}
|
||||
}
|
||||
if($param['check_status'] == 2){
|
||||
if($flow_cate['template_id']>0){
|
||||
$msg=[
|
||||
'from_uid'=>$this->uid,//发送人
|
||||
'to_uids'=>$detail['admin_id'],//接收人
|
||||
'template_id'=>$flow_cate['template_id'],//消息模板ID
|
||||
'template_field'=>'1',//消息模板字段,审核通过
|
||||
'content'=>[ //消息内容
|
||||
'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
|
||||
'action_id'=>$action_id,
|
||||
'title' => $subject
|
||||
]
|
||||
];
|
||||
event('SendMessage',$msg);
|
||||
|
||||
if(!empty($detail['check_copy_uids'])){
|
||||
$msgs=[
|
||||
'from_uid'=>$detail['admin_id'],//发送人
|
||||
'to_uids'=>$detail['check_copy_uids'],//接收人
|
||||
'template_id'=>$flow_cate['template_id'],//消息模板ID
|
||||
'template_field'=>'3',//消息模板字段,审核通过抄送人接收
|
||||
'content'=>[ //消息内容
|
||||
'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
|
||||
'action_id'=>$action_id,
|
||||
'title' => $subject
|
||||
]
|
||||
];
|
||||
event('SendMessage',$msgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
return to_assign(0,'操作成功',['check_status'=>$param['check_status']]);
|
||||
}
|
||||
else{
|
||||
return to_assign(1,'操作失败');
|
||||
}
|
||||
}
|
||||
//审批拒绝
|
||||
else if($param['check'] == 2){
|
||||
$check_uids = explode(",",strval($detail['check_uids']));
|
||||
if (!in_array($this->uid, $check_uids)){
|
||||
return to_assign(1,'您没权限审核该审批');
|
||||
}
|
||||
//拒绝审核,数据操作
|
||||
$param['check_status'] = 3;
|
||||
//添加历史审核人
|
||||
if(empty($detail['check_history_uids'])){
|
||||
$param['check_history_uids'] = $this->uid;
|
||||
}
|
||||
else{
|
||||
$param['check_history_uids'] = $detail['check_history_uids'].','.$this->uid;
|
||||
}
|
||||
$param['check_uids'] ='';
|
||||
if($step['check_role'] == 5){
|
||||
//获取上一步的审核信息
|
||||
$prev_step = Db::name('FlowStep')->where(['action_id'=>$action_id,'flow_id'=>$detail['check_flow_id'],'sort'=>($detail['check_step_sort']-1),'delete_time'=>0])->find();
|
||||
if($prev_step){
|
||||
//存在上一步审核
|
||||
$param['check_step_sort'] = $prev_step['sort'];
|
||||
$param['check_uids'] = $prev_step['check_uids'];
|
||||
$param['check_status'] = 1;
|
||||
}
|
||||
else{
|
||||
//不存在上一步审核,审核初始化步骤
|
||||
$param['check_step_sort'] = 0;
|
||||
$param['check_uids'] = '';
|
||||
$param['check_status'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$res = Db::name($check_table)->strict(false)->field('check_step_sort,check_status,check_history_uids,check_uids')->where(['id' => $action_id])->update($param);
|
||||
if($res!==false){
|
||||
$checkData=array(
|
||||
'action_id' => $action_id,
|
||||
'check_table' => $check_table,
|
||||
'step_id' => $step['id'],
|
||||
'check_uid' => $this->uid,
|
||||
'flow_id' => $detail['check_flow_id'],
|
||||
'check_time' => time(),
|
||||
'check_status' => $param['check'],
|
||||
'check_files' => $param['check_files'],
|
||||
'content' => $param['content'],
|
||||
'create_time' => time()
|
||||
);
|
||||
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
|
||||
add_log('refue', $action_id, $param,$subject);
|
||||
//发送消息通知
|
||||
if($flow_cate['template_id']>0){
|
||||
$msg=[
|
||||
'from_uid'=>$this->uid,//发送人
|
||||
'to_uids'=>$detail['admin_id'],//接收人
|
||||
'template_id'=>$flow_cate['template_id'],//消息模板ID
|
||||
'template_field'=>'2',//消息模板字段,审核拒绝
|
||||
'content'=>[ //消息内容
|
||||
'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
|
||||
'action_id'=>$detail['id'],
|
||||
'title' => $subject
|
||||
]
|
||||
];
|
||||
event('SendMessage',$msg);
|
||||
}
|
||||
return to_assign(0,'操作成功',['check_status'=>$param['check_status']]);
|
||||
}
|
||||
else{
|
||||
return to_assign(1,'操作失败');
|
||||
}
|
||||
}
|
||||
else if($param['check'] == 3){
|
||||
//审批撤回
|
||||
if($detail['admin_id'] != $this->uid){
|
||||
return to_assign(1,'你没权限操作');
|
||||
}
|
||||
//撤销审核,数据操作
|
||||
$param['check_status'] = 4;
|
||||
$param['check_uids'] ='';
|
||||
$param['check_step_sort'] =0;
|
||||
|
||||
$res = Db::name($check_table)->strict(false)->field('check_step_sort,check_status,check_uids')->where(['id' => $action_id])->update($param);
|
||||
if($res!==false){
|
||||
$checkData=array(
|
||||
'action_id' => $action_id,
|
||||
'check_table' => $check_table,
|
||||
'step_id' => $step['id'],
|
||||
'check_uid' => $this->uid,
|
||||
'flow_id' => $detail['check_flow_id'],
|
||||
'check_time' => time(),
|
||||
'check_status' => $param['check'],
|
||||
'content' => $param['content'],
|
||||
'create_time' => time()
|
||||
);
|
||||
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
|
||||
add_log('back', $action_id, $param,$subject);
|
||||
return to_assign(0,'操作成功',['check_status'=>$param['check_status']]);
|
||||
}else{
|
||||
return to_assign(1,'操作失败');
|
||||
}
|
||||
}
|
||||
else if($param['check'] == 4){
|
||||
//审批反确认
|
||||
//反确认审核,数据回到待提交审批
|
||||
$param['check_status'] = 0;
|
||||
$param['check_uids'] ='';
|
||||
$param['check_step_sort'] =0;
|
||||
|
||||
$res = Db::name($check_table)->strict(false)->field('check_step_sort,check_status,check_uids')->where(['id' => $action_id])->update($param);
|
||||
if($res!==false){
|
||||
$checkData=array(
|
||||
'action_id' => $action_id,
|
||||
'check_table' => $check_table,
|
||||
'step_id' => $step['id'],
|
||||
'check_uid' => $this->uid,
|
||||
'flow_id' => $detail['check_flow_id'],
|
||||
'check_time' => time(),
|
||||
'check_status' => 4,
|
||||
'content' => $param['content'],
|
||||
'create_time' => time()
|
||||
);
|
||||
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
|
||||
add_log('back', $action_id, $param,$subject);
|
||||
return to_assign(0,'操作成功',['check_status'=>0]);
|
||||
}else{
|
||||
return to_assign(1,'操作失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
declare (strict_types = 1);
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\BaseController;
|
||||
use think\facade\Db;
|
||||
use app\api\model\Comment as CommentModel;
|
||||
class Comment extends BaseController
|
||||
{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
protected $model;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(); // 调用父类构造函数
|
||||
$this->model = new CommentModel();
|
||||
}
|
||||
|
||||
//获取评论列表
|
||||
public function datalist()
|
||||
{
|
||||
$param = get_params();
|
||||
$param['admin_id'] = $this->uid;
|
||||
$where=[];
|
||||
if (!empty($param['module'])) {
|
||||
$where[] = ['module', '=', $param['module']];
|
||||
}
|
||||
if (!empty($param['topic_id'])) {
|
||||
$where['topic_id'] = $param['topic_id'];
|
||||
}
|
||||
$where[] = ['delete_time', '=', 0];
|
||||
$list = $this->model->datalist($param,$where);
|
||||
$total = Db::name('Comment')->where($where)->count();
|
||||
$totalRow['total'] = $total;
|
||||
return table_assign(0, '', $list,$totalRow);
|
||||
}
|
||||
|
||||
//添加修改评论内容
|
||||
public function add()
|
||||
{
|
||||
$param = get_params();
|
||||
if (!empty($param['id']) && $param['id'] > 0) {
|
||||
$param['update_time'] = time();
|
||||
unset($param['pid']);
|
||||
unset($param['padmin_id']);
|
||||
$res = CommentModel::where(['admin_id' => $this->uid,'id'=>$param['id']])->strict(false)->field(true)->update($param);
|
||||
if ($res!==false) {
|
||||
add_log('edit', $param['id'], $param,'评论');
|
||||
return to_assign();
|
||||
}
|
||||
} else {
|
||||
$param['create_time'] = time();
|
||||
$param['admin_id'] = $this->uid;
|
||||
$insertId = CommentModel::strict(false)->field(true)->insertGetId($param);
|
||||
if ($insertId) {
|
||||
add_log('add', $insertId, $param,'评论');
|
||||
return to_assign();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//设为已读评论内容
|
||||
public function view()
|
||||
{
|
||||
if (request()->isPost()) {
|
||||
$id = get_params("id");
|
||||
$res = Db::name('CommentRead')->strict(false)->field(true)->insertGetId(['comment_id'=>$id,'admin_id'=>$this->uid,'create_time'=>time()]);
|
||||
if ($res!==false) {
|
||||
add_log('view', $id,[],'评论');
|
||||
return to_assign(0, "操作成功");
|
||||
} else {
|
||||
return to_assign(1, "操作失败");
|
||||
}
|
||||
}else{
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
|
||||
//删除评论内容
|
||||
public function del()
|
||||
{
|
||||
if (request()->isDelete()) {
|
||||
$id = get_params("id");
|
||||
$res = CommentModel::where('id',$id)->strict(false)->field(true)->update(['delete_time'=>time()]);
|
||||
if ($res) {
|
||||
add_log('delete', $id,[],'评论');
|
||||
return to_assign(0, "删除成功");
|
||||
} else {
|
||||
return to_assign(1, "删除失败");
|
||||
}
|
||||
}else{
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\BaseController;
|
||||
use app\api\middleware\Auth;
|
||||
use Firebase\JWT\JWT;
|
||||
use Firebase\JWT\Key;
|
||||
use think\facade\Db;
|
||||
use think\facade\Request;
|
||||
|
||||
class Demo extends BaseController
|
||||
{
|
||||
/**
|
||||
* 控制器中间件 [登录、注册 不需要鉴权]
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
Auth::class => ['except' => ['index','login'] ]
|
||||
];
|
||||
|
||||
/**
|
||||
* @param $user_id
|
||||
* @return string
|
||||
*/
|
||||
public function getToken($user_id){
|
||||
$time = time(); //当前时间
|
||||
$conf = $this->jwt_conf;
|
||||
$token = [
|
||||
'iss' => $conf['iss'], //签发者 可选
|
||||
'aud' => $conf['aud'], //接收该JWT的一方,可选
|
||||
'iat' => $time, //签发时间
|
||||
'nbf' => $time-1 , //(Not Before):某个时间点后才能访问,比如设置time+30,表示当前时间30秒后才能使用
|
||||
'exp' => $time+$conf['exptime'], //过期时间,这里设置2个小时
|
||||
'data' => [
|
||||
//自定义信息,不要定义敏感信息
|
||||
'userid' =>$user_id,
|
||||
]
|
||||
];
|
||||
return JWT::encode($token, $conf['secrect'], 'HS256'); //输出Token 默认'HS256'
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $token
|
||||
*/
|
||||
public static function checkToken($token){
|
||||
try {
|
||||
JWT::$leeway = 60;//当前时间减去60,把时间留点余地
|
||||
$decoded = JWT::decode($token, self::$config['secrect'], ['HS256']); //HS256方式,这里要和签发的时候对应
|
||||
return (array)$decoded;
|
||||
} catch(\Firebase\JWT\SignatureInvalidException $e) { //签名不正确
|
||||
return json(['code'=>403,'msg'=>'签名错误']);
|
||||
}catch(\Firebase\JWT\BeforeValidException $e) { // 签名在某个时间点之后才能用
|
||||
return json(['code'=>401,'msg'=>'token失效']);
|
||||
}catch(\Firebase\JWT\ExpiredException $e) { // token过期
|
||||
return json(['code'=>401,'msg'=>'token已过期']);
|
||||
}catch(Exception $e) { //其他错误
|
||||
return json(['code'=>404,'msg'=>'非法请求']);
|
||||
}catch(\UnexpectedValueException $e) { //其他错误
|
||||
return json(['code'=>404,'msg'=>'非法请求']);
|
||||
} catch(\DomainException $e) { //其他错误
|
||||
return json(['code'=>404,'msg'=>'非法请求']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @api {post} /demo/login 会员登录
|
||||
* @apiDescription 系统登录接口,返回 token 用于操作需验证身份的接口
|
||||
|
||||
* @apiParam (请求参数:) {string} username 登录用户名
|
||||
* @apiParam (请求参数:) {string} password 登录密码
|
||||
|
||||
* @apiParam (响应字段:) {string} token Token
|
||||
|
||||
* @apiSuccessExample {json} 成功示例
|
||||
* {"code":0,"msg":"登录成功","time":1627374739,"data":{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuZ291Z3VjbXMuY29tIiwiYXVkIjoiZ291Z3VjbXMiLCJpYXQiOjE2MjczNzQ3MzksImV4cCI6MTYyNzM3ODMzOSwidWlkIjoxfQ.gjYMtCIwKKY7AalFTlwB2ZVWULxiQpsGvrz5I5t2qTs"}}
|
||||
* @apiErrorExample {json} 失败示例
|
||||
* {"code":1,"msg":"帐号或密码错误","time":1627374820,"data":[]}
|
||||
*/
|
||||
|
||||
public function login()
|
||||
{
|
||||
$param = get_params();
|
||||
if (empty($param['username']) || empty($param['password'])) {
|
||||
$this->apiError('参数错误');
|
||||
}
|
||||
// 校验用户名密码
|
||||
$user = Db::name('Admin')->where(['username' => $param['username']])->find();
|
||||
if (empty($user)) {
|
||||
$this->apiError('帐号或密码错误');
|
||||
}
|
||||
$param['pwd'] = set_password($param['password'], $user['salt']);
|
||||
if ($param['pwd'] !== $user['pwd']) {
|
||||
$this->apiError('帐号或密码错误');
|
||||
}
|
||||
if ($user['status'] == -1) {
|
||||
$this->apiError('该用户禁止登录,请于平台联系');
|
||||
}
|
||||
$data = [
|
||||
'last_login_time' => time(),
|
||||
'last_login_ip' => request()->ip(),
|
||||
'login_num' => $user['login_num'] + 1,
|
||||
];
|
||||
$res = Db::name('Admin')->where(['id' => $user['id']])->update($data);
|
||||
if ($res) {
|
||||
$token = self::getToken($user['id']);
|
||||
$this->apiSuccess('登录成功', ['token' => $token]);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @api {post} /index/demo 测试页面
|
||||
* @apiDescription 返回文章列表信息
|
||||
|
||||
* @apiParam (请求参数:) {string} token Token
|
||||
|
||||
* @apiSuccessExample {json} 响应数据样例
|
||||
* {"code":1,"msg":"","time":1563517637,"data":{"id":13,"email":"test110@qq.com","password":"e10adc3949ba59abbe56e057f20f883e","sex":1,"last_login_time":1563517503,"last_login_ip":"127.0.0.1","qq":"123455","mobile":"","mobile_validated":0,"email_validated":0,"type_id":1,"status":1,"create_ip":"127.0.0.1","update_time":1563507130,"create_time":1563503991,"type_name":"注册会员"}}
|
||||
*/
|
||||
public function test(Request $request)
|
||||
{
|
||||
$uid = JWT_UID;
|
||||
$userInfo = Db::name('Admin')->where(['id' => $uid])->find();
|
||||
$this->apiSuccess('请求成功', ['user' => $userInfo]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,317 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2025 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
declare (strict_types = 1);
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\BaseController;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
use Mpdf\Mpdf;
|
||||
use PhpOffice\PhpWord\TemplateProcessor;
|
||||
use app\adm\model\MeetingRecords;
|
||||
use app\adm\model\MeetingOrder;
|
||||
use app\home\model\Leaves;
|
||||
use app\home\model\Trips;
|
||||
use app\home\model\Outs;
|
||||
use app\adm\model\Seal;
|
||||
use app\user\model\PersonalQuit;
|
||||
use app\user\model\DepartmentChange;
|
||||
use app\user\model\Talent;
|
||||
use app\adm\model\OfficialDocs;
|
||||
use app\finance\model\Loan;
|
||||
use app\finance\model\Expense;
|
||||
use app\finance\model\Invoice;
|
||||
use app\finance\model\Ticket;
|
||||
use app\contract\model\Contract;
|
||||
use app\contract\model\Purchase;
|
||||
|
||||
class Export extends BaseController
|
||||
{
|
||||
public function pdf($types='',$id=0)
|
||||
{
|
||||
$name='PDF文件';
|
||||
$is_header=true;
|
||||
$check_record=true;
|
||||
$is_page=false;
|
||||
$logo = CMS_ROOT.'public/static/home/images/logo.png';
|
||||
//请假审批
|
||||
if($types=='leaves'){
|
||||
$model = new Leaves();
|
||||
$detail= $model->getById($id);
|
||||
$detail['types_name'] = leaves_types_name($detail['types']);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的请假审批单';
|
||||
}
|
||||
//出差审批
|
||||
if($types=='trips'){
|
||||
$model = new Trips();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的出差审批单';
|
||||
}
|
||||
//外出审批
|
||||
if($types=='outs'){
|
||||
$model = new Outs();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的外出审批单';
|
||||
}
|
||||
//加班审批
|
||||
if($types=='overtimes'){
|
||||
$model = new Outs();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的加班审批单';
|
||||
}
|
||||
//用印审批
|
||||
if($types=='seal'){
|
||||
$model = new Seal();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的用章审批单';
|
||||
}
|
||||
//离职审批
|
||||
if($types=='personal_quit'){
|
||||
$model = new PersonalQuit();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的离职审批单';
|
||||
}
|
||||
//人事调动审批单
|
||||
if($types=='department_change'){
|
||||
$model = new DepartmentChange();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的人事调动审批单';
|
||||
}
|
||||
//入职审批单
|
||||
if($types=='talent'){
|
||||
$model = new Talent();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的入职审批单';
|
||||
}
|
||||
//公文审批
|
||||
if($types=='official_docs'){
|
||||
$model = new OfficialDocs();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的公文审批单';
|
||||
}
|
||||
//借支审批
|
||||
if($types=='loan'){
|
||||
$model = new Loan();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的借支审批单';
|
||||
}
|
||||
//报销审批
|
||||
if($types=='expense'){
|
||||
$model = new Expense();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的报销审批单';
|
||||
}
|
||||
//开票回款
|
||||
if($types=='invoice'){
|
||||
$model = new Invoice();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的发票开票审批单';
|
||||
}
|
||||
//无票回款
|
||||
if($types=='invoicea'){
|
||||
$model = new Invoice();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的无发票回款审批单';
|
||||
}
|
||||
//收票付款
|
||||
if($types=='ticket'){
|
||||
$model = new Ticket();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的收票审批单';
|
||||
}
|
||||
//无发票付款单
|
||||
if($types=='ticketa'){
|
||||
$model = new Ticket();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的无发票付款审批单';
|
||||
}
|
||||
//销售合同
|
||||
if($types=='contract'){
|
||||
$model = new Contract();
|
||||
$detail= $model->getById($id);
|
||||
$detail['cate_title'] = Db::name('ContractCate')->where(['id' => $detail['cate_id']])->value('title');
|
||||
$detail['subject_title'] = Db::name('Enterprise')->where(['id' => $detail['subject_id']])->value('title');
|
||||
$detail['department'] = $detail['sign_department'];
|
||||
$detail['content_array'] = unserialize($detail['content']);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的销售合同审批单';
|
||||
}
|
||||
//采购合同
|
||||
if($types=='purchase'){
|
||||
$model = new Purchase();
|
||||
$detail= $model->getById($id);
|
||||
$detail['cate_title'] = Db::name('ContractCate')->where(['id' => $detail['cate_id']])->value('title');
|
||||
$detail['subject_title'] = Db::name('Enterprise')->where(['id' => $detail['subject_id']])->value('title');
|
||||
$detail['department'] = $detail['sign_department'];
|
||||
$detail['content_array'] = unserialize($detail['content']);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的采购合同审批单';
|
||||
}
|
||||
//会议记录
|
||||
if($types=='meeting'){
|
||||
$model = new MeetingRecords();
|
||||
$detail= $model->getById($id);
|
||||
$name = date('Ymd',$detail['meeting_date']).$detail['did_name'].'_会议纪要';
|
||||
$check_record=false;
|
||||
}
|
||||
//会议室预定
|
||||
if($types=='meeting_order'){
|
||||
$model = new MeetingOrder();
|
||||
$detail= $model->getById($id);
|
||||
$name = to_date($detail['create_time'],'Ymd').$detail['admin_name'].'提交的会议室预定';
|
||||
}
|
||||
//员工档案
|
||||
if($types=='files'){
|
||||
$detail = get_admin($id);
|
||||
$detail['pname'] = Db::name('Admin')->where('id',$detail['pid'])->value('name');
|
||||
$detail['position'] = Db::name('Position')->where('id',$detail['position_id'])->value('title');
|
||||
$detail['department'] = Db::name('Department')->where('id',$detail['did'])->value('title');
|
||||
$department_ids = Db::name('DepartmentAdmin')->where('admin_id',$id)->column('department_id');
|
||||
$department_names = Db::name('Department')->whereIn('id',$department_ids)->column('title');
|
||||
$detail['department_names'] = implode(',',$department_names);
|
||||
if($detail['file_ids'] !=''){
|
||||
$file_array = Db::name('File')->where('id','in',$detail['file_ids'])->select();
|
||||
$detail['file_array'] = $file_array;
|
||||
}
|
||||
$edu = Db::name('AdminProfiles')->where(['types'=>1,'admin_id'=>$id,'delete_time'=>0])->select()->toArray();
|
||||
$work = Db::name('AdminProfiles')->where(['types'=>2,'admin_id'=>$id,'delete_time'=>0])->select()->toArray();
|
||||
$certificate = Db::name('AdminProfiles')->where(['types'=>3,'admin_id'=>$id,'delete_time'=>0])->select()->toArray();
|
||||
$skills = Db::name('AdminProfiles')->where(['types'=>4,'admin_id'=>$id,'delete_time'=>0])->select()->toArray();
|
||||
$language = Db::name('AdminProfiles')->where(['types'=>5,'admin_id'=>$id,'delete_time'=>0])->select()->toArray();
|
||||
View::assign('edu', $edu);
|
||||
View::assign('work', $work);
|
||||
View::assign('skills', $skills);
|
||||
View::assign('certificate', $certificate);
|
||||
View::assign('language', $language);
|
||||
View::assign('detail', $detail);
|
||||
$name = $detail['name'].'_档案信息';
|
||||
$check_record=false;
|
||||
$is_page=true;
|
||||
}
|
||||
|
||||
if($check_record){
|
||||
if(!empty($detail['check_copy_uids'])){
|
||||
$check_copy_names = Db::name('Admin')->where([['id','in',$detail['check_copy_uids']],['status','=',1]])->column('name');
|
||||
$detail['check_copy_names'] = implode(',',$check_copy_names);
|
||||
}
|
||||
$detail['check_status_str'] = check_status_name($detail['check_status']);
|
||||
//审批记录
|
||||
$check_table = $types;
|
||||
if($types=='invoicea'){
|
||||
$check_table = 'invoice';
|
||||
}
|
||||
if($types=='ticketa'){
|
||||
$check_table = 'ticket';
|
||||
}
|
||||
$check_record_array = Db::name('FlowRecord')
|
||||
->field('f.*,a.name')
|
||||
->alias('f')
|
||||
->join('Admin a', 'a.id = f.check_uid', 'left')
|
||||
->where([['f.action_id','=',$id],['f.check_table','=',$check_table],['f.delete_time','=',0],['f.step_id','>',0]])->select()->toArray();
|
||||
foreach ($check_record_array as $kk => &$vv) {
|
||||
$vv['check_time_str'] = date('Y-m-d H:i', $vv['check_time']);
|
||||
$vv['status_str'] = '提交';
|
||||
if($vv['check_status'] == 1){
|
||||
$vv['status_str'] = '审核通过';
|
||||
}
|
||||
else if($vv['check_status'] == 2){
|
||||
$vv['status_str'] = '审核拒绝';
|
||||
}
|
||||
if($vv['check_status'] == 3){
|
||||
$vv['status_str'] = '撤销';
|
||||
}
|
||||
if($vv['check_status'] == 4){
|
||||
$vv['status_str'] = '反确认';
|
||||
}
|
||||
}
|
||||
$detail['check_record_array'] = $check_record_array;
|
||||
}
|
||||
|
||||
$detail['pdf_admin'] = Db::name('Admin')->where([['id','=',$this->uid]])->value('name');
|
||||
$detail['pdf_time'] = date('Y-m-d H:i:s');
|
||||
//var_dump($detail);exit;
|
||||
View::assign('detail', $detail);
|
||||
View::assign('logo', $logo);
|
||||
$html = View::fetch($types);
|
||||
$time = time();
|
||||
//tempDir指定临时文件目录,需要有可写入的权限,否则会报错
|
||||
$mpdf = new Mpdf([
|
||||
'mode'=>'zh',//或者utf-8
|
||||
'format' => 'A4',
|
||||
'margin_top'=>23,
|
||||
'margin_bottom'=>19,
|
||||
//重新定义字体路径
|
||||
'fontDir' => [
|
||||
CMS_ROOT . "public/static/font/"
|
||||
],
|
||||
//重新定义默认字体
|
||||
'fontdata' => [
|
||||
"sun-exta" => [
|
||||
'R' => 'MiSans-Regular.ttf', // regular font
|
||||
'B' => 'MiSans-Bold.ttf', // optional: bold font
|
||||
'I' => 'MiSans-Regular.ttf', // optional: italic font
|
||||
'BI' => 'MiSans-Bold.ttf', // optional: bold-italic font
|
||||
'useKashida' => 75,
|
||||
'sip-ext' => 'MiSans-Regular.ttf', /* SIP=Plane2 Unicode (extension B) */
|
||||
]
|
||||
],
|
||||
'tempDir' => CMS_ROOT . "public/storage/pdf/"
|
||||
]);
|
||||
$mpdf->SetDisplayMode('fullpage');
|
||||
//自动分析录入内容字体
|
||||
$mpdf->autoScriptToLang = true;
|
||||
$mpdf->autoLangToFont = true;
|
||||
//文件名称
|
||||
$filename = $name."_".$time.".pdf";
|
||||
//文章pdf文件存储路径
|
||||
$path = CMS_ROOT . "public" . "/storage/pdf/".$filename;
|
||||
$pageNumber = count($mpdf->pages);
|
||||
$header= '<table width="100%" style="margin:0;padding:0"><tr>
|
||||
<td width="50%" style="text-align:left;font-size:12px; color:#999999;margin:0;padding:0"><img src="'.$logo.'" height="36" /></td>
|
||||
<td width="50%" style="text-align:right;font-size:12px; color:#999999;margin:0;padding:0">勾股OA办公系统</td>
|
||||
</tr></table><hr style="border-color:#f1f1f1;margin:0">';
|
||||
$page= '<p style="text-align:center;font-size:12px; color:#999999">第 {PAGENO}/{nbpg} 页</p>';
|
||||
if($is_header){
|
||||
$mpdf->SetHTMLHeader($header);
|
||||
}
|
||||
if($is_page){
|
||||
$mpdf->SetHTMLFooter($page);
|
||||
}
|
||||
//以html为标准分析写入内容
|
||||
$mpdf->WriteHTML($html);
|
||||
//直接下载文件
|
||||
$mpdf->Output('tmp.pdf',true);
|
||||
$mpdf->Output($filename,"d");
|
||||
exit;
|
||||
/*
|
||||
//生成磁盘文件
|
||||
$mpdf->Output($path);
|
||||
if($type==0){
|
||||
//下载文件
|
||||
if (is_file($path)){
|
||||
//return to_assign(0,"文件生成成功");
|
||||
$file = fopen($path, "rb");
|
||||
Header( "Content-type: application/octet-stream ");
|
||||
Header( "Accept-Ranges: bytes ");
|
||||
Header( "Content-Disposition: attachment; filename= $filename");
|
||||
while (!feof($file)) {
|
||||
echo fread($file, 8192);
|
||||
ob_flush();
|
||||
flush();
|
||||
}
|
||||
fclose($file);
|
||||
} else {
|
||||
return to_assign(1,"文件生成失败");
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,379 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\BaseController;
|
||||
use think\facade\Db;
|
||||
use app\user\model\Admin;
|
||||
use app\customer\model\Customer;
|
||||
use avatars\MDAvatars;
|
||||
use Overtrue\Pinyin\Pinyin;
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Date as Shared;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
|
||||
|
||||
class Import extends BaseController
|
||||
{
|
||||
//生成头像
|
||||
public function to_avatars($char)
|
||||
{
|
||||
$defaultData = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'S', 'Y', 'Z',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
'零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖', '拾',
|
||||
'一', '二', '三', '四', '五', '六', '七', '八', '九', '十');
|
||||
if (isset($char)) {
|
||||
$Char = $char;
|
||||
} else {
|
||||
$Char = $defaultData[mt_rand(0, count($defaultData) - 1)];
|
||||
}
|
||||
$OutputSize = min(512, empty($_GET['size']) ? 36 : intval($_GET['size']));
|
||||
|
||||
$Avatar = new MDAvatars($Char, 256, 1);
|
||||
$avatar_name = '/avatars/avatar_256_' . set_salt(10) . time() . '.png';
|
||||
$path = get_config('filesystem.disks.public.url') . $avatar_name;
|
||||
$res = $Avatar->Save('.' . $path, 256);
|
||||
$Avatar->Free();
|
||||
return $path;
|
||||
}
|
||||
|
||||
//登录名校验
|
||||
public function check_name($name,$arr)
|
||||
{
|
||||
if(in_array($name,$arr)){
|
||||
$name = $this->check_name($name.'1',$arr);
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
|
||||
//导入员工
|
||||
public function import_admin(){
|
||||
// 获取表单上传文件
|
||||
$file[]= request()->file('file');
|
||||
if($this->uid>1){
|
||||
return to_assign(1,'该操作只能是超级管理员有权限操作');
|
||||
}
|
||||
try {
|
||||
// 验证文件大小,名称等是否正确
|
||||
validate(['file' => 'filesize:51200|fileExt:xls,xlsx'])->check($file);
|
||||
// 日期前綴
|
||||
$dataPath = date('Ym');
|
||||
$md5 = $file[0]->hash('md5');
|
||||
$savename = \think\facade\Filesystem::disk('public')->putFile($dataPath, $file[0], function () use ($md5) {
|
||||
return $md5;
|
||||
});
|
||||
$fileExtendName = substr(strrchr($savename, '.'), 1);
|
||||
// 有Xls和Xlsx格式两种
|
||||
if ($fileExtendName == 'xlsx') {
|
||||
$objReader = IOFactory::createReader('Xlsx');
|
||||
} else {
|
||||
$objReader = IOFactory::createReader('Xls');
|
||||
}
|
||||
$objReader->setReadDataOnly(TRUE);
|
||||
$path = get_config('filesystem.disks.public.url');
|
||||
// 读取文件,tp6默认上传的文件,在runtime的相应目录下,可根据实际情况自己更改
|
||||
$objPHPExcel = $objReader->load('.'.$path . '/' .$savename);
|
||||
$sheet = $objPHPExcel->getSheet(0); //excel中的第一张sheet
|
||||
$highestRow = $sheet->getHighestRow(); // 取得总行数
|
||||
$highestColumn = $sheet->getHighestColumn(); // 取得总列数
|
||||
Coordinate::columnIndexFromString($highestColumn);
|
||||
$lines = $highestRow - 1;
|
||||
if ($lines <= 0) {
|
||||
return to_assign(1, '数据不能为空');
|
||||
exit();
|
||||
}
|
||||
$sex_array=['未知','男','女'];
|
||||
$type_array=['未知','正式','试用','实习'];
|
||||
$mobile_array = Db::name('Admin')->where([['status','>=',0],['delete_time','=',0]])->column('mobile');
|
||||
$email_array = Db::name('Admin')->where([['status','>=',0],['delete_time','=',0]])->column('email');
|
||||
$username_array = Db::name('Admin')->where([['status','>=',0],['delete_time','=',0]])->column('username');
|
||||
$department_array = Db::name('Department')->where(['status' => 1])->column('title', 'id');
|
||||
$position_array = Db::name('Position')->where(['status' => 1])->column('title', 'id');
|
||||
//循环读取excel表格,整合成数组。如果是不指定key的二维,就用$data[i][j]表示。
|
||||
for ($j = 3; $j <= $highestRow; $j++) {
|
||||
$salt = set_salt(20);
|
||||
$reg_pwd = '123456';
|
||||
$name = $objPHPExcel->getActiveSheet()->getCell("A" . $j)->getValue();
|
||||
if(empty($name)){
|
||||
continue;
|
||||
}
|
||||
$char = mb_substr($name, 0, 1, 'utf-8');
|
||||
$sex = array_search_plus($sex_array,$objPHPExcel->getActiveSheet()->getCell("D" . $j)->getValue());
|
||||
$department = array_search_plus($department_array,$objPHPExcel->getActiveSheet()->getCell("E" . $j)->getValue());
|
||||
$position = array_search_plus($position_array,$objPHPExcel->getActiveSheet()->getCell("f" . $j)->getValue());
|
||||
$type = array_search_plus($type_array,$objPHPExcel->getActiveSheet()->getCell("G" . $j)->getValue());
|
||||
$username = Pinyin::name($name,'none')->join('');
|
||||
//$username = implode('-', $pinyinname);
|
||||
$mobile = $objPHPExcel->getActiveSheet()->getCell("B" . $j)->getValue();
|
||||
$email = $objPHPExcel->getActiveSheet()->getCell("C" . $j)->getValue();
|
||||
$file_check['mobile'] = $mobile;
|
||||
$file_check['email'] = $email;
|
||||
$validate_mobile = \think\facade\Validate::rule([
|
||||
'mobile' => 'require|mobile',
|
||||
]);
|
||||
$validate_email = \think\facade\Validate::rule([
|
||||
'email' => 'email',
|
||||
]);
|
||||
if (!$validate_mobile->check($file_check)) {
|
||||
return to_assign(1, '第'.($j - 2).'行的手机号码的格式错误');
|
||||
}
|
||||
else{
|
||||
if(in_array($mobile,$mobile_array)){
|
||||
return to_assign(1, '第'.($j - 2).'行的手机号码已存在或者重复');
|
||||
}
|
||||
else{
|
||||
array_push($mobile_array,$mobile);
|
||||
}
|
||||
}
|
||||
if(!empty($email)){
|
||||
if (!$validate_email->check($file_check)) {
|
||||
return to_assign(1, '第'.($j - 2).'行的电子邮箱的格式错误');
|
||||
}
|
||||
else{
|
||||
if(in_array($email,$email_array)){
|
||||
return to_assign(1, '第'.($j - 2).'行的电子邮箱已存在或者重复');
|
||||
}
|
||||
else{
|
||||
array_push($email_array,$email);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
$email='';
|
||||
}
|
||||
if(empty($department)){
|
||||
return to_assign(1, '第'.($j - 2).'行的所在部门错误');
|
||||
}
|
||||
if(empty($position)){
|
||||
return to_assign(1, '第'.($j - 2).'行的所属职位错误');
|
||||
}
|
||||
|
||||
$newusername = $this->check_name($username,$username_array);
|
||||
array_push($username_array,$newusername);
|
||||
$data[$j - 3] = [
|
||||
'name' => $name,
|
||||
'nickname' => $name,
|
||||
'mobile' => $mobile,
|
||||
'email' => $email,
|
||||
'sex' => $sex,
|
||||
'did' => $department,
|
||||
'position_id' => $position,
|
||||
'type' => $type,
|
||||
'entry_time' => Shared::excelToTimestamp($objPHPExcel->getActiveSheet()->getCell("H" . $j)->getValue(),'Asia/Shanghai'),
|
||||
'username' => $newusername,
|
||||
'salt' => $salt,
|
||||
'pwd' => set_password($reg_pwd, $salt),
|
||||
'reg_pwd' => $reg_pwd,
|
||||
'thumb' => $this->to_avatars($char)
|
||||
];
|
||||
}
|
||||
//dd($data);exit;
|
||||
$count=0;
|
||||
foreach ($data as $a => $aa) {
|
||||
$aid = Admin::strict(false)->field(true)->insertGetId($aa);
|
||||
if($aid>0){
|
||||
//Db::name('DepartmentAdmin')->insert(['admin_id'=>$aid,'department_id'=>$aa['did'],'create_time' => time()]);
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
return to_assign(0, '共成功导入了'.$count.'条员工数据');
|
||||
} catch (\think\exception\ValidateException $e) {
|
||||
return to_assign(1, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//导入客户
|
||||
public function import_customer(){
|
||||
// 获取表单上传文件
|
||||
$file[]= request()->file('file');
|
||||
|
||||
$param = get_params();
|
||||
$type = 'sea';
|
||||
if(isset($param['type'])){
|
||||
$type = $param['type'];
|
||||
}
|
||||
try {
|
||||
// 验证文件大小,名称等是否正确
|
||||
validate(['file' => 'filesize:51200|fileExt:xls,xlsx'])->check($file);
|
||||
// 日期前綴
|
||||
$dataPath = date('Ym');
|
||||
$md5 = $file[0]->hash('md5');
|
||||
$savename = \think\facade\Filesystem::disk('public')->putFile($dataPath, $file[0], function () use ($md5) {
|
||||
return $md5;
|
||||
});
|
||||
$fileExtendName = substr(strrchr($savename, '.'), 1);
|
||||
// 有Xls和Xlsx格式两种
|
||||
if ($fileExtendName == 'xlsx') {
|
||||
$objReader = IOFactory::createReader('Xlsx');
|
||||
} else {
|
||||
$objReader = IOFactory::createReader('Xls');
|
||||
}
|
||||
$objReader->setReadDataOnly(TRUE);
|
||||
$path = get_config('filesystem.disks.public.url');
|
||||
// 读取文件,tp6默认上传的文件,在runtime的相应目录下,可根据实际情况自己更改
|
||||
$objPHPExcel = $objReader->load('.'.$path . '/' .$savename);
|
||||
//$objPHPExcel = $objReader->load('./storage/202209/d11544d20b3ca1c1a5f8ce799c3b2433.xlsx');
|
||||
$sheet = $objPHPExcel->getSheet(0); //excel中的第一张sheet
|
||||
$highestRow = $sheet->getHighestRow(); // 取得总行数
|
||||
$highestColumn = $sheet->getHighestColumn(); // 取得总列数
|
||||
Coordinate::columnIndexFromString($highestColumn);
|
||||
$lines = $highestRow - 1;
|
||||
if ($lines <= 0) {
|
||||
return to_assign(1, '数据不能为空');
|
||||
exit();
|
||||
}
|
||||
$name_array = [];
|
||||
$source_array = Db::name('CustomerSource')->where(['status' => 1])->column('title', 'id');
|
||||
$grade_array = Db::name('CustomerGrade')->where(['status' => 1])->column('title', 'id');
|
||||
$industry_array = Db::name('Industry')->where(['status' => 1])->column('title', 'id');
|
||||
|
||||
//循环读取excel表格,整合成数组。如果是不指定key的二维,就用$data[i][j]表示。
|
||||
for ($j = 3; $j <= $highestRow; $j++) {
|
||||
$file_check = [];
|
||||
$name = $objPHPExcel->getActiveSheet()->getCell("A" . $j)->getValue();
|
||||
if(empty($name)){
|
||||
continue;
|
||||
}
|
||||
$count_name = Db::name('Customer')->where(['name'=>$name,'delete_time'=>0])->count();
|
||||
if($count_name>0){
|
||||
return to_assign(1, '第'.($j - 2).'行的客户名称已经存在');
|
||||
}
|
||||
if(in_array($name,$name_array)){
|
||||
return to_assign(1, '上传的文件存在相同的客户名称,请删除再操作');
|
||||
}
|
||||
array_push($name_array,$name);
|
||||
$source_id = array_search_plus($source_array,$objPHPExcel->getActiveSheet()->getCell("B" . $j)->getValue());
|
||||
$grade_id = array_search_plus($grade_array,$objPHPExcel->getActiveSheet()->getCell("C" . $j)->getValue());
|
||||
$industry_id = array_search_plus($industry_array,$objPHPExcel->getActiveSheet()->getCell("D" . $j)->getValue());
|
||||
|
||||
$c_name = $objPHPExcel->getActiveSheet()->getCell("E" . $j)->getValue();
|
||||
$c_mobile = $objPHPExcel->getActiveSheet()->getCell("F" . $j)->getValue();
|
||||
$file_check['c_mobile'] = $c_mobile;
|
||||
$tax_num = $objPHPExcel->getActiveSheet()->getCell("G" . $j)->getValue();
|
||||
$bank = $objPHPExcel->getActiveSheet()->getCell("H" . $j)->getValue();
|
||||
$bank_sn = $objPHPExcel->getActiveSheet()->getCell("I" . $j)->getValue();
|
||||
$file_check['bank_sn'] = $bank_sn;
|
||||
$bank_no = $objPHPExcel->getActiveSheet()->getCell("K" . $j)->getValue();
|
||||
$cperson_mobile = $objPHPExcel->getActiveSheet()->getCell("K" . $j)->getValue();
|
||||
$address = $objPHPExcel->getActiveSheet()->getCell("L" . $j)->getValue();
|
||||
$content = $objPHPExcel->getActiveSheet()->getCell("M" . $j)->getValue();
|
||||
$market = $objPHPExcel->getActiveSheet()->getCell("N" . $j)->getValue();
|
||||
if(empty($c_name)){
|
||||
return to_assign(1, '第'.($j - 2).'行的客户联系人姓名没完善');
|
||||
}
|
||||
if(empty($c_mobile)){
|
||||
return to_assign(1, '第'.($j - 2).'行的客户联系人手机号码没完善');
|
||||
}
|
||||
$validate_mobile = \think\facade\Validate::rule([
|
||||
'c_mobile' => 'mobile',
|
||||
]);
|
||||
if (!$validate_mobile->check($file_check)) {
|
||||
return to_assign(1, '第'.($j - 2).'行的客户联系人手机号码格式错误');
|
||||
}
|
||||
if(empty($source_id)){
|
||||
return to_assign(1, '第'.($j - 2).'行的客户来源错误');
|
||||
}
|
||||
if(empty($grade_id)){
|
||||
return to_assign(1, '第'.($j - 2).'行的客户等级错误');
|
||||
}
|
||||
if(empty($industry_id)){
|
||||
return to_assign(1, '第'.($j - 2).'行的所属行业错误');
|
||||
}
|
||||
if(empty($tax_num)){
|
||||
$tax_num='';
|
||||
}
|
||||
if(empty($bank)){
|
||||
$bank='';
|
||||
}
|
||||
$validate_bank = \think\facade\Validate::rule([
|
||||
'bank_sn' => 'number',
|
||||
]);
|
||||
if(!empty($bank_sn)){
|
||||
if (!$validate_bank->check($file_check)) {
|
||||
return to_assign(1, '第'.($j - 2).'行的银行卡账号格式错误');
|
||||
}
|
||||
}
|
||||
else{
|
||||
$bank_sn='';
|
||||
}
|
||||
if(empty($bank_no)){
|
||||
$bank_no='';
|
||||
}
|
||||
if(empty($cperson_mobile)){
|
||||
$cperson_mobile='';
|
||||
}
|
||||
if(empty($address)){
|
||||
$address='';
|
||||
}
|
||||
if(empty($content)){
|
||||
$content='';
|
||||
}
|
||||
if(empty($market)){
|
||||
$market='';
|
||||
}
|
||||
$belong_uid = 0;
|
||||
$belong_did = 0;
|
||||
if($type != 'sea'){
|
||||
$belong_uid = $this->uid;
|
||||
$belong_did = $this->did;
|
||||
}
|
||||
$data[$j - 3] = [
|
||||
'name' => $name,
|
||||
'source_id' => $source_id,
|
||||
'grade_id' => $grade_id,
|
||||
'industry_id' => $industry_id,
|
||||
'tax_num' => $tax_num,
|
||||
'bank' => $bank,
|
||||
'bank_sn' => $bank_sn,
|
||||
'bank_no' => $bank_no,
|
||||
'cperson_mobile' => $cperson_mobile,
|
||||
'address' => $address,
|
||||
'content' => $content,
|
||||
'market' => $market,
|
||||
'admin_id' => $this->uid,
|
||||
'belong_uid' => $belong_uid,
|
||||
'belong_did' => $belong_did,
|
||||
'c_mobile' => $c_mobile,
|
||||
'c_name' => $c_name,
|
||||
'create_time' => time(),
|
||||
'update_time' => time()
|
||||
];
|
||||
}
|
||||
//dd($data);exit;
|
||||
// 批量添加数据
|
||||
$count=0;
|
||||
foreach ($data as $a => $aa) {
|
||||
$cid = Customer::strict(false)->field(true)->insertGetId($aa);
|
||||
if($cid>0){
|
||||
$contact = [
|
||||
'name' => $aa['c_name'],
|
||||
'mobile' => $aa['c_mobile'],
|
||||
'sex' => 1,
|
||||
'cid' => $cid,
|
||||
'is_default' => 1,
|
||||
'create_time' => time(),
|
||||
'admin_id' => $this->uid
|
||||
];
|
||||
Db::name('CustomerContact')->strict(false)->field(true)->insert($contact);
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
return to_assign(0, '共成功导入了'.$count.'条客户数据');
|
||||
} catch (\think\exception\ValidateException $e) {
|
||||
return to_assign(1, $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,637 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\BaseController;
|
||||
use app\api\model\EditLog;
|
||||
use smsservice\Smsservice;
|
||||
use think\Image; // 引入Image类
|
||||
use think\facade\Db;
|
||||
|
||||
class Index extends BaseController
|
||||
{
|
||||
//上传文件
|
||||
public function upload()
|
||||
{
|
||||
if (request()->isPost()) {
|
||||
$param = get_params();
|
||||
$sourse = 'file';
|
||||
if(isset($param['sourse'])){
|
||||
$sourse = $param['sourse'];
|
||||
}
|
||||
if($sourse == 'file' || $sourse == 'tinymce'){
|
||||
if(request()->file('file')){
|
||||
$file = request()->file('file');
|
||||
}
|
||||
else{
|
||||
return to_assign(1, '没有选择上传文件');
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (request()->file('editormd-image-file')) {
|
||||
$file = request()->file('editormd-image-file');
|
||||
} else {
|
||||
return to_assign(1, '没有选择上传文件');
|
||||
}
|
||||
}
|
||||
// 获取上传文件的hash散列值
|
||||
$sha1 = $file->hash('sha1');
|
||||
$md5 = $file->hash('md5');
|
||||
$rule = [
|
||||
'image' => 'jpg,png,jpeg,gif',
|
||||
'doc' => 'txt,doc,docx,ppt,pptx,xls,xlsx,pdf',
|
||||
'file' => 'zip,gz,7z,rar,tar',
|
||||
'video' => 'mpg,mp4,mpeg,avi,wmv,mov,flv,m4v',
|
||||
'audio' => 'mp3,wav,wma,flac,midi',
|
||||
];
|
||||
$fileExt = $rule['image'] . ',' . $rule['doc'] . ',' . $rule['file'] . ',' . $rule['video'] . ',' . $rule['audio'];
|
||||
//1M=1024*1024=1048576字节
|
||||
$file_size = get_system_config('system','upload_max_filesize');
|
||||
if(!isset($file_size)){
|
||||
$file_size=50;
|
||||
}
|
||||
$fileSize = $file_size * 1024 * 1024;
|
||||
if (isset($param['type']) && $param['type']) {
|
||||
$fileExt = $rule[$param['type']];
|
||||
}
|
||||
if (isset($param['size']) && $param['size']) {
|
||||
$fileSize = $param['size'];
|
||||
}
|
||||
$validate = \think\facade\Validate::rule([
|
||||
'image' => 'require|fileSize:' . $fileSize . '|fileExt:' . $fileExt,
|
||||
]);
|
||||
$file_check['image'] = $file;
|
||||
if (!$validate->check($file_check)) {
|
||||
return to_assign(1, $validate->getError());
|
||||
}
|
||||
// 日期前綴
|
||||
$dataPath = date('Ym');
|
||||
$use = 'thumb';
|
||||
$filename = \think\facade\Filesystem::disk('public')->putFile($dataPath, $file, function () use ($md5) {
|
||||
return set_salt(5).'_'.$md5;
|
||||
});
|
||||
if ($filename) {
|
||||
//写入到附件表
|
||||
$imagePath = get_config('filesystem.disks.public.url'). '/' . $filename;
|
||||
$thumbPath = '';
|
||||
if(in_array($file->extension(),['jpg','png','jpeg','gif'])){
|
||||
// 生成等比缩略图
|
||||
$image = Image::open(request()->file('file'));
|
||||
$thumbPath = dirname($imagePath) . '/thumb_' . basename($imagePath);
|
||||
// 生成等比缩略图保存到指定位置,这里设置最大宽度为360px, 高度自适应
|
||||
$image->thumb(360,360,Image::THUMB_CENTER)->save('./'.$thumbPath);
|
||||
}
|
||||
$data = [];
|
||||
$data['filepath'] = $imagePath;
|
||||
$data['thumbpath'] = $thumbPath;
|
||||
$data['name'] = $file->getOriginalName();
|
||||
$data['mimetype'] = $file->getOriginalMime();
|
||||
$data['fileext'] = $file->extension();
|
||||
$data['filesize'] = $file->getSize();
|
||||
$data['filename'] = $filename;
|
||||
$data['sha1'] = $sha1;
|
||||
$data['md5'] = $md5;
|
||||
$data['module'] = \think\facade\App::initialize()->http->getName();
|
||||
$data['action'] = app('request')->action();
|
||||
$data['uploadip'] = app('request')->ip();
|
||||
$data['create_time'] = time();
|
||||
$data['user_id'] = $this->uid;
|
||||
if ($data['module'] = 'admin') {
|
||||
//通过后台上传的文件直接审核通过
|
||||
$data['status'] = 1;
|
||||
$data['admin_id'] = $data['user_id'];
|
||||
$data['audit_time'] = time();
|
||||
}
|
||||
$data['use'] = request()->has('use') ? request()->param('use') : $use; //附件用处
|
||||
$res['id'] = Db::name('file')->insertGetId($data);
|
||||
$res['filepath'] = $data['filepath'];
|
||||
$res['name'] = $data['name'];
|
||||
$res['uid'] = $this->uid;
|
||||
$res['filename'] = $data['filename'];
|
||||
$res['filesize'] = $data['filesize'];
|
||||
$res['fileext'] = $data['fileext'];
|
||||
add_log('upload', $data['user_id'], $data,'文件');
|
||||
if($sourse == 'editormd'){
|
||||
//editormd编辑器上传返回
|
||||
return json(['success'=>1,'message'=>'上传成功','url'=>$data['filepath']]);
|
||||
}
|
||||
else if($sourse == 'tinymce'){
|
||||
//tinymce编辑器上传返回
|
||||
return json(['success'=>1,'message'=>'上传成功','location'=>$data['filepath']]);
|
||||
}
|
||||
else{
|
||||
//普通上传返回
|
||||
return to_assign(0, '上传成功', $res);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return to_assign(1, '上传失败,请重试');
|
||||
}
|
||||
}
|
||||
else{
|
||||
return to_assign(1, '非法请求');
|
||||
}
|
||||
}
|
||||
|
||||
//执行分块上传的控制器方法
|
||||
public function chunkUpload() {
|
||||
if ($this->request->isPost()) {
|
||||
//执行分块上传流程
|
||||
$data = $this->request->post();
|
||||
//判断是否是分块上传
|
||||
if ($data['type'] === 'chunk') {
|
||||
$file = request()->file('file');
|
||||
|
||||
$rule = [
|
||||
'image' => 'jpg,png,jpeg,gif',
|
||||
'doc' => 'txt,doc,docx,ppt,pptx,xls,xlsx,pdf',
|
||||
'file' => 'zip,gz,7z,rar,tar',
|
||||
'video' => 'mpg,mp4,mpeg,avi,wmv,mov,flv,m4v',
|
||||
'audio' => 'mp3,wav,wma,flac,midi',
|
||||
];
|
||||
$fileExt = $rule['image'] . ',' . $rule['doc'] . ',' . $rule['file'] . ',' . $rule['video'] . ',' . $rule['audio'];
|
||||
//1M=1024*1024=1048576字节
|
||||
$file_size = get_system_config('system','upload_max_filesize');
|
||||
if(!isset($file_size)){
|
||||
$file_size=50;
|
||||
}
|
||||
$fileSize = $file_size * 1024 * 1024;
|
||||
$validate = \think\facade\Validate::rule([
|
||||
'image' => 'require|fileSize:' . $fileSize . '|fileExt:' . $fileExt,
|
||||
]);
|
||||
$file_check['image'] = $file;
|
||||
if (!$validate->check($file_check)) {
|
||||
return to_assign(1, $validate->getError());
|
||||
}
|
||||
|
||||
//获取对应的上传配置
|
||||
$fs = \think\facade\Filesystem::disk('public');
|
||||
$ext = $file->extension();
|
||||
$chunkPath = $data['file_id'].'/'.$file->md5().($ext ? '.'.$ext : '');
|
||||
//存储分片文件到指定路径
|
||||
$savename = $fs->putFileAs( 'chunk', $file,$chunkPath);
|
||||
if (!$savename) {
|
||||
return json([
|
||||
'code' => 1,
|
||||
'msg' => '上传失败',
|
||||
'data' => [],
|
||||
]);
|
||||
}
|
||||
if (!$data['is_end']) {
|
||||
$filepath = '';
|
||||
} else {
|
||||
//合并块文件
|
||||
$fileUrl = '';
|
||||
$chunkSaveDir = \think\facade\Filesystem::getDiskConfig('public');
|
||||
$smallChunkDir = $chunkSaveDir['root'].'/chunk/'.$data['file_id'];
|
||||
//获取已存储的属于源文件的所有分块文件 进行合并
|
||||
if ($handle = opendir($smallChunkDir)) {
|
||||
$chunkList = [];
|
||||
$modifyTime = [];
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$temp['path'] = $smallChunkDir.'/'.$file;
|
||||
$temp['modify'] = filemtime($smallChunkDir.'/'.$file);
|
||||
$chunkList[] = $temp;
|
||||
$modifyTime[] = $temp['modify'];
|
||||
}
|
||||
}
|
||||
//对分块文件进行排序
|
||||
array_multisort($modifyTime,SORT_ASC,$chunkList);
|
||||
$saveDir = \think\facade\Filesystem::getDiskConfig('public');
|
||||
$saveName = md5($data['file_id'].$data['file_name']).'.'.$data['file_extension'];
|
||||
$newPath = $saveDir['root'].'/'.date('Ym').'/'.$saveName;
|
||||
if (!file_exists($saveDir['root'].'/'.date('Ym'))) {
|
||||
mkdir($saveDir['root'].'/'.date('Ym'),0777,true);
|
||||
}
|
||||
$newFileHandle = fopen($newPath,'a+b');
|
||||
foreach ($chunkList as $item) {
|
||||
fwrite($newFileHandle,file_get_contents($item['path']));
|
||||
unlink($item['path']);
|
||||
}
|
||||
rmdir($smallChunkDir);
|
||||
//将合并后的文件存储到指定路径
|
||||
$fileUrl = $saveDir['url'].'/'.date('Ym').'/'.$saveName;
|
||||
fclose($newFileHandle);
|
||||
closedir($handle);
|
||||
} else {
|
||||
return json([
|
||||
'code' => 1,
|
||||
'msg' => '目录:'.$chunkSaveDir['root'].'/chunk/'.$data['file_id'].'不存在',
|
||||
'data' => [],
|
||||
]);
|
||||
}
|
||||
$filepath = $fileUrl;
|
||||
}
|
||||
$res=[];
|
||||
//合并流程结束
|
||||
if ($filepath!='') {
|
||||
$fileinfo = [];
|
||||
$fileinfo['filepath'] = $filepath;
|
||||
$fileinfo['name'] = $data['file_name'];
|
||||
$fileinfo['fileext'] = $data['file_extension'];
|
||||
$fileinfo['filesize'] = $data['file_size'];
|
||||
$fileinfo['filename'] = date('Ym').'/'.$saveName;
|
||||
$fileinfo['sha1'] = $data['file_id'];
|
||||
$fileinfo['md5'] = $data['file_id'];
|
||||
$fileinfo['module'] = \think\facade\App::initialize()->http->getName();
|
||||
$fileinfo['action'] = app('request')->action();
|
||||
$fileinfo['uploadip'] = app('request')->ip();
|
||||
$fileinfo['create_time'] = time();
|
||||
$fileinfo['user_id'] = get_login_admin('id') ? get_login_admin('id') : 0;
|
||||
if ($fileinfo['module'] = 'admin') {
|
||||
//通过后台上传的文件直接审核通过
|
||||
$fileinfo['status'] = 1;
|
||||
$fileinfo['admin_id'] = $fileinfo['user_id'];
|
||||
$fileinfo['audit_time'] = time();
|
||||
}
|
||||
$fileinfo['use'] = 'big';
|
||||
$res['id'] = Db::name('file')->insertGetId($fileinfo);
|
||||
$res['filepath'] = $fileinfo['filepath'];
|
||||
$res['name'] = $fileinfo['name'];
|
||||
$res['filename'] = $fileinfo['filename'];
|
||||
$res['filesize'] = $fileinfo['filesize'];
|
||||
$res['fileext'] = $fileinfo['fileext'];
|
||||
add_log('upload', $fileinfo['user_id'], $fileinfo);
|
||||
}
|
||||
return to_assign(0, '上传成功', $res);
|
||||
}
|
||||
}
|
||||
else{
|
||||
return to_assign(1, '非法请求', $res);
|
||||
}
|
||||
}
|
||||
|
||||
//取消上传,删除临时文件
|
||||
public function clearChunk() {
|
||||
if ($this->request->isPost()) {
|
||||
$param = get_params();
|
||||
$saveDir = \think\facade\Filesystem::getDiskConfig('public');
|
||||
$smallChunkDir = $saveDir['root'].'/chunk/'.$param['file_id'];
|
||||
if(!is_dir($smallChunkDir)){
|
||||
return to_assign(0, '上传的临时文件已删除');
|
||||
}
|
||||
//获取已存储的属于源文件的所有分块文件
|
||||
if ($handle = opendir($smallChunkDir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$temp['path'] = $smallChunkDir.'/'.$file;
|
||||
unlink($temp['path']);
|
||||
}
|
||||
}
|
||||
rmdir($smallChunkDir);
|
||||
closedir($handle);
|
||||
return to_assign(0, '已取消上传');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//附件重命名
|
||||
public function file_edit()
|
||||
{
|
||||
$param = get_params();
|
||||
if (Db::name('File')->where('id',$param['id'])->update(['name'=>$param['title']]) !== false) {
|
||||
add_log('edit', $param['id'], $param,'文件名称');
|
||||
return to_assign(0, "操作成功");
|
||||
} else {
|
||||
return to_assign(1, "操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
//获取编辑记录
|
||||
public function load_log()
|
||||
{
|
||||
$param = get_params();
|
||||
$log = new EditLog();
|
||||
$list = $log->datalist($param);
|
||||
$total = Db::name('EditLog')->where(['name'=>$param['name'],'action_id'=>$param['action_id']])->count();
|
||||
$totalRow['total'] = $total;
|
||||
return to_assign(0, '', $list,$totalRow);
|
||||
}
|
||||
|
||||
|
||||
//清空缓存
|
||||
public function cache_clear()
|
||||
{
|
||||
\think\facade\Cache::clear();
|
||||
return to_assign(0, '系统缓存已清空');
|
||||
}
|
||||
|
||||
// 测试邮件发送
|
||||
public function email_test()
|
||||
{
|
||||
$sender = get_params('email');
|
||||
//检查是否邮箱格式
|
||||
if (!is_email($sender)) {
|
||||
return to_assign(1, '测试邮箱码格式有误');
|
||||
}
|
||||
$email_config = \think\facade\Db::name('config')->where('name', 'email')->find();
|
||||
$config = unserialize($email_config['content']);
|
||||
$content = $config['template'];
|
||||
//所有项目必须填写
|
||||
if (empty($config['smtp']) || empty($config['smtp_port']) || empty($config['smtp_user']) || empty($config['smtp_pwd'])) {
|
||||
return to_assign(1, '请完善邮件配置信息');
|
||||
}
|
||||
|
||||
$send = send_email($sender, '测试邮件', $content);
|
||||
if ($send) {
|
||||
return to_assign(0, '邮件发送成功');
|
||||
} else {
|
||||
return to_assign(1, '邮件发送失败');
|
||||
}
|
||||
}
|
||||
|
||||
//测试发送阿里云短信
|
||||
public function sms_test()
|
||||
{
|
||||
$phoneNumbers = '136xxxxxxxx';
|
||||
// $code = rand(1000, 9999); // 示例验证码
|
||||
$sms = new Smsservice();
|
||||
$result = $sms->sendSms($phoneNumbers, 'SMS_xxxxxx', ['name' => '勾股OA','title'=>'《测试阿里云短信发送成功》']);
|
||||
if ($result['code'] === 'OK') {
|
||||
return to_assign(0, '发送成功');
|
||||
} else {
|
||||
return to_assign(1, '发送失败:'.$result['message']);
|
||||
}
|
||||
}
|
||||
|
||||
//获取未读消息
|
||||
public function get_msg()
|
||||
{
|
||||
$msg_map[] = ['to_uid', '=', $this->uid];
|
||||
$msg_map[] = ['read_time', '=', 0];
|
||||
$msg_map[] = ['delete_time', '=', 0];
|
||||
$msg_count = Db::name('Msg')->where($msg_map)->count();
|
||||
return to_assign(0, 'ok', $msg_count);
|
||||
}
|
||||
|
||||
//获取部门
|
||||
public function get_department()
|
||||
{
|
||||
$department = get_department();
|
||||
return to_assign(0, '', $department);
|
||||
}
|
||||
|
||||
//获取部门树形节点列表,用于tree前端组件
|
||||
public function get_department_tree()
|
||||
{
|
||||
$department = get_department();
|
||||
$list = get_tree($department);
|
||||
$data['trees'] = $list;
|
||||
return json($data);
|
||||
}
|
||||
|
||||
//获取下属部门树形节点列表,用于tree前端组件
|
||||
public function get_department_tree_sub()
|
||||
{
|
||||
if($this->uid==1){
|
||||
$department = get_department();
|
||||
}
|
||||
else{
|
||||
$dids = get_leader_departments($this->uid);
|
||||
$department = Db::name('Department')->order('sort desc,id asc')->where([['status','=',1],['id','in',$dids]])->select()->toArray();
|
||||
}
|
||||
$list = get_tree($department,$department[0]['pid']);
|
||||
$data['trees'] = $list;
|
||||
return json($data);
|
||||
}
|
||||
|
||||
//获取部门树形节点列表,用于X-select前端组件
|
||||
public function get_department_select()
|
||||
{
|
||||
$keyword = get_params('keyword');
|
||||
$selected = [];
|
||||
if(!empty($keyword)){
|
||||
$selected = explode(",",$keyword);
|
||||
}
|
||||
$department = get_department();
|
||||
$list = get_select_tree($department, 0,0,$selected);
|
||||
return to_assign(0, '',$list);
|
||||
}
|
||||
|
||||
//获取所有员工,did>0时时获取部门员工,用于picker签单组件
|
||||
public function get_employee($did = 0)
|
||||
{
|
||||
$where=[];
|
||||
$whereOr=[];
|
||||
if (!empty($did)) {
|
||||
$admin_array = Db::name('DepartmentAdmin')->where('department_id',$did)->column('admin_id');
|
||||
$map1=[
|
||||
['a.id','in',$admin_array],
|
||||
];
|
||||
$map2=[
|
||||
['a.did', '=', $did],
|
||||
];
|
||||
$whereOr =[$map1,$map2];
|
||||
}
|
||||
$where[] = ['a.id', '>', 1];
|
||||
$where[] = ['a.status', '=', 1];
|
||||
$where[] = ['a.delete_time', '=', 0];
|
||||
$employee = Db::name('admin')
|
||||
->field('a.id,a.did,a.position_id,a.mobile,a.name,a.nickname,a.sex,a.status,a.thumb,a.username,d.title as department')
|
||||
->alias('a')
|
||||
->join('Position p', 'p.id = a.position_id','left')
|
||||
->join('Department d', 'a.did = d.id','left')
|
||||
->where($where)
|
||||
->where(function ($query) use($whereOr) {
|
||||
if (!empty($whereOr)){
|
||||
$query->whereOr($whereOr);
|
||||
}
|
||||
})
|
||||
->group('a.id')
|
||||
->order('a.id desc')
|
||||
->select();
|
||||
return to_assign(0, '', $employee);
|
||||
}
|
||||
|
||||
//获取所有下属员工,did>0时时获取部门员工,用于picker签单组件
|
||||
public function get_employee_sub($did = 0)
|
||||
{
|
||||
$where=[];
|
||||
$whereOr=[];
|
||||
if (!empty($did)) {
|
||||
$admin_array = Db::name('DepartmentAdmin')->where('department_id',$did)->column('admin_id');
|
||||
$map1=[
|
||||
['a.id','in',$admin_array],
|
||||
];
|
||||
$map2=[
|
||||
['a.did', '=', $did],
|
||||
];
|
||||
$whereOr =[$map1,$map2];
|
||||
}
|
||||
else{
|
||||
if($this->uid>1){
|
||||
$dids = get_leader_departments($this->uid);
|
||||
$where[] = ['a.did', 'in', $dids];
|
||||
}
|
||||
}
|
||||
$where[] = ['a.id', '>', 1];
|
||||
$where[] = ['a.status', '=', 1];
|
||||
$where[] = ['a.delete_time', '=', 0];
|
||||
$employee = Db::name('admin')
|
||||
->field('a.id,a.did,a.position_id,a.mobile,a.name,a.nickname,a.sex,a.status,a.thumb,a.username,d.title as department')
|
||||
->alias('a')
|
||||
->join('Position p', 'p.id = a.position_id','left')
|
||||
->join('Department d', 'a.did = d.id','left')
|
||||
->where($where)
|
||||
->where(function ($query) use($whereOr) {
|
||||
if (!empty($whereOr)){
|
||||
$query->whereOr($whereOr);
|
||||
}
|
||||
})
|
||||
->group('a.id')
|
||||
->order('a.id desc')
|
||||
->select();
|
||||
return to_assign(0, '', $employee);
|
||||
}
|
||||
|
||||
//获取所有员工
|
||||
public function get_personnel()
|
||||
{
|
||||
$param = get_params();
|
||||
$where[] = ['a.status', '=', 1];
|
||||
$where[] = ['a.id', '>', 1];
|
||||
$where[] = ['a.delete_time', '=', 0];
|
||||
if (!empty($param['keywords'])) {
|
||||
$where[] = ['a.name', 'like', '%' . $param['keywords'] . '%'];
|
||||
}
|
||||
if(!empty($param['ids'])){
|
||||
//排除某些员工
|
||||
$where[] = ['a.id', 'notin', $param['ids']];
|
||||
}
|
||||
$rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
|
||||
$list = Db::name('admin')
|
||||
->field('a.id,a.did,a.position_id,a.mobile,a.name,a.nickname,a.sex,a.status,a.thumb,a.username,d.title as department')
|
||||
->alias('a')
|
||||
->join('Department d', 'a.did = d.id')
|
||||
->where($where)
|
||||
->order('a.id desc')
|
||||
->paginate(['list_rows'=> $rows]);
|
||||
return table_assign(0, '', $list);
|
||||
}
|
||||
|
||||
//获取所有员工,用于X-select前端组件,did>0时时获取部门员工
|
||||
public function get_employee_select($did=0)
|
||||
{
|
||||
$keyword = get_params('keyword');
|
||||
$selected = [];
|
||||
if(!empty($keyword)){
|
||||
$selected = explode(",",$keyword);
|
||||
}
|
||||
if($did == 0){
|
||||
$employee = Db::name('admin')->field('id as value,name')->where(['status' => 1,'delete_time'=>0])->select()->toArray();
|
||||
}
|
||||
else{
|
||||
$employee = get_department_employee($did);
|
||||
}
|
||||
$list=[];
|
||||
foreach($employee as $k => $v){
|
||||
$select = '';
|
||||
if(in_array($v['id'],$selected)){
|
||||
$select = 'selected';
|
||||
}
|
||||
$list[]=[
|
||||
'value'=>$v['id'],
|
||||
'name'=>$v['name'],
|
||||
'selected'=>$select
|
||||
];
|
||||
}
|
||||
return to_assign(0, '', $list);
|
||||
}
|
||||
|
||||
|
||||
//获取某部门的负责人
|
||||
public function get_department_leader($uid=0,$pid=0)
|
||||
{
|
||||
$leaders = get_department_leader($uid,$pid);
|
||||
return to_assign(0, '', $leaders);
|
||||
}
|
||||
|
||||
//获取职位
|
||||
public function get_position()
|
||||
{
|
||||
$position = Db::name('Position')->field('id,title')->where([['status', '=', 1], ['id', '>', 1]])->select();
|
||||
return to_assign(0, '', $position);
|
||||
}
|
||||
|
||||
//获取消息模板
|
||||
public function get_template()
|
||||
{
|
||||
$param = get_params();
|
||||
if (!empty($param['keywords'])) {
|
||||
$where[] = ['title', 'like', '%' . $param['keywords'] . '%'];
|
||||
}
|
||||
$where[] = ['status', '=', 1];
|
||||
$rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
|
||||
$list = Db::name('Template')->field('id,title')->where($where)->paginate(['list_rows'=> $rows]);;
|
||||
return table_assign(0, '', $list);
|
||||
}
|
||||
|
||||
//读取报销类型
|
||||
function get_expense_cate()
|
||||
{
|
||||
$cate = get_base_data('ExpenseCate');
|
||||
return to_assign(0, '', $cate);
|
||||
}
|
||||
|
||||
//读取费用类型
|
||||
function get_cost_cate()
|
||||
{
|
||||
$cate = get_base_data('CostCate');
|
||||
return to_assign(0, '', $cate);
|
||||
}
|
||||
|
||||
//读取印章类型
|
||||
function get_seal_cate()
|
||||
{
|
||||
$cate = get_base_data('SealCate');
|
||||
return to_assign(0, '', $cate);
|
||||
}
|
||||
|
||||
//读取车辆类型
|
||||
function get_car_cate()
|
||||
{
|
||||
$cate = get_base_data('CarCate');
|
||||
return to_assign(0, '', $cate);
|
||||
}
|
||||
|
||||
//读取企业主体
|
||||
function get_subject()
|
||||
{
|
||||
$subject = get_base_data('Subject');
|
||||
return to_assign(0, '', $subject);
|
||||
}
|
||||
|
||||
//读取行业类型
|
||||
function get_industry()
|
||||
{
|
||||
$industry = get_base_data('Industry');
|
||||
return to_assign(0, '', $industry);
|
||||
}
|
||||
|
||||
//读取服务类型
|
||||
function get_services()
|
||||
{
|
||||
$services = get_base_data('Services');
|
||||
return to_assign(0, '', $services);
|
||||
}
|
||||
|
||||
//获取工作类型列表
|
||||
public function get_work_cate()
|
||||
{
|
||||
$cate = get_base_data('WorkCate');
|
||||
return to_assign(0, '', $cate);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
declare (strict_types = 1);
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\BaseController;
|
||||
use think\facade\Db;
|
||||
use Firebase\JWT\JWT;
|
||||
|
||||
|
||||
class Office extends BaseController
|
||||
{
|
||||
public function view($id=0,$mode='edit')
|
||||
{
|
||||
$file = Db::name('File')->where('id',$id)->find();
|
||||
if(empty($file)){
|
||||
return view('../../base/view/common/filetemplate');
|
||||
}
|
||||
$path = $file['filepath'];
|
||||
$title = $file['name'];
|
||||
$extension = pathinfo($path, PATHINFO_EXTENSION);
|
||||
$filename = pathinfo($path, PATHINFO_FILENAME);
|
||||
$office_config = get_system_config('other');
|
||||
$office_config['token'] = 'secret_8JFhzy';
|
||||
//$directory = substr($path, 0, 16);
|
||||
//$key = set_salt(10).str_replace("/", "T", $directory).$filename.'.'.$extension;
|
||||
$key = "key".$file['audit_time']."T".$id;
|
||||
$domain = $_SERVER['HTTP_HOST'];
|
||||
$url = "http://".$domain.$path;
|
||||
$callbackUrl = "http://".$domain."/office.php";
|
||||
$admin = Db::name('Admin')->where('id',$this->uid)->find();
|
||||
$config = [
|
||||
"document" => [
|
||||
"url" => $url,
|
||||
"key" => $key,
|
||||
"permissions" => [
|
||||
"chat"=> true,
|
||||
"comment"=> true,
|
||||
"copy"=> true,
|
||||
"deleteCommentAuthorOnly"=> false,
|
||||
"download"=> true,
|
||||
"edit"=> true,
|
||||
"editCommentAuthorOnly"=> false,
|
||||
"fillForms"=> true,
|
||||
"modifyContentControl"=> true,
|
||||
"modifyFilter"=> true,
|
||||
"print"=>true,
|
||||
"protect"=> true,
|
||||
"review"=> true
|
||||
]
|
||||
],
|
||||
"editorConfig"=>[
|
||||
"mode" => $mode,//view,edit
|
||||
"forcesave"=>true,
|
||||
"lang"=>"zh-CN",
|
||||
"createUrl" => '',
|
||||
"customization"=>[
|
||||
"autosave"=>true,//是否自动保存
|
||||
"comments"=>false,
|
||||
"help"=>false
|
||||
],
|
||||
"user" => [
|
||||
"id" => $admin['id'],
|
||||
"name" => $admin['name']
|
||||
],
|
||||
"callbackUrl"=>$callbackUrl
|
||||
]
|
||||
];
|
||||
$token = JWT::encode($config, $office_config['token'], 'HS256'); //输出Token 默认'HS256'
|
||||
return View('',['token'=>$token,'key'=>$key,'office'=>$office_config,'mode'=>$mode,'domain'=>$domain,'url'=>$url,'title'=>$title,'callbackUrl'=>$callbackUrl,'admin'=>$admin]);
|
||||
}
|
||||
|
||||
public function officeapps($id=0,$mode='edit')
|
||||
{
|
||||
$file = Db::name('File')->where('id',$id)->find();
|
||||
if(empty($file)){
|
||||
return view('../../base/view/common/filetemplate');
|
||||
}
|
||||
$path = $file['filepath'];
|
||||
$domain = $_SERVER['HTTP_HOST'];
|
||||
$url = "//".$domain.$path;
|
||||
return View('',['url'=>$url]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
return [
|
||||
'listen' => [
|
||||
//注册监听类
|
||||
'SendMessage' => ['app\listener\SendMessage'],
|
||||
],
|
||||
//'subscribe' => ['app\subscribe\Message'],
|
||||
];
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
// 这是系统自动生成的middleware定义文件
|
||||
return [
|
||||
//开启session中间件
|
||||
//'think\middleware\SessionInit',
|
||||
//验证勾股cms是否完成安装
|
||||
\app\home\middleware\Install::class,
|
||||
];
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
namespace app\api\middleware;
|
||||
|
||||
use Firebase\JWT\JWT;
|
||||
use Firebase\JWT\Key;
|
||||
use think\facade\Request;
|
||||
use think\Response;
|
||||
|
||||
class Auth
|
||||
{
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
$token = Request::header('Token');
|
||||
if ($token) {
|
||||
if (count(explode('.', $token)) != 3) {
|
||||
return json(['code'=>404,'msg'=>'非法请求']);
|
||||
}
|
||||
$config = get_system_config('token');
|
||||
//var_dump($config);exit;
|
||||
try {
|
||||
JWT::$leeway = 60;//当前时间减去60,把时间留点余地
|
||||
$decoded = JWT::decode($token, new Key($config['secrect'], 'HS256')); //HS256方式,这里要和签发的时候对应
|
||||
//return (array)$decoded;
|
||||
$decoded_array = json_decode(json_encode($decoded),TRUE);
|
||||
$jwt_data = $decoded_array['data'];
|
||||
//$request->uid = $jwt_data['userid'];
|
||||
define('JWT_UID', $jwt_data['userid']);
|
||||
$response = $next($request);
|
||||
return $response;
|
||||
//return $next($request);
|
||||
} catch(\Firebase\JWT\SignatureInvalidException $e) { //签名不正确
|
||||
return json(['code'=>403,'msg'=>'签名错误']);
|
||||
}catch(\Firebase\JWT\BeforeValidException $e) { // 签名在某个时间点之后才能用
|
||||
return json(['code'=>401,'msg'=>'token失效']);
|
||||
}catch(\Firebase\JWT\ExpiredException $e) { // token过期
|
||||
return json(['code'=>401,'msg'=>'token已过期']);
|
||||
}catch(Exception $e) { //其他错误
|
||||
return json(['code'=>404,'msg'=>'非法请求']);
|
||||
}catch(\UnexpectedValueException $e) { //其他错误
|
||||
return json(['code'=>404,'msg'=>'非法请求']);
|
||||
} catch(\DomainException $e) { //其他错误
|
||||
return json(['code'=>404,'msg'=>'非法请求']);
|
||||
}
|
||||
} else {
|
||||
return json(['code'=>404,'msg'=>'token不能为空']);
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
namespace app\api\model;
|
||||
use think\facade\Db;
|
||||
use think\Model;
|
||||
|
||||
class Comment extends Model
|
||||
{
|
||||
//列表
|
||||
function datalist($param=[],$where=[]) {
|
||||
$rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
|
||||
$order = empty($param['order']) ? 'id desc' : $param['order'];
|
||||
try {
|
||||
$list = self::where($where)
|
||||
->order($order)
|
||||
->paginate(['list_rows'=> $rows])
|
||||
->each(function ($item, $key) use($param){
|
||||
$item['create_times'] = time_trans($item['create_time']);
|
||||
if($item['update_time']>0){
|
||||
$item['update_times'] = ',最后编辑时间:'.time_trans($item['update_time']);
|
||||
}
|
||||
else{
|
||||
$item['update_times'] = '';
|
||||
}
|
||||
$item['thumb'] = Db::name('Admin')->where(['id' => $item['admin_id']])->value('thumb');
|
||||
$item['name'] = Db::name('Admin')->where(['id' => $item['admin_id']])->value('name');
|
||||
$to_names = Db::name('Admin')->where([['id', 'in', $item['to_uids']]])->column('name');
|
||||
if (empty($to_names)) {
|
||||
$item['to_names'] = '-';
|
||||
} else {
|
||||
$item['to_names'] = implode(',', $to_names);
|
||||
}
|
||||
$item['read'] = 0;
|
||||
if($item['admin_id'] == $param['admin_id']){
|
||||
$item['read'] = 2;
|
||||
}
|
||||
else{
|
||||
$count = Db::name('CommentRead')->where(['comment_id' => $item['id'],'admin_id' => $param['admin_id']])->count();
|
||||
if($count>0){
|
||||
$item['read'] = 1;
|
||||
}
|
||||
}
|
||||
if($item['pid']>0){
|
||||
$pcomment = Db::name('Comment')->where('id','=',$item['pid'])->find();
|
||||
$padmin_id =$pcomment['admin_id'];
|
||||
$item['padmin'] =Db::name('Admin')->where('id','=',$padmin_id)->value('name');
|
||||
$item['ptimes'] =time_trans($pcomment['create_time']);
|
||||
$item['pcontent'] = $pcomment['content'];
|
||||
}
|
||||
return $item;
|
||||
});
|
||||
return $list;
|
||||
} catch(\Exception $e) {
|
||||
return ['code' => 1, 'data' => [], 'msg' => $e->getMessage()];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
<?php
|
||||
/**
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* GouGuOPEN [ 左手研发,右手开源,未来可期!]
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Copyright (c) 2021~2024 http://www.gouguoa.com All rights reserved.
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Licensed 勾股OA,开源且可免费使用,但并不是自由软件,未经授权许可不能去除勾股OA的相关版权信息
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
* @Author 勾股工作室 <hdm58@qq.com>
|
||||
+-----------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
namespace app\api\model;
|
||||
use think\model;
|
||||
use think\facade\Db;
|
||||
class EditLog extends Model
|
||||
{
|
||||
public static $COMPILE = [
|
||||
//'title'=>'字段名称','action'=>'操作行为','table'=>'关联数据表','table_field'=>'关联数据表字段','table_more'=>'0单选数据,1多选数据','enumerate'=>[枚举数据],'time'=>'时间格式','suffix'=>'后缀'
|
||||
'Customer'=>[
|
||||
'name'=>['title'=>'客户名称','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'source_id'=>['title'=>'客户来源','action'=>'','table'=>'CustomerSource','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'grade_id'=>['title'=>'客户等级','action'=>'','table'=>'CustomerGrade','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'industry_id'=>['title'=>'所属行业','action'=>'','table'=>'Industry','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'address'=>['title'=>'客户地址','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'customer_status'=>['title'=>'客户状态','action'=>'','table'=>'BasicCustomer','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'intent_status'=>['title'=>'意向状态','action'=>'','table'=>'BasicCustomer','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'belong_uid'=>['title'=>'所属人','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'belong_did'=>['title'=>'所属部门','action'=>'','table'=>'Department','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'share_ids'=>['title'=>'共享人员','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'1','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'content'=>['title'=>'客户描述','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'market'=>['title'=>'主要经营业务','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'remark'=>['title'=>'备注信息','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'tax_bank'=>['title'=>'开户银行','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'tax_banksn'=>['title'=>'银行帐号','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'tax_num'=>['title'=>'纳税人识别号','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'tax_mobile'=>['title'=>'开票电话','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'tax_address'=>['title'=>'开票地址','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'is_lock'=>['title'=>'锁定状态','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>['未锁','已锁'],'time'=>'','suffix'=>'']
|
||||
],
|
||||
'Contract'=>[
|
||||
'pid'=>['title'=>'母协议','action'=>'','table'=>'Contract','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'name'=>['title'=>'合同名称','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'code'=>['title'=>'合同编号','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'cate_id'=>['title'=>'合同类别','action'=>'','table'=>'ContractCate','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'subject_id'=>['title'=>'签约主体','action'=>'','table'=>'Enterprise','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'customer_id'=>['title'=>'签约客户','action'=>'','table'=>'Customer','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'contact_name'=>['title'=>'客户代表','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'contact_mobile'=>['title'=>'客户电话','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'contact_address'=>['title'=>'客户地址','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'prepared_uid'=>['title'=>'合同制定人','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'sign_uid'=>['title'=>'合同签订人','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'keeper_uid'=>['title'=>'合同保管人','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'share_ids'=>['title'=>'共享人员','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'1','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'did'=>['title'=>'合同所属部门','action'=>'','table'=>'Department','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
// 'content'=>['title'=>'合同内容','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'remark'=>['title'=>'备注信息','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'types'=>['title'=>'合同性质','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>['未设置','普通合同','商品合同','服务合同'],'time'=>'','suffix'=>''],
|
||||
'start_time'=>['title'=>'合同生效时间','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'Y-m-d','suffix'=>''],
|
||||
'end_time'=>['title'=>'合同失效时间','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'Y-m-d','suffix'=>''],
|
||||
'sign_time'=>['title'=>'合同签订时间','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'Y-m-d','suffix'=>''],
|
||||
'cost'=>['title'=>'合同金额','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'tax'=>['title'=>'税点','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'is_tax'=>['title'=>'是否含税','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>['未含税','含税'],'time'=>'','suffix'=>'']
|
||||
],
|
||||
'Purchase'=>[
|
||||
'pid'=>['title'=>'母协议','action'=>'','table'=>'Contract','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'name'=>['title'=>'合同名称','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'code'=>['title'=>'合同编号','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'cate_id'=>['title'=>'合同类别','action'=>'','table'=>'ContractCate','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'subject_id'=>['title'=>'签约主体','action'=>'','table'=>'Enterprise','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'supplier_id'=>['title'=>'签约供应商','action'=>'','table'=>'Supplier','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'contact_name'=>['title'=>'供应商代表','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'contact_mobile'=>['title'=>'供应商电话','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'contact_address'=>['title'=>'供应商地址','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'prepared_uid'=>['title'=>'合同制定人','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'sign_uid'=>['title'=>'合同签订人','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'keeper_uid'=>['title'=>'合同保管人','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'share_ids'=>['title'=>'共享人员','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'1','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'did'=>['title'=>'合同所属部门','action'=>'','table'=>'Department','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
//'content'=>['title'=>'合同内容','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'remark'=>['title'=>'备注信息','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'types'=>['title'=>'合同性质','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>['未设置','普通采购','物品合同','服务采购'],'time'=>'','suffix'=>''],
|
||||
'start_time'=>['title'=>'合同生效时间','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'Y-m-d','suffix'=>''],
|
||||
'end_time'=>['title'=>'合同失效时间','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'Y-m-d','suffix'=>''],
|
||||
'sign_time'=>['title'=>'合同签订时间','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'Y-m-d','suffix'=>''],
|
||||
'cost'=>['title'=>'合同金额','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'tax'=>['title'=>'税点','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'is_tax'=>['title'=>'是否含税','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>['未含税','含税'],'time'=>'','suffix'=>'']
|
||||
],
|
||||
'Project'=>[
|
||||
'name'=>['title'=>'项目名称','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'code'=>['title'=>'项目编号','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'cate_id'=>['title'=>'项目类别','action'=>'','table'=>'ProjectCate','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'customer_id'=>['title'=>'关联客户','action'=>'','table'=>'Customer','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'contract_id'=>['title'=>'关联合同','action'=>'','table'=>'Contract','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'director_uid'=>['title'=>'项目经理','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'did'=>['title'=>'项目所属部门','action'=>'','table'=>'Department','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'content'=>['title'=>'项目描述','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'start_time'=>['title'=>'项目开始时间','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'Y-m-d','suffix'=>''],
|
||||
'end_time'=>['title'=>'项目结束时间','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'Y-m-d','suffix'=>''],
|
||||
'amount'=>['title'=>'项目金额','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'status'=>['title'=>'项目状态','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>['未设置','未开始','进行中','已完成','已关闭'],'time'=>'','suffix'=>'']
|
||||
],
|
||||
'Task'=>[
|
||||
'title'=>['title'=>'任务主题','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'pid'=>['title'=>'父级任务','action'=>'','table'=>'ProjectTask','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'before_task'=>['title'=>'前置任务','action'=>'','table'=>'ProjectTask','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'project_id'=>['title'=>'关联项目','action'=>'','table'=>'Project','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'work_id'=>['title'=>'工作类型','action'=>'','table'=>'WorkCate','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'step_id'=>['title'=>'项目阶段','action'=>'','table'=>'ProjectStep','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'director_uid'=>['title'=>'负责人','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'did'=>['title'=>'任务所属部门','action'=>'','table'=>'Department','table_field'=>'title','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'assist_admin_ids'=>['title'=>'协助人员','action'=>'','table'=>'Admin','table_field'=>'name','table_more'=>'1','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'start_time'=>['title'=>'项目开始时间','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'Y-m-d','suffix'=>''],
|
||||
'end_time'=>['title'=>'预计结束时间','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'Y-m-d','suffix'=>''],
|
||||
'over_time'=>['title'=>'实际结束时间','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'Y-m-d','suffix'=>''],
|
||||
'plan_hours'=>['title'=>'预估工时','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>''],
|
||||
'done_ratio'=>['title'=>'完成进度','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>[],'time'=>'','suffix'=>'%'],
|
||||
'priority'=>['title'=>'优先级','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>['未设置','低','中','高','紧急'],'time'=>'','suffix'=>''],
|
||||
'status'=>['title'=>'任务状态','action'=>'','table'=>'','table_field'=>'','table_more'=>'0','enumerate'=>['未设置','待办的','进行中','已完成','已拒绝','已关闭'],'time'=>'','suffix'=>'']
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
* @param $where
|
||||
* @param $param
|
||||
*/
|
||||
public function datalist($param=[])
|
||||
{
|
||||
$page = empty($param['page']) ?1 : intval($param['page']);;
|
||||
$rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
|
||||
$name=$param['name'];
|
||||
$action_id=$param['action_id'];
|
||||
try {
|
||||
$list = self::field('a.*, u.name as admin_name,u.thumb')
|
||||
->where(['a.name'=>$name,'a.action_id'=>$action_id])
|
||||
->alias('a')
|
||||
->join('Admin u','u.id = a.admin_id')
|
||||
->order('a.create_time desc')
|
||||
->page($page, $rows)
|
||||
->select()->toArray();
|
||||
|
||||
$field = self::$COMPILE[$name];
|
||||
foreach ($list as $k => &$v) {
|
||||
$v['action'] = '修改';
|
||||
$v['times'] = time_trans($v['create_time']);
|
||||
$v['create_time'] = to_date($v['create_time']);
|
||||
if($v['field'] == 'new'){
|
||||
continue;
|
||||
}
|
||||
$item = $field[$v['field']];
|
||||
if(isset($item)){
|
||||
$v['field_name'] = $item['title'];
|
||||
if(!empty($item['action'])){
|
||||
$v['action'] = $item['action'];
|
||||
}
|
||||
if(!empty($item['table']) && !empty($item['table_field'])){
|
||||
if(empty($item['table_more'])){
|
||||
$v['old_content'] = Db::name($item['table'])->where('id',$v['old_content'])->value($item['table_field']);
|
||||
$v['new_content'] = Db::name($item['table'])->where('id',$v['new_content'])->value($item['table_field']);
|
||||
}else{
|
||||
$old_content = Db::name($item['table'])->where('id','in',$v['old_content'])->column($item['table_field']);
|
||||
$new_content = Db::name($item['table'])->where('id','in',$v['new_content'])->column($item['table_field']);
|
||||
if(!empty($old_content)){
|
||||
$v['old_content'] = implode(',',$old_content);
|
||||
}
|
||||
if(!empty($new_content)){
|
||||
$v['new_content'] = implode(',',$new_content);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!empty($item['enumerate'])){
|
||||
$v['old_content'] = $item['enumerate'][$v['old_content']];
|
||||
$v['new_content'] = $item['enumerate'][$v['new_content']];
|
||||
}
|
||||
if(!empty($item['time'])){
|
||||
$v['old_content'] = to_date($v['old_content'],$item['time']);
|
||||
$v['new_content'] = to_date($v['new_content'],$item['time']);
|
||||
}
|
||||
if ($v['old_content'] == '' || $v['old_content'] == 0 || $v['old_content'] == null) {
|
||||
$v['old_content'] = '未设置';
|
||||
}
|
||||
else{
|
||||
$v['old_content'] = $v['old_content'].$item['suffix'];
|
||||
}
|
||||
if ($v['new_content'] == '' || $v['new_content'] == 0 || $v['new_content'] == null) {
|
||||
$v['new_content'] = '未设置';
|
||||
}
|
||||
else{
|
||||
$v['new_content'] = $v['new_content'].$item['suffix'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
} catch(\Exception $e) {
|
||||
return ['code' => 1, 'data' => [], 'msg' => $e->getMessage()];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入创建日志
|
||||
*/
|
||||
public function add($name,$action_id)
|
||||
{
|
||||
try {
|
||||
$session_admin = get_config('app.session_admin');
|
||||
$uid = \think\facade\Session::get($session_admin);
|
||||
$log_data = [
|
||||
'name' => $name,
|
||||
'admin_id' => $uid,
|
||||
'field' => 'new',
|
||||
'action_id' => $action_id,
|
||||
'create_time' => time()
|
||||
];
|
||||
self::strict(false)->field(true)->insert($log_data);
|
||||
} catch(\Exception $e) {
|
||||
return ['code' => 1, 'data' => [], 'msg' => $e->getMessage()];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 插入编辑日志
|
||||
*/
|
||||
public function edit($name,$action_id,$new,$old)
|
||||
{
|
||||
$log_data = [];
|
||||
$array = self::$COMPILE[$name];
|
||||
$key_array = array_keys($array);;
|
||||
if(!empty($key_array)){
|
||||
try {
|
||||
$session_admin = get_config('app.session_admin');
|
||||
$uid = \think\facade\Session::get($session_admin);
|
||||
foreach ($new as $key => $value) {
|
||||
if (in_array($key, $key_array)) {
|
||||
if(isset($old[$key]) && ($old[$key]!=$value)){
|
||||
$log_data[] = array(
|
||||
'name' => $name,
|
||||
'admin_id' => $uid,
|
||||
'field' => $key,
|
||||
'action_id' => $new['id'],
|
||||
'old_content' => $old[$key],
|
||||
'new_content' => $value,
|
||||
'create_time' => time(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
self::strict(false)->field(true)->insertAll($log_data);
|
||||
} catch(\Exception $e) {
|
||||
return ['code' => 1, 'data' => [], 'msg' => $e->getMessage()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入删除日志
|
||||
*/
|
||||
public function del($name,$action_id)
|
||||
{
|
||||
try {
|
||||
$session_admin = get_config('app.session_admin');
|
||||
$uid = \think\facade\Session::get($session_admin);
|
||||
$log_data = [
|
||||
'name' => $name,
|
||||
'admin_id' => $uid,
|
||||
'field' => 'delete',
|
||||
'action_id' => $action_id,
|
||||
'create_time' => time()
|
||||
];
|
||||
self::strict(false)->field(true)->insert($log_data);
|
||||
} catch(\Exception $e) {
|
||||
return ['code' => 1, 'data' => [], 'msg' => $e->getMessage()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
.pdf-min-table{width:100%;border:1px solid #333333; border-collapse: collapse;overflow: wrap}
|
||||
.pdf-min-table td{border:1px solid #333333;border-collapse: collapse; padding:6px; line-height:1.5;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>销售合同审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">合同名称</td>
|
||||
<td colspan="3">{$detail.name}</td>
|
||||
<td class="pdf-td-gray">合同编号</td>
|
||||
<td>{$detail.code}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">签约主体<br>(乙方)</td>
|
||||
<td colspan="3">{$detail.subject_title}</td>
|
||||
<td class="pdf-td-gray-2">合同始止日期</td>
|
||||
<td>{$detail.start_time} 至 {$detail.end_time}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">客户名称<br>(甲方)</td>
|
||||
<td colspan="3">{$detail.customer}</td>
|
||||
<td class="pdf-td-gray">签约客户代表</td>
|
||||
<td>{$detail.contact_name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray-2">客户联系地址</td>
|
||||
<td colspan="3">{$detail.contact_address|default='-'}</td>
|
||||
<td class="pdf-td-gray">客户联系电话</td>
|
||||
<td>{$detail.contact_mobile|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">合同金额</td>
|
||||
<td>{$detail.cost} 元</td>
|
||||
<td class="pdf-td-gray">合同性质</td>
|
||||
<td>{$detail.types_name}</td>
|
||||
<td class="pdf-td-gray">合同类别</td>
|
||||
<td>{$detail.cate_title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">合同签订人</td>
|
||||
<td>{$detail.sign_name}</td>
|
||||
<td class="pdf-td-gray">合同所属部门</td>
|
||||
<td>{$detail.sign_department}</td>
|
||||
<td class="pdf-td-gray">合同签订日期</td>
|
||||
<td>{$detail.sign_time}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">合同制定人</td>
|
||||
<td>{$detail.prepared_name|default='-'}</td>
|
||||
<td class="pdf-td-gray">合同保管人</td>
|
||||
<td>{$detail.keeper_name|default='-'}</td>
|
||||
<td class="pdf-td-gray">合同共享人员</td>
|
||||
<td>{$detail.share_names|default='-'}</td>
|
||||
</tr>
|
||||
{eq name="$detail.types" value="2"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray" colspan="6" style="text-align:center;"><strong>产品信息</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<table class="pdf-min-table" style="margin:0">
|
||||
<tr>
|
||||
<td width="200" style="text-align:center;">产品名称</td>
|
||||
<td width="60" style="text-align:center;">单位</td>
|
||||
<td width="90" style="text-align:center;">规格</td>
|
||||
<td width="90" style="text-align:center;">销售单价(元)</td>
|
||||
<td width="60" style="text-align:center;">数量</td>
|
||||
<td width="80" style="text-align:center;">小计(元)</td>
|
||||
<td width="200" style="text-align:center;">备注信息</td>
|
||||
</tr>
|
||||
{empty name="$detail.content_array"}
|
||||
<tr>
|
||||
<td colspan="7" style="padding:6px; text-align:center; color:#999">暂无产品信息</td>
|
||||
</tr>
|
||||
{else/}
|
||||
{volist name="$detail.content_array" id="vo"}
|
||||
<tr>
|
||||
<td style="text-align:left;">{$vo.product_title|default=''}</td>
|
||||
<td style="text-align:center;">{$vo.product_unit|default=''}</td>
|
||||
<td style="text-align:center;">{$vo.product_specs|default=''}</td>
|
||||
<td style="text-align:center;">{$vo.product_price|default='0.00'}</td>
|
||||
<td style="text-align:center;">{$vo.product_num|default='1'}</td>
|
||||
<td style="text-align:center;">{$vo.product_subtotal|default='0.00'}</td>
|
||||
<td style="text-align:left;">{$vo.product_remark|default=''}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{/empty}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/eq}
|
||||
{eq name="$detail.types" value="3"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray" colspan="6" style="text-align:center;"><strong>服务信息</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<table class="pdf-min-table" style="margin:0">
|
||||
<tr>
|
||||
<td width="110" style="text-align:center;">服务名称</td>
|
||||
<td width="160" style="text-align:center;">服务周期</td>
|
||||
<td width="90" style="text-align:center;">服务单价(元)</td>
|
||||
<td width="70" style="text-align:center;">服务次数</td>
|
||||
<td width="80" style="text-align:center;">小计(元)</td>
|
||||
<td width="100" style="text-align:center;">备注信息</td>
|
||||
</tr>
|
||||
{empty name="$detail.content_array"}
|
||||
<tr>
|
||||
<td colspan="6" style="padding:6px text-align:center; color:#999">暂无服务信息</td>
|
||||
</tr>
|
||||
{else/}
|
||||
{volist name="$detail.content_array" id="vo"}
|
||||
<tr>
|
||||
<td style="text-align:left;">{$vo.service_title|default=''}</td>
|
||||
<td style="text-align:center;">{$vo.service_date|default=''}</td>
|
||||
<td style="text-align:center;">{$vo.service_price|default='0.00'}</td>
|
||||
<td style="text-align:center;">{$vo.service_num|default='1'}</td>
|
||||
<td style="text-align:center;">{$vo.service_subtotal|default='0.00'}</td>
|
||||
<td style="text-align:left;">{$vo.service_remark|default=''}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{/empty}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/eq}
|
||||
{notempty name="$detail.remark"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">备注信息</td>
|
||||
<td colspan="5">{$detail.remark|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="5">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>人事调动审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">调动员工</td>
|
||||
<td>{$detail.name|default='-'}</td>
|
||||
<td class="pdf-td-gray">调出部门</td>
|
||||
<td>{$detail.from_department|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">调动日期</td>
|
||||
<td>{$detail.move_time}</td>
|
||||
<td class="pdf-td-gray">调入部门</td>
|
||||
<td>{$detail.to_department|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">调动原因</td>
|
||||
<td colspan="3">{:nl2br($detail.remark)}</td>
|
||||
</tr>
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="3">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>报销审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">凭证编号</td>
|
||||
<td>{$detail.code}</td>
|
||||
<td class="pdf-td-gray">入账月份</td>
|
||||
<td>{$detail.income_month_str}</td>
|
||||
<td class="pdf-td-gray">原始单据日期</td>
|
||||
<td>{$detail.expense_time}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">报销主体</td>
|
||||
<td colspan="5">{$detail.subject_name|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">报销员工</td>
|
||||
<td>{$detail.admin_name}</td>
|
||||
<td class="pdf-td-gray">报销部门</td>
|
||||
<td>{$detail.department}</td>
|
||||
<td class="pdf-td-gray">报销总费用</td>
|
||||
<td>{$detail.cost} 元</td>
|
||||
</tr>
|
||||
{notempty name="$detail.project_id"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">关联项目</td>
|
||||
<td colspan="5">{$detail.ptname|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="5">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray" colspan="3" style="text-align:center;"><strong>报销选项</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray" style="text-align:center;width:140px;">报销金额(元)</td>
|
||||
<td class="pdf-td-gray" style="text-align:center;width:140px;">报销项目</td>
|
||||
<td class="pdf-td-gray" style="text-align:center;width:480px;">备注信息</td>
|
||||
</tr>
|
||||
{volist name="$detail.list" id="vo"}
|
||||
<tr>
|
||||
<td style="text-align:center;">{$vo.amount}</td>
|
||||
<td style="text-align:center;">{$vo.cate_title}</td>
|
||||
<td>{$vo.remarks}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
<tr>
|
||||
<td class="pdf-td-gray" colspan="2">报销金额合计(小写)</td>
|
||||
<td>{$detail.cost}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray" colspan="2">报销金额合计(大写)</td>
|
||||
<td>{:cny($detail.cost)}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,313 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
.pdf-min-table{width:100%;border:1px solid #333333; border-collapse: collapse;overflow: wrap}
|
||||
.pdf-min-table td{border:1px solid #333333;border-collapse: collapse; padding:6px; line-height:1.5;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>{$detail.name}档案信息</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td colspan="8"><strong>基本信息</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">员工姓名</td>
|
||||
<td style="width:170px;">{$detail.name}</td>
|
||||
<td class="pdf-td-gray">员工性别</td>
|
||||
<td colspan="2" style="width:180px;">
|
||||
{eq name="$detail.sex" value="1"}男{/eq}
|
||||
{eq name="$detail.sex" value="2"}女{/eq}
|
||||
</td>
|
||||
<td rowspan="5" valign="top" style="width:112px;">
|
||||
<img src="{$detail.thumb}" width="110" height="156" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">手机号码</td>
|
||||
<td>{$detail.mobile}</td>
|
||||
<td class="pdf-td-gray">电子邮箱</td>
|
||||
<td colspan="2" >{$detail.email}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">出生日期</td>
|
||||
<td>{$detail.birthday}</td>
|
||||
<td class="pdf-td-gray">身份证号码</td>
|
||||
<td colspan="2" >{$detail.idcard}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">政治面貌</td>
|
||||
<td>
|
||||
{eq name="$detail.political" value="0"}无{/eq}
|
||||
{eq name="$detail.political" value="1"}中共党员{/eq}
|
||||
{eq name="$detail.political" value="2"}团员{/eq}
|
||||
</td>
|
||||
<td class="pdf-td-gray">婚姻状况</td>
|
||||
<td colspan="2">
|
||||
{eq name="$detail.marital_status" value="1"}未婚{/eq}
|
||||
{eq name="$detail.marital_status" value="2"}已婚{/eq}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">民族</td>
|
||||
<td>{$detail.nation}</td>
|
||||
<td class="pdf-td-gray">籍贯</td>
|
||||
<td colspan="2">{$detail.native_place}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">最高学位</td>
|
||||
<td>{$detail.education}</td>
|
||||
<td class="pdf-td-gray">毕业院校</td>
|
||||
<td colspan="3">{$detail.graduate_school}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">专业</td>
|
||||
<td>{$detail.speciality}</td>
|
||||
<td class="pdf-td-gray">毕业日期</td>
|
||||
<td style="width:120px;">{$detail.graduate_day}</td>
|
||||
<td class="pdf-td-gray">参加工作时间</td>
|
||||
<td>{$detail.work_date}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">户口性质</td>
|
||||
<td>
|
||||
{eq name="$detail.resident_type" value="1"}农村户口{/eq}
|
||||
{eq name="$detail.resident_type" value="2"}城镇户口{/eq}
|
||||
</td>
|
||||
<td class="pdf-td-gray">户口所在地</td>
|
||||
<td colspan="3">{$detail.resident_place}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td class="pdf-td-gray">家庭住址</td>
|
||||
<td colspan="3">{$detail.home_address}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">紧急联系人</td>
|
||||
<td>{$detail.contact},{$detail.contact_mobile}</td>
|
||||
<td class="pdf-td-gray">现住地址</td>
|
||||
<td colspan="3">{$detail.current_address}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="pdf-td-gray">员工简介</td>
|
||||
<td colspan="7">
|
||||
{$detail.desc|default=''}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8"><strong>入职信息</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">所在部门</td>
|
||||
<td>{$detail.department}</td>
|
||||
<td class="pdf-td-gray">上级主管</td>
|
||||
<td>{$detail.pname|default='无'}</td>
|
||||
<td class="pdf-td-gray">岗位</td>
|
||||
<td>{$detail.position}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">入职日期</td>
|
||||
<td>{$detail.entry_time|date='Y-m-d'}</td>
|
||||
<td class="pdf-td-gray">职级</td>
|
||||
<td>
|
||||
{volist name=":get_base_type_data('basic_user',2)" id="v"}
|
||||
{eq name="$detail.position_rank" value="$v.id"}{$v.title}{/eq}
|
||||
{/volist}
|
||||
</td>
|
||||
<td class="pdf-td-gray">职级</td>
|
||||
<td>
|
||||
{volist name=":get_base_type_data('basic_user',2)" id="v"}
|
||||
{eq name="$detail.position_rank" value="$v.id"}{$v.title}{/eq}
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">员工类型</td>
|
||||
<td>
|
||||
{eq name="$detail.type" value="3"}实习{/eq}
|
||||
{eq name="$detail.type" value="2"}试用{/eq}
|
||||
{eq name="$detail.type" value="1"}正式{/eq}
|
||||
,
|
||||
{eq name="$detail.is_staff" value="1"}企业员工{/eq}
|
||||
{eq name="$detail.is_staff" value="2"}劳动派遣{/eq}
|
||||
{eq name="$detail.is_staff" value="3"}兼职人员{/eq}
|
||||
</td>
|
||||
<td class="pdf-td-gray">员工工号</td>
|
||||
<td>{$detail.job_number}</td>
|
||||
<td class="pdf-td-gray">社保号</td>
|
||||
<td>{$detail.social_account}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">工资卡开户行</td>
|
||||
<td>{$detail.bank_info}</td>
|
||||
<td class="pdf-td-gray">工资卡帐号</td>
|
||||
<td>{$detail.bank_account}</td>
|
||||
<td class="pdf-td-gray">公积金号</td>
|
||||
<td>{$detail.provident_account}</td>
|
||||
</tr>
|
||||
{notempty name="$edu"}
|
||||
<tr>
|
||||
<td colspan="6"><strong>教育经历</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<table class="pdf-min-table" style="margin:0">
|
||||
<tr>
|
||||
<td width="80" style="text-align:center;">开始时间</td>
|
||||
<td width="80" style="text-align:center;">结束时间</td>
|
||||
<td width="100" style="text-align:center;">就读院校</td>
|
||||
<td width="100" style="text-align:center;">学习专业</td>
|
||||
<td width="70" style="text-align:center;">所获学历</td>
|
||||
<td width="160" style="text-align:center;">备注说明</td>
|
||||
</tr>
|
||||
{volist name="$edu" id="v"}
|
||||
<tr class="edu_interfix">
|
||||
<td style="text-align:center;">{$v.start_time}</td>
|
||||
<td style="text-align:center;">{$v.end_time}</td>
|
||||
<td>{$v.title}</td>
|
||||
<td>{$v.speciality}</td>
|
||||
<td style="text-align:center;">{$v.education}</td>
|
||||
<td style="text-align:left;">{$v.remark}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$work"}
|
||||
<tr>
|
||||
<td colspan="6"><strong>工作经历</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<table class="pdf-min-table" style="margin:0">
|
||||
<tr>
|
||||
<td width="80" style="text-align:center;">开始时间</td>
|
||||
<td width="80" style="text-align:center;">结束时间</td>
|
||||
<td width="160" style="text-align:center;">公司名称</td>
|
||||
<td width="80" style="text-align:center;">职位</td>
|
||||
<td width="200" style="text-align:center;">备注说明</td>
|
||||
</tr>
|
||||
{volist name="$work" id="v"}
|
||||
<tr class="work_interfix">
|
||||
<td style="text-align:center;">{$v.start_time}</td>
|
||||
<td style="text-align:center;">{$v.end_time|default='至今'}</td>
|
||||
<td>{$v.title}</td>
|
||||
<td style="text-align:center;">{$v.position}</td>
|
||||
<td style="text-align:left;">{$v.remark}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$certificate"}
|
||||
<tr>
|
||||
<td colspan="6"><strong>相关证书</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<table class="pdf-min-table" style="margin:0">
|
||||
<tr>
|
||||
<td width="120" style="text-align:center;">证书名称</td>
|
||||
<td width="80" style="text-align:center;">获得时间</td>
|
||||
<td width="120" style="text-align:center;">颁发机构</td>
|
||||
<td width="200" style="text-align:center;">备注说明</td>
|
||||
</tr>
|
||||
{volist name="$certificate" id="v"}
|
||||
<tr class="certificate_interfix">
|
||||
<td>{$v.title}</td>
|
||||
<td style="text-align:center;">{$v.start_time}</td>
|
||||
<td>{$v.authority}</td>
|
||||
<td style="text-align:left;">{$v.remark}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$certificate"}
|
||||
<tr>
|
||||
<td colspan="6"><strong>计算机技能</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<table class="pdf-min-table" style="margin:0">
|
||||
<tr>
|
||||
<td width="160" style="text-align:center;">技能名称</td>
|
||||
<td width="80" style="text-align:center;">熟悉程度</td>
|
||||
<td width="200" style="text-align:center;">备注说明</td>
|
||||
</tr>
|
||||
{volist name="$skills" id="v"}
|
||||
<tr class="skills_interfix">
|
||||
<td>{$v.title}</td>
|
||||
<td style="text-align:center;">
|
||||
{eq name="$v.know" value="1"}熟练{/eq}
|
||||
{eq name="$v.know" value="2"}良好{/eq}
|
||||
{eq name="$v.know" value="3"}一般{/eq}
|
||||
{eq name="$v.know" value="4"}较差{/eq}
|
||||
</td>
|
||||
<td style="text-align:left;">{$v.remark}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$language"}
|
||||
<tr>
|
||||
<td colspan="6"><strong>语言能力</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<table class="pdf-min-table" style="margin:0">
|
||||
<tr>
|
||||
<td width="160" style="text-align:center;">语言名称</td>
|
||||
<td width="80" style="text-align:center;">熟悉程度</td>
|
||||
<td width="200" style="text-align:center;">备注说明</td>
|
||||
</tr>
|
||||
{volist name="$language" id="v"}
|
||||
<tr class="skills_interfix">
|
||||
<td>{$v.title}</td>
|
||||
<td style="text-align:center;">
|
||||
{eq name="$v.know" value="1"}熟练{/eq}
|
||||
{eq name="$v.know" value="2"}良好{/eq}
|
||||
{eq name="$v.know" value="3"}一般{/eq}
|
||||
{eq name="$v.know" value="4"}较差{/eq}
|
||||
</td>
|
||||
<td style="text-align:left;">{$v.remark}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="5">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="50%" style="text-align:left; font-size:11px;">导出人员:{$detail.pdf_admin}</td>
|
||||
<td width="50%" style="text-align:right; font-size:11px;">导出时间:{$detail.pdf_time}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,88 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>发票开票审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">开票金额</td>
|
||||
<td>{$detail.amount} 元</td>
|
||||
<td class="pdf-td-gray">开票类型</td>
|
||||
<td>
|
||||
{eq name="$detail.invoice_type" value="1"}增值税专用发票{/eq}
|
||||
{eq name="$detail.invoice_type" value="2"}普通发票{/eq}
|
||||
{eq name="$detail.invoice_type" value="3"}专业发票{/eq}
|
||||
</td>
|
||||
<td class="pdf-td-gray">开票主体</td>
|
||||
<td>{$detail.subject}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">抬头类型</td>
|
||||
<td>
|
||||
{eq name="$detail.types" value="1"}企业{/eq}
|
||||
{eq name="$detail.types" value="2"}个人{/eq}
|
||||
</td>
|
||||
<td class="pdf-td-gray">开票抬头</td>
|
||||
<td>{$detail.invoice_title}</td>
|
||||
<td class="pdf-td-gray">电话号码</td>
|
||||
<td>{$detail.invoice_phone}</td>
|
||||
</tr>
|
||||
{eq name="$detail.types" value="1"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">纳税人识别号</td>
|
||||
<td>{$detail.invoice_tax}</td>
|
||||
<td class="pdf-td-gray">开户行</td>
|
||||
<td>{$detail.invoice_bank}</td>
|
||||
<td class="pdf-td-gray">银行账号</td>
|
||||
<td>{$detail.invoice_account}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">银行营业网点</td>
|
||||
<td>{$detail.invoice_banking}</td>
|
||||
<td class="pdf-td-gray">地址</td>
|
||||
<td colspan="3">{$detail.invoice_address}</td>
|
||||
</tr>
|
||||
{/eq}
|
||||
{notempty name="$detail.contract_id"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">关联合同</td>
|
||||
<td colspan="5">{$detail.contract_name|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.project_id"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">关联项目</td>
|
||||
<td colspan="5">{$detail.project_name|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.remark"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">备注信息</td>
|
||||
<td colspan="5">{$detail.remark|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="5">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>无发票回款审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">预回款金额</td>
|
||||
<td>{$detail.amount} 元</td>
|
||||
<td class="pdf-td-gray">收款主体</td>
|
||||
<td colspan="3">{$detail.subject}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">付款主体</td>
|
||||
<td>
|
||||
{eq name="$detail.types" value="1"}企业{/eq}
|
||||
{eq name="$detail.types" value="2"}个人{/eq}
|
||||
</td>
|
||||
<td class="pdf-td-gray">付款方名称</td>
|
||||
<td>{$detail.invoice_title}</td>
|
||||
<td class="pdf-td-gray">纳税人识别号</td>
|
||||
<td>{$detail.invoice_tax}</td>
|
||||
</tr>
|
||||
{notempty name="$detail.contract_id"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">关联合同</td>
|
||||
<td colspan="5">{$detail.contract_name|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.project_id"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">关联项目</td>
|
||||
<td colspan="5">{$detail.project_name|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.remark"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">备注信息</td>
|
||||
<td colspan="5">{$detail.remark|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="5">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>请假审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">开始时间</td>
|
||||
<td>{$detail.start_date}</td>
|
||||
<td class="pdf-td-gray">结束时间</td>
|
||||
<td>{$detail.end_date}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">请假类型</td>
|
||||
<td>{$detail.types_name}</td>
|
||||
<td class="pdf-td-gray">请假天数</td>
|
||||
<td>共{$detail.duration|default=0}天</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">请假事由</td>
|
||||
<td colspan="3">{$detail.reason|default=''}</td>
|
||||
</tr>
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="3">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>借支审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">借支主题</td>
|
||||
<td>{$detail.title}</td>
|
||||
<td class="pdf-td-gray">借支企业主体</td>
|
||||
<td>{$detail.subject_name|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">借支类型</td>
|
||||
<td>
|
||||
{eq name="$detail.types" value="1"}日常备用金{/eq}
|
||||
{eq name="$detail.types" value="2"}项目预支款{/eq}
|
||||
</td>
|
||||
<td class="pdf-td-gray">借支编号</td>
|
||||
<td>{$detail.code}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">借支金额</td>
|
||||
<td>{$detail.cost} 元</td>
|
||||
<td class="pdf-td-gray">预计归还日期</td>
|
||||
<td>{$detail.plan_time|date='Y-m-d'}</td>
|
||||
</tr>
|
||||
{notempty name="$detail.project_id"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">关联项目</td>
|
||||
<td colspan="3">{$detail.ptname|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="3">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>会议纪要</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">会议时间</td>
|
||||
<td>{$detail.meeting_date|date='Y-m-d H:i'}</td>
|
||||
<td class="pdf-td-gray">主办部门</td>
|
||||
<td>{$detail.did_name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">主持人</td>
|
||||
<td>{$detail.anchor_name}</td>
|
||||
<td class="pdf-td-gray">记录人</td>
|
||||
<td>{$detail.recorder_name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">会议室</td>
|
||||
<td colspan="3">{$detail.room}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">参会人员</td>
|
||||
<td colspan="3">{$detail.join_names}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">会议主题</td>
|
||||
<td colspan="3">{$detail.title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">会议内容</td>
|
||||
<td colspan="3">{:nl2br($detail.content)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">下一步<br>工作计划</td>
|
||||
<td colspan="3">{:nl2br($detail.plans)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">参会人员签字</td>
|
||||
<td colspan="3">{$detail.sign_names}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">备注信息</td>
|
||||
<td colspan="3">{:nl2br($detail.remarks)}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="50%" style="text-align:left; font-size:11px;">导出人员:{$detail.pdf_admin}</td>
|
||||
<td width="50%" style="text-align:right; font-size:11px;">导出时间:{$detail.pdf_time}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>会议室预定</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">会议主题</td>
|
||||
<td>{$detail.title|default=''}</td>
|
||||
<td class="pdf-td-gray">会议地点</td>
|
||||
<td>{$detail.room|default=''}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">开始时间</td>
|
||||
<td>{$detail.start_time|default=''}</td>
|
||||
<td class="pdf-td-gray">结束时间</td>
|
||||
<td>{$detail.end_time|default=''}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">会议人数</td>
|
||||
<td colspan="3">{$detail.num}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">会议需求</td>
|
||||
<td colspan="3">
|
||||
{volist name="$detail.requirements_array" id="v"}
|
||||
{eq name="$v.checked" value="1" }<span style="margin-right:16px;">{$v.title}</span>{/eq}
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">其他要求</td>
|
||||
<td colspan="3">{$detail.remark|default=''}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>公文审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">公文名称</td>
|
||||
<td colspan="3">{$detail.title|default='-'}</td>
|
||||
<td class="pdf-td-gray">公文文号</td>
|
||||
<td>{$detail.code|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">拟稿人</td>
|
||||
<td>{$detail.draft_name}</td>
|
||||
<td class="pdf-td-gray">拟稿部门</td>
|
||||
<td>{$detail.draft_dame|default='-'}</td>
|
||||
<td class="pdf-td-gray">拟稿日期</td>
|
||||
<td>{$detail.draft_time|date='Y-m-d'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">主送人员</td>
|
||||
<td>{$detail.send_names}</td>
|
||||
<td class="pdf-td-gray">抄送人员</td>
|
||||
<td colspan="3">{$detail.copy_names|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">共享可查阅人</td>
|
||||
<td>{$detail.share_names|default='-'}</td>
|
||||
<td class="pdf-td-gray">密级程度</td>
|
||||
<td>
|
||||
{eq name="$detail.secrets" value="1"}公开{/eq}
|
||||
{eq name="$detail.secrets" value="2"}秘密{/eq}
|
||||
{eq name="$detail.secrets" value="3"}机密{/eq}
|
||||
</td>
|
||||
<td class="pdf-td-gray">紧急程度</td>
|
||||
<td>
|
||||
{eq name="$detail.urgency" value="1"}普通{/eq}
|
||||
{eq name="$detail.urgency" value="2"}紧急{/eq}
|
||||
{eq name="$detail.urgency" value="3"}加急{/eq}
|
||||
</td>
|
||||
</tr>
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="5">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>外出审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">开始时间</td>
|
||||
<td>{$detail.start_date}</td>
|
||||
<td class="pdf-td-gray">结束时间</td>
|
||||
<td>{$detail.end_date}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">外出天数</td>
|
||||
<td colspan="3">共{$detail.duration|default=0}天</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">外出事由</td>
|
||||
<td colspan="3">{$detail.reason|default=''}</td>
|
||||
</tr>
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="3">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>加班审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">开始时间</td>
|
||||
<td>{$detail.start_date}</td>
|
||||
<td class="pdf-td-gray">结束时间</td>
|
||||
<td>{$detail.end_date}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">加班时长</td>
|
||||
<td colspan="3">共{$detail.duration|default=0}小时</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">加班事由</td>
|
||||
<td colspan="3">{$detail.reason|default=''}</td>
|
||||
</tr>
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="3">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,46 @@
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray" colspan="6" style="text-align:center;"><strong>审批信息</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">申请人</td>
|
||||
<td>{$detail.admin_name} ({$detail.department})</td>
|
||||
<td class="pdf-td-gray">申请时间</td>
|
||||
<td colspan="3">{$detail.create_time|date='Y-m-d H:i:s'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">审核状态</td>
|
||||
<td>{$detail.check_status_str}</td>
|
||||
<td class="pdf-td-gray">抄送人</td>
|
||||
<td colspan="3">{$detail.check_copy_names|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray" colspan="6" style="text-align:center;"><strong>审批记录</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray" style="text-align:center;">审批节点</td>
|
||||
<td class="pdf-td-gray" style="text-align:center;width:162px;">审批时间</td>
|
||||
<td class="pdf-td-gray" style="text-align:center;">处理人</td>
|
||||
<td class="pdf-td-gray" style="text-align:center;" colspan="3">审批意见</td>
|
||||
</tr>
|
||||
{notempty name="$detail.check_record_array"}
|
||||
{volist name="$detail.check_record_array" id="vo"}
|
||||
<tr>
|
||||
<td style="text-align:center;">{$vo.status_str}</td>
|
||||
<td style="text-align:center;">{$vo.check_time_str}</td>
|
||||
<td style="text-align:center;">{$vo.name}</td>
|
||||
<td style="text-align:left;" colspan="3">{$vo.content}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{else/}
|
||||
<tr>
|
||||
<td colspan="6" style="text-align:center;">暂无审批记录</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="50%" style="text-align:left; font-size:11px;">导出人员:{$detail.pdf_admin}</td>
|
||||
<td width="50%" style="text-align:right; font-size:11px;">导出时间:{$detail.pdf_time}</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,53 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>离职审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">离职员工</td>
|
||||
<td>{$detail.name|default='-'}</td>
|
||||
<td class="pdf-td-gray">所在部门</td>
|
||||
<td>{$detail.department|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">离职日期</td>
|
||||
<td>{$detail.quit_time}</td>
|
||||
<td class="pdf-td-gray">上级领导</td>
|
||||
<td>{$detail.lead_admin_name|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">资料接受人</td>
|
||||
<td>{$detail.connect_name|default='-'}</td>
|
||||
<td class="pdf-td-gray">参与交接人员</td>
|
||||
<td>{$detail.connect_names|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">离职原因</td>
|
||||
<td colspan="3">{:nl2br($detail.remark)}</td>
|
||||
</tr>
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="3">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,159 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
.pdf-min-table{width:100%;border:1px solid #333333; border-collapse: collapse;overflow: wrap}
|
||||
.pdf-min-table td{border:1px solid #333333;border-collapse: collapse; padding:6px; line-height:1.5;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>采购合同审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">合同名称</td>
|
||||
<td colspan="3">{$detail.name}</td>
|
||||
<td class="pdf-td-gray">合同编号</td>
|
||||
<td>{$detail.code}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">签约主体<br>(甲方)</td>
|
||||
<td colspan="3">{$detail.subject_title}</td>
|
||||
<td class="pdf-td-gray-2">合同始止日期</td>
|
||||
<td>{$detail.start_time} 至 {$detail.end_time}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">供应商名称<br>(乙方)</td>
|
||||
<td colspan="3">{$detail.supplier}</td>
|
||||
<td class="pdf-td-gray">供应商代表</td>
|
||||
<td>{$detail.contact_name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray-2">供应商地址</td>
|
||||
<td colspan="3">{$detail.contact_address|default='-'}</td>
|
||||
<td class="pdf-td-gray">供应商电话</td>
|
||||
<td>{$detail.contact_mobile|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">合同金额</td>
|
||||
<td>{$detail.cost} 元</td>
|
||||
<td class="pdf-td-gray">合同性质</td>
|
||||
<td>{$detail.types_name}</td>
|
||||
<td class="pdf-td-gray">合同类别</td>
|
||||
<td>{$detail.cate_title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">合同签订人</td>
|
||||
<td>{$detail.sign_name}</td>
|
||||
<td class="pdf-td-gray">合同所属部门</td>
|
||||
<td>{$detail.sign_department}</td>
|
||||
<td class="pdf-td-gray">合同签订日期</td>
|
||||
<td>{$detail.sign_time}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">合同制定人</td>
|
||||
<td>{$detail.prepared_name|default='-'}</td>
|
||||
<td class="pdf-td-gray">合同保管人</td>
|
||||
<td>{$detail.keeper_name|default='-'}</td>
|
||||
<td class="pdf-td-gray">合同共享人员</td>
|
||||
<td>{$detail.share_names|default='-'}</td>
|
||||
</tr>
|
||||
{eq name="$detail.types" value="2"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray" colspan="6" style="text-align:center;"><strong>产品信息</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<table class="pdf-min-table" style="margin:0">
|
||||
<tr>
|
||||
<td width="200" style="text-align:center;">物品名称</td>
|
||||
<td width="60" style="text-align:center;">单位</td>
|
||||
<td width="90" style="text-align:center;">规格</td>
|
||||
<td width="90" style="text-align:center;">采购单价(元)</td>
|
||||
<td width="60" style="text-align:center;">数量</td>
|
||||
<td width="80" style="text-align:center;">小计(元)</td>
|
||||
<td width="200" style="text-align:center;">备注信息</td>
|
||||
</tr>
|
||||
{empty name="$detail.content_array"}
|
||||
<tr>
|
||||
<td colspan="7" style="padding:6px; text-align:center; color:#999">暂无物品信息</td>
|
||||
</tr>
|
||||
{else/}
|
||||
{volist name="$detail.content_array" id="vo"}
|
||||
<tr>
|
||||
<td style="text-align:left;">{$vo.purchased_title|default=''}</td>
|
||||
<td style="text-align:center;">{$vo.purchased_unit|default=''}</td>
|
||||
<td style="text-align:center;">{$vo.purchased_specs|default=''}</td>
|
||||
<td style="text-align:center;">{$vo.purchased_price|default='0.00'}</td>
|
||||
<td style="text-align:center;">{$vo.purchased_num|default='1'}</td>
|
||||
<td style="text-align:center;">{$vo.purchased_subtotal|default='0.00'}</td>
|
||||
<td style="text-align:left;">{$vo.purchased_remark|default=''}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{/empty}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/eq}
|
||||
{eq name="$detail.types" value="3"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray" colspan="6" style="text-align:center;"><strong>服务信息</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<table class="pdf-min-table" style="margin:0">
|
||||
<tr>
|
||||
<td width="110" style="text-align:center;">服务名称</td>
|
||||
<td width="160" style="text-align:center;">服务周期</td>
|
||||
<td width="90" style="text-align:center;">服务单价(元)</td>
|
||||
<td width="70" style="text-align:center;">服务次数</td>
|
||||
<td width="80" style="text-align:center;">小计(元)</td>
|
||||
<td width="100" style="text-align:center;">备注信息</td>
|
||||
</tr>
|
||||
{empty name="$detail.content_array"}
|
||||
<tr>
|
||||
<td colspan="6" style="padding:6px text-align:center; color:#999">暂无服务信息</td>
|
||||
</tr>
|
||||
{else/}
|
||||
{volist name="$detail.content_array" id="vo"}
|
||||
<tr>
|
||||
<td style="text-align:left;">{$vo.service_title|default=''}</td>
|
||||
<td style="text-align:center;">{$vo.service_date|default=''}</td>
|
||||
<td style="text-align:center;">{$vo.service_price|default='0.00'}</td>
|
||||
<td style="text-align:center;">{$vo.service_num|default='1'}</td>
|
||||
<td style="text-align:center;">{$vo.service_subtotal|default='0.00'}</td>
|
||||
<td style="text-align:left;">{$vo.service_remark|default=''}</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{/empty}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/eq}
|
||||
{notempty name="$detail.remark"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">备注信息</td>
|
||||
<td colspan="5">{$detail.remark|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="5">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>用章使用审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">审批主题</td>
|
||||
<td colspan="3">{$detail.title|default='-'}</td>
|
||||
<td class="pdf-td-gray">印章类型</td>
|
||||
<td>{$detail.seal_cate|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">盖章次数</td>
|
||||
<td>{$detail.num}</td>
|
||||
<td class="pdf-td-gray">用印部门</td>
|
||||
<td>{$detail.use_dname|default='-'}</td>
|
||||
<td class="pdf-td-gray">预期用印日期</td>
|
||||
<td>{$detail.use_time|date='Y-m-d'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">印章是否外借</td>
|
||||
<td>
|
||||
{eq name="$detail.is_borrow" value="0"}否{/eq}
|
||||
{eq name="$detail.is_borrow" value="1"}是{/eq}
|
||||
</td>
|
||||
<td class="pdf-td-gray">印章借用日期</td>
|
||||
<td>{$detail.start_time|default='-'}</td>
|
||||
<td class="pdf-td-gray">结束借用日期</td>
|
||||
<td>{$detail.end_time|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray" style="vertical-align:top;">盖章内容</td>
|
||||
<td colspan="5">{:nl2br($detail.content)}</td>
|
||||
</tr>
|
||||
{eq name="detail.check_status" value="2"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">用章状态</td>
|
||||
<td colspan="5">{$detail.status_str}</td>
|
||||
</tr>
|
||||
{/eq}
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="5">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,136 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>入职审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td colspan="6"><strong>基本信息</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">员工姓名</td>
|
||||
<td>{$detail.name|default='-'}</td>
|
||||
<td class="pdf-td-gray">性别</td>
|
||||
<td colspan="2">
|
||||
{eq name="$detail.sex" value="1"}男{/eq}
|
||||
{eq name="$detail.sex" value="2"}女{/eq}
|
||||
</td>
|
||||
<td rowspan="5" valign="top" style="width:112px;">
|
||||
<img src="{{:get_file($detail.thumb)}" width="110" height="156" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">手机号码</td>
|
||||
<td>{$detail.mobile|default=''}</td>
|
||||
<td class="pdf-td-gray">电子邮箱</td>
|
||||
<td colspan="2">{$detail.email|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">出生日期</td>
|
||||
<td>{$detail.birthday|default='-'}</td>
|
||||
<td class="pdf-td-gray">身份证号码</td>
|
||||
<td colspan="2">{$detail.idcard|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">民族</td>
|
||||
<td>{$detail.nation|default='-'}</td>
|
||||
<td class="pdf-td-gray">籍贯</td>
|
||||
<td colspan="2">{$detail.native_place|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">政治面貌</td>
|
||||
<td>
|
||||
{eq name="$detail.political" value="0"}无{/eq}
|
||||
{eq name="$detail.political" value="1"}中共党员{/eq}
|
||||
{eq name="$detail.political" value="2"}共青团员{/eq}
|
||||
</td>
|
||||
<td class="pdf-td-gray">婚姻状况</td>
|
||||
<td colspan="2">
|
||||
{eq name="$detail.marital_status" value="1"}未婚{/eq}
|
||||
{eq name="$detail.marital_status" value="2"}已婚{/eq}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">户口性质</td>
|
||||
<td>
|
||||
{eq name="$detail.resident_type" value="1"}农村户口{/eq}
|
||||
{eq name="$detail.resident_type" value="2"}城镇户口{/eq}
|
||||
</td>
|
||||
<td class="pdf-td-gray">户口所在地</td>
|
||||
<td colspan="3">{$detail.resident_place|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">家庭住址</td>
|
||||
<td colspan="3">{$detail.home_address|default='-'}</td>
|
||||
<td class="pdf-td-gray">紧急联系人</td>
|
||||
<td>{$detail.contact|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">现住地址</td>
|
||||
<td colspan="3">{$detail.current_address|default='-'}</td>
|
||||
<td class="pdf-td-gray">紧急联系电话</td>
|
||||
<td>{$detail.contact_mobile|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">个人简介</td>
|
||||
<td colspan="5">{$detail.desc|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6"><strong>教育信息</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">毕业院校</td>
|
||||
<td colspan="3">{$detail.graduate_school|default='-'}</td>
|
||||
<td class="pdf-td-gray">毕业日期</td>
|
||||
<td>{$detail.graduate_day|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">专业</td>
|
||||
<td colspan="3">{$detail.speciality|default='-'}</td>
|
||||
<td class="pdf-td-gray">最高学位</td>
|
||||
<td>{$detail.education|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6"><strong>入职信息</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">入职部门</td>
|
||||
<td>{$detail.department|default='-'}</td>
|
||||
<td class="pdf-td-gray">上级主管</td>
|
||||
<td>{$detail.pname|default='-'}</td>
|
||||
<td class="pdf-td-gray">入职时间</td>
|
||||
<td>{$detail.entry_time|default='-'}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">岗位职称</td>
|
||||
<td>{$detail.position|default='-'}</td>
|
||||
<td class="pdf-td-gray">职务</td>
|
||||
<td>{$detail.position_name_str|default='-'}</td>
|
||||
<td class="pdf-td-gray">职级</td>
|
||||
<td>{$detail.position_rank_str|default='-'}</td>
|
||||
</tr>
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="3">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>收票审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">发票金额</td>
|
||||
<td>{$detail.amount} 元</td>
|
||||
<td class="pdf-td-gray">发票类型</td>
|
||||
<td>
|
||||
{eq name="$detail.invoice_type" value="1"}增值税专用发票{/eq}
|
||||
{eq name="$detail.invoice_type" value="2"}普通发票{/eq}
|
||||
{eq name="$detail.invoice_type" value="3"}专业发票{/eq}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">发票抬头</td>
|
||||
<td>{$detail.subject}</td>
|
||||
<td class="pdf-td-gray">开票主体</td>
|
||||
<td>{$detail.supplier_name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">发票号码</td>
|
||||
<td>{$detail.code}</td>
|
||||
<td class="pdf-td-gray">发票日期</td>
|
||||
<td>{$detail.open_time}</td>
|
||||
</tr>
|
||||
{notempty name="$detail.purchase_id"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">关联合同</td>
|
||||
<td colspan="3">{$detail.purchase_name|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.project_id"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">关联项目</td>
|
||||
<td colspan="3">{$detail.project_name|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.remark"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">备注信息</td>
|
||||
<td colspan="3">{$detail.remark|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="3">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>无发票付款审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">预付款金额</td>
|
||||
<td>{$detail.amount} 元</td>
|
||||
<td class="pdf-td-gray">付款方</td>
|
||||
<td>{$detail.subject}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">收款方</td>
|
||||
<td colspan="3">{$detail.supplier_name}</td>
|
||||
</tr>
|
||||
{notempty name="$detail.purchase_id"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">关联合同</td>
|
||||
<td colspan="3">{$detail.purchase_name|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.project_id"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">关联项目</td>
|
||||
<td colspan="3">{$detail.project_name|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.remark"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">备注信息</td>
|
||||
<td colspan="3">{$detail.remark|default='-'}</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="3">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>导出PDF</title>
|
||||
<style>
|
||||
body {color: #333333; font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif; font-size: 13px;line-height: 1.5; word-wrap: break-word;}
|
||||
h2{text-align:center;padding:0;margin:0; font-size:18px;height:39px;}
|
||||
.pdf-table{border:1px solid #333333; border-collapse: collapse;width:100%}
|
||||
.pdf-table td{border:1px solid #333333;border-collapse: collapse; padding:5px; line-height:1.5;}
|
||||
.pdf-td-gray{background-color:#f5f5f5; text-align:right; width:90px;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>出差审批单</h2>
|
||||
<table class="pdf-table">
|
||||
<tr>
|
||||
<td class="pdf-td-gray">开始时间</td>
|
||||
<td>{$detail.start_date}</td>
|
||||
<td class="pdf-td-gray">结束时间</td>
|
||||
<td>{$detail.end_date}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">出差天数</td>
|
||||
<td colspan="3">共{$detail.duration|default=0}天</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pdf-td-gray">出差事由</td>
|
||||
<td colspan="3">{$detail.reason|default=''}</td>
|
||||
</tr>
|
||||
{notempty name="$detail.file_array"}
|
||||
<tr>
|
||||
<td class="pdf-td-gray">相关附件</td>
|
||||
<td colspan="3">
|
||||
{volist name="$detail.file_array" id="vo"}
|
||||
<div>{$i}、{$vo.name}</div>
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
{/notempty}
|
||||
</table>
|
||||
{include file="export/pdf_check" /}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
|
||||
<link rel="mobile-prefetch" href=""/>
|
||||
<title>文档信息</title>
|
||||
</head>
|
||||
<body style="width:100%;height:100vh; margin:0; padding:0">
|
||||
<iframe src="//view.officeapps.live.com/op/view.aspx?src={$url}" frameborder="0" align="left" width="100%" height="100%" scrolling="yes"></iframe>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,72 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
|
||||
<link rel="mobile-prefetch" href=""/>
|
||||
<title>文档信息</title>
|
||||
<script type="text/javascript" src="{$office.onlyoffice}/web-apps/apps/api/documents/api.js"></script>
|
||||
</head>
|
||||
<body style="width:100%;height:100vh; margin:0; padding:0">
|
||||
<div id="placeholder"></div>
|
||||
<script type="text/javascript">
|
||||
const url = "{$url}";
|
||||
const word = ['djvu','doc','docm','docx','docxf','dot','dotm','dotx','epub','fb2','fodt','htm','html','mht','mhtml','odt','oform','ott','oxps','pdf','rtf','stw','sxw','txt','wps','wpt','xml','xps'];
|
||||
const cell = ['csv','et','ett','fods','ods','ots','sxc','xls','xlsb','xlsm','xlsx','xlt','xltm','xltx','xml'];
|
||||
const slide = ['dps','dpt','fodp','odp','otp','pot','potm','potx','pps','ppsm','ppsx','ppt','pptm','pptx','sxi'];
|
||||
|
||||
let suffix = url.split('.').pop();
|
||||
let documentType = "word";
|
||||
if (cell.indexOf(suffix) !== -1) {
|
||||
documentType = "cell";
|
||||
}
|
||||
if (slide.indexOf(suffix) !== -1) {
|
||||
documentType = "slide";
|
||||
}
|
||||
new DocsAPI.DocEditor("placeholder", {
|
||||
"type" : "desktop",
|
||||
"documentType" : documentType,//word,cell,side
|
||||
"document" : {
|
||||
"title" : "{$title}",
|
||||
"url" : url,
|
||||
"key" : "{$key}",
|
||||
//"fileType" : "doc",
|
||||
"permissions" : {
|
||||
"chat": true,
|
||||
"comment": true,
|
||||
"copy": true,
|
||||
"deleteCommentAuthorOnly": false,
|
||||
"download": true,
|
||||
"edit": true,
|
||||
"editCommentAuthorOnly": false,
|
||||
"fillForms": true,
|
||||
"modifyContentControl": true,
|
||||
"modifyFilter": true,
|
||||
"print": true,
|
||||
"protect": true,
|
||||
"review": true
|
||||
}
|
||||
},
|
||||
"editorConfig":{
|
||||
"lang":"zh-CN",
|
||||
"mode" : "{$mode}",//view,edit
|
||||
"forcesave":true,
|
||||
"createUrl" : "",
|
||||
"customization": {
|
||||
"autosave": true,//是否自动保存
|
||||
"comments": false,
|
||||
"help": false
|
||||
},
|
||||
"user" : {
|
||||
"id" : "{$admin.id}",
|
||||
"name" :"{$admin.name}"
|
||||
},
|
||||
"callbackUrl":"{$callbackUrl}"
|
||||
},
|
||||
"token": "{$token}"
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user