提交 11af9747 authored 作者: wangkr's avatar wangkr

update

上级 8907a146
...@@ -12,7 +12,7 @@ ini_set('session.save_handler', 'redis'); ...@@ -12,7 +12,7 @@ ini_set('session.save_handler', 'redis');
ini_set('session.save_path', 'tcp://192.168.1.222:6379'); ini_set('session.save_path', 'tcp://192.168.1.222:6379');
ini_set('session.cookie_path', '/'); ini_set('session.cookie_path', '/');
ini_set('session.cookie_domain', 'gonn.com.cn'); ini_set('session.cookie_domain', 'gonn.com.cn');
ini_set('session.cookie_lifetime', '1800'); ini_set('session.cookie_lifetime', '7200');
@session_start(); @session_start();
if(function_exists('date_default_timezone_set'))date_default_timezone_set('Asia/Shanghai'); //设置默认时区 if(function_exists('date_default_timezone_set'))date_default_timezone_set('Asia/Shanghai'); //设置默认时区
......
...@@ -25,3 +25,12 @@ ...@@ -25,3 +25,12 @@
客户名称:易电务(北京)科技有限公司保存接口失败 客户编号:CUST24050保存接口成功 执行时间:1.4224369525909 s 客户名称:易电务(北京)科技有限公司保存接口失败 客户编号:CUST24050保存接口成功 执行时间:1.4224369525909 s
客户编号:CUST24050提交接口成功 执行时间:0.11602902412415 s 客户编号:CUST24050提交接口成功 执行时间:0.11602902412415 s
客户编号:CUST24050审核接口成功 执行时间:0.18425989151001 s 客户编号:CUST24050审核接口成功 执行时间:0.18425989151001 s
客户编号:CUST24051保存接口成功 执行时间:2.1835269927979 s
客户编号:CUST24051提交接口成功 执行时间:0.084365844726562 s
客户编号:CUST24051审核接口成功 执行时间:0.15912199020386 s
客户编号:CUST24052保存接口成功 执行时间:4.1266798973083 s
客户编号:CUST24052提交接口成功 执行时间:0.37966990470886 s
客户编号:CUST24052审核接口成功 执行时间:0.15844106674194 s
客户编号:CUST24053保存接口成功 执行时间:4.3511328697205 s
客户编号:CUST24053提交接口成功 执行时间:0.45927286148071 s
客户编号:CUST24053审核接口成功 执行时间:0.14415597915649 s
...@@ -119,4 +119,21 @@ ...@@ -119,4 +119,21 @@
供应商编号:VEN04996保存接口成功 执行时间:0.3246431350708 s 供应商编号:VEN04996保存接口成功 执行时间:0.3246431350708 s
供应商编号:VEN04996提交接口成功 执行时间:0.059867143630981 s 供应商编号:VEN04996提交接口成功 执行时间:0.059867143630981 s
供应商编号:VEN04996审核接口成功 执行时间:0.097572088241577 s 供应商编号:VEN04996审核接口成功 执行时间:0.097572088241577 s
供应商名称:北京敬美定建材经营部保存接口失败 供应商名称:北京敬美定建材经营部保存接口失败 供应商名称:北京海科之园园林绿化有限公司保存接口失败 供应商编号:VEN04999保存接口成功 执行时间:0.35171103477478 s
\ No newline at end of file 供应商编号:VEN04999提交接口成功 执行时间:1.264858007431 s
供应商编号:VEN04999审核接口成功 执行时间:0.16371202468872 s
供应商名称:北京盘天地信息技术有限公司保存接口失败 供应商名称:北京英创嘉友知识产权代理事务所保存接口失败 解析字段(Key:注册资金(万元),name:FRegisterFund)时发生异常,异常信息:解析字段(Key:注册资金(万元),name:FRegisterFund)时发生异常,异常信息:输入字符串的格式不正确。 在 Kingdee.BOS.WebApi.FormService.MapPropertyService.MapComplexProperty(String pkProperty, Dictionary`2 sourceObj, DynamicObject targetObj, Int32 rowIndex, HashSet`1 NeedUpDateFields)
在 Kingdee.BOS.WebApi.FormService.Save.Revole()
在 Kingdee.BOS.WebApi.FormService.Save.Execute()
在 Kingdee.BOS.WebApi.FormService.BillOperationService.ExecuteOperation(FormOperation op, String data)供应商编号:VEN05001保存接口成功 执行时间:3.0436930656433 s
供应商编号:VEN05001提交接口成功 执行时间:1.258975982666 s
供应商编号:VEN05001审核接口成功 执行时间:0.17937803268433 s
供应商名称:北京万航博通科技有限公司保存接口失败 供应商编号:VEN05003保存接口成功 执行时间:0.34562993049622 s
供应商编号:VEN05003提交接口成功 执行时间:1.2431640625 s
供应商编号:VEN05003审核接口成功 执行时间:0.23087501525879 s
供应商编号:VEN05004保存接口成功 执行时间:0.31795811653137 s
供应商编号:VEN05004提交接口成功 执行时间:0.062644004821777 s
供应商编号:VEN05004审核接口成功 执行时间:0.10247111320496 s
供应商名称:中铁六局集团电务工程有限公司保存接口失败 供应商编号:VEN05006保存接口成功 执行时间:1.6346430778503 s
供应商编号:VEN05006提交接口成功 执行时间:1.1099901199341 s
供应商编号:VEN05006审核接口成功 执行时间:0.17360591888428 s
...@@ -18,6 +18,9 @@ class inputAction extends Action ...@@ -18,6 +18,9 @@ class inputAction extends Action
private $fieldarr = array(); private $fieldarr = array();
private $ismobile = 0; private $ismobile = 0;
private $subdata = []; //子表数据
private $maindata = [];
protected $moders = array(); protected $moders = array();
...@@ -188,6 +191,9 @@ class inputAction extends Action ...@@ -188,6 +191,9 @@ class inputAction extends Action
//判断保存前的 //判断保存前的
$ss = ''; $ss = '';
$befa = $this->savebefore($table, $this->getsavenarr($uaarr, $oldrs), $id, $addbo); $befa = $this->savebefore($table, $this->getsavenarr($uaarr, $oldrs), $id, $addbo);
$this->maindata = $this->getsavenarr($uaarr, $oldrs); //缓存主表数据
$notsave= array();//不保存的字段 $notsave= array();//不保存的字段
if(is_string($befa)){ if(is_string($befa)){
$ss = $befa; $ss = $befa;
...@@ -248,6 +254,8 @@ class inputAction extends Action ...@@ -248,6 +254,8 @@ class inputAction extends Action
//保存后处理 //保存后处理
$this->saveafter($table,$this->getsavenarr($uaarr, $oldrs), $id, $addbo); $this->saveafter($table,$this->getsavenarr($uaarr, $oldrs), $id, $addbo);
$this->record($id); //保存日志
//保存修改记录 //保存修改记录
$editcont = ''; $editcont = '';
if($oldrs){ if($oldrs){
...@@ -259,9 +267,19 @@ class inputAction extends Action ...@@ -259,9 +267,19 @@ class inputAction extends Action
$this->flow->loaddata($id, false); $this->flow->loaddata($id, false);
$this->flow->submit($subna); $this->flow->submit($subna);
$this->backmsg('', $subna, $id); $this->backmsg('', $subna, $id);
} }
private function record($id){
$type = empty($id) ? '插入数据' : '修改数据';
$data['main'] = $this->maindata;
$data['sub'] = $this->subdata;
$data = json_encode($data);
m('log')->addlog($type,$data,[]);
}
private function getsavenarr($nsrr, $bos=false) private function getsavenarr($nsrr, $bos=false)
{ {
if(!is_array($bos))$bos = array(); if(!is_array($bos))$bos = array();
...@@ -315,6 +333,8 @@ class inputAction extends Action ...@@ -315,6 +333,8 @@ class inputAction extends Action
$idss = '0'; $idss = '0';
$whes = ''; $whes = '';
$this->subdata[$tables] = $data; //缓存子表数据
$allfields = $this->db->getallfields('[Q]'.$tables.''); $allfields = $this->db->getallfields('[Q]'.$tables.'');
$oarray = array(); $oarray = array();
if(in_array('optdt', $allfields))$oarray['optdt'] = $this->now; if(in_array('optdt', $allfields))$oarray['optdt'] = $this->now;
...@@ -336,7 +356,6 @@ class inputAction extends Action ...@@ -336,7 +356,6 @@ class inputAction extends Action
$uaarr['mid'] = $mid; $uaarr['mid'] = $mid;
if($sid==0)$where = ''; if($sid==0)$where = '';
foreach($oarray as $k1=>$v1)$uaarr[$k1]=$v1; foreach($oarray as $k1=>$v1)$uaarr[$k1]=$v1;
$dbs->record($uaarr, $where); $dbs->record($uaarr, $where);
if($sid==0)$sid = $this->db->insert_id(); if($sid==0)$sid = $this->db->insert_id();
$idss.=','.$sid.''; $idss.=','.$sid.'';
......
<?php
class inputAction extends Action
{
public $mid = 0;
public $flow;
public $rs = array();
public function initAction()
{
/*
$aid = (int)$this->get('adminid');
$token = $this->get('token');
$uid = m('login')->autologin($aid, $token);
$this->getlogin();
$this->loginnot();*/
}
private $fieldarr = array();
private $ismobile = 0;
protected $moders = array();
//保存前处理,主要用于判断是否可以保存
protected function savebefore($table,$arr, $id, $addbo){}
//保存后处理,主要用于判断是否可以保存
protected function saveafter($table,$arr, $id, $addbo){}
//子表保存前的处理
protected function savesubbefore($data,$tables){return $data;}
//生成列表页,数据读取前处理
protected function storebefore($table){}
//生成列表页,数据读取后处理
protected function storeafter($table, $rows){}
//过滤html代码
private function xxsstolt($uaarr)
{
foreach($uaarr as $k=>$v){
$vss = strtolower($v);
if(contain($vss, '<script')){
$uaarr[$k] = str_replace(array('<','>'),array('&lt;','&gt;'), $v);
}
}
return $uaarr;
}
/**
* 录入的保存
*/
public function saveAjax()
{
$id = (int)$this->request('id');
$modenum = $this->request('sysmodenum');
$uid = $this->adminid;
$this->flow = m('flow')->initflow($modenum);
$this->moders = $this->flow->moders;
$modeid = $this->moders['id'];
$isflow = (int)$this->moders['isflow'];
$flownum = $this->moders['num'];
$table = $this->moders['table'];
$sysisturn = (int)$this->post('istrun','1');
$checkobj = c('check');
if($this->isempt($table))$this->backmsg('模块未设置表名');
$fieldsarr = array();
$fiexar = $this->flow->flowfieldarr($this->flow->fieldsarra, 2);
foreach($fiexar as $k2=>$rs2)if($rs2['islu']==1)$fieldsarr[]=$rs2;
if(!$fieldsarr)$this->backmsg('没有录入元素');
$db = m($table);$subna = '提交';$addbo = false;$where = "`id`='$id'"; $oldrs = false;
$this->mdb = $db;
if($id==0){
$where = '';
$addbo = true;
$isadd = m('view')->isadd($modeid, $uid);
if(!$isadd)$this->backmsg('无权添加['.$this->moders['name'].']的数据1;');
}else{
$oldrs = $db->getone($id);
if(!$oldrs)$this->backmsg('记录不存在');
$this->flow->loaddata($id);
if(!$this->flow->iseditqx())
$this->backmsg('无权编辑['.$this->moders['name'].']的数据;');
if($isflow>0){
if($oldrs['uid']==$uid || $oldrs['optid']==$uid || $this->flow->floweditother){
}else{
$this->backmsg('不是你提交/申请的单据,不允许编辑');
}
if($oldrs['status']==1)$this->backmsg('单据已审核完成,不允许编辑');
}
$subna = '编辑';
}
if($oldrs)$this->rs = $oldrs;
$uaarr = $farrs = array();
$lvls = array('textarea','htmlediter');
foreach($fieldsarr as $k=>$rs){
$fid = $rs['fields'];
$fi1 = substr($fid, 0, 5);
if($fi1=='temp_' || $fi1=='base_')continue;
$val = $this->post($fid);
if($rs['isbt']==1 && isempt($val))$this->backmsg(''.$rs['name'].'不能为空');
if(!isempt($val) && $rs['fieldstype']=='email'){
if(!$checkobj->isemail($val))$this->backmsg(''.$rs['name'].'格式不对');
}
//if(!in_array($rs['fieldstype'], $lvls))$val = htmlspecialchars($val);
$uaarr[$fid] = $val;
$farrs[$fid] = array('name' => $rs['name']);
}
//人员选择保存的
$otherfileid = '';
foreach($fieldsarr as $k=>$rs){
if(substr($rs['fieldstype'],0,6)=='change'){
if(!$this->isempt($rs['data'])){
$fid = $rs['data'];
if(isset($uaarr[$fid]))continue;
$val = $this->post($fid);
if($rs['isbt']==1&&$this->isempt($val))$this->backmsg(''.$rs['name'].'id不能为空');
$uaarr[$fid] = $val;
$farrs[$fid] = array('name' => $rs['name'].'id');
}
}
if($rs['fieldstype']=='num'){
$fid = $rs['fields'];
if($this->flow->rows("`$fid`='{$uaarr[$fid]}' and `id`<>$id")>0)$uaarr[$fid]=$this->flow->createbianhao($rs['data'], $fid);
}
if($rs['fieldstype']=='uploadfile'){
$_val= arrvalue($uaarr, $rs['fields']);
if(!isempt($_val))$otherfileid.=','.$_val.'';
}
}
//默认字段保存
$allfields = $this->db->getallfields('[Q]'.$table.'');
if(in_array('optdt', $allfields))$uaarr['optdt'] = $this->now;
if(in_array('optid', $allfields))$uaarr['optid'] = $this->adminid;
if(in_array('optname', $allfields))$uaarr['optname'] = $this->adminname;
if(in_array('uid', $allfields) && $addbo){
$uaarr['uid'] = $this->post('uid', $this->adminid);
}
if(isset($uaarr['uid'])){
$urs = $this->flow->adminmodel->getone($uaarr['uid']);
in_array('applyname', $allfields) and $uaarr['applyname'] = $urs['name'];
in_array('applydeptname', $allfields) and $uaarr['applydeptname'] = $urs['deptname'];
}
if(in_array('applydt', $allfields) && $id==0)
$uaarr['applydt'] = $this->post('applydt', $this->date);
if($addbo){
if(in_array('createdt', $allfields))$uaarr['createdt'] = $this->now;
if(in_array('adddt', $allfields))$uaarr['adddt'] = $this->now;
if(in_array('createid', $allfields))$uaarr['createid'] = $this->adminid;
if(in_array('createname', $allfields))$uaarr['createname'] = $this->adminname;
}
//保存公司的
if(in_array('comid', $allfields)){
if($addbo)$uaarr['comid'] = m('admin')->getcompanyid();
if(arrvalue($oldrs,'comid')=='0')$uaarr['comid'] = m('admin')->getcompanyid();
}
if($isflow>0){
$uaarr['status']= '0';
if($sysisturn==0){
$uaarr['isturn']= '0';
$subna = '保存';
}
}else{
if(in_array('status', $allfields))$uaarr['status'] = (int)$this->post('status', '1');
if(in_array('isturn', $allfields))$uaarr['isturn'] = (int)$this->post('isturn', '1');
}
//保存条件的判断
foreach($fieldsarr as $k=>$rs){
$ss = '';
if(isset($uaarr[$rs['fields']]))$ss = $this->flow->savedatastr($uaarr[$rs['fields']], $rs, $uaarr);
if($ss!='')$this->backmsg($ss);
}
//判断保存前的
$ss = '';
$befa = $this->savebefore($table, $this->getsavenarr($uaarr, $oldrs), $id, $addbo);
$notsave= array();//不保存的字段
if(is_string($befa)){
$ss = $befa;
}else{
if(isset($befa['msg']))$ss=$befa['msg'];
if(isset($befa['rows'])){
if(is_array($befa['rows']))foreach($befa['rows'] as $bk=>$bv)$uaarr[$bk]=$bv;
}
if(isset($befa['notsave'])){
$notsave=$befa['notsave'];
if(is_string($notsave))$notsave = explode(',', $notsave);
}
}
if(!$this->isempt($ss))$this->backmsg($ss);
//不保存字段过滤掉
if(is_array($notsave))foreach($notsave as $nofild)if(isset($uaarr[$nofild]))unset($uaarr[$nofild]);
$uaarr = $this->xxsstolt($uaarr);//过滤特殊文字
foreach($uaarr as $kf=>$kv){
if(!in_array($kf, $allfields)){
$this->backmsg('模块主表['.$this->flow->mtable.']上字段['.$kf.']不存在');
}
}
//isonly唯一值的判断
foreach($fieldsarr as $k=>$rs){
$fiesd = $rs['fields'];
if($rs['isonly']=='1' && isset($uaarr[$fiesd])){
$dval = $uaarr[$fiesd];
if(!isempt($dval)){
if($db->rows("`id`<>'$id' and `$fiesd`='$dval'")>0)$this->backmsg(''.$rs['name'].'['.$dval.']已存在了');
}
}
}
$bo = $db->record($uaarr, $where);;
if(!$bo)$this->backmsg($this->db->error());
if($id==0)$id = $this->db->insert_id();
m('file')->addfile($this->post('fileid'), $table, $id, $modenum);
if($otherfileid!='')m('file')->addfile(substr($otherfileid,1), '', $id, $modenum);
$newrs = $db->getone($id);
$this->companyid = isset($newrs['companyid']) ? (int)$newrs['companyid'] : (int)arrvalue($newrs, 'comid', '0');
if($this->companyid==0)$this->companyid = m('admin')->getcompanyid();
//保存多行子表
$tabless = $this->moders['tables'];
if(!isempt($tabless)){
$tablessa = explode(',', $tabless);
foreach($tablessa as $zbx=>$tablessas){
$this->savesubtable($tablessas, $id, $zbx, $addbo);
}
}
//保存后处理
$this->saveafter($table,$this->getsavenarr($uaarr, $oldrs), $id, $addbo);
//保存修改记录
$editcont = '';
if($oldrs){
$newrs = $db->getone($id);
$editcont = m('edit')->recordsave($farrs, $table, $id, $oldrs, $newrs);
}
$msg = '';
$this->flow->editcont = $editcont;
$this->flow->loaddata($id, false);
$this->flow->submit($subna);
$this->backmsg('', $subna, $id);
}
private function getsavenarr($nsrr, $bos=false)
{
if(!is_array($bos))$bos = array();
if($nsrr)foreach($nsrr as $k=>$v)$bos[$k]=$v;
return $bos;
}
public function getsubtabledata($xu)
{
$arr = array();
$oi = (int)$this->post('sub_totals'.$xu.'');
if($oi<=0)return $arr;
$modeid = $this->moders['id'];
$iszb = $xu+1;
$farr = m('flow_element')->getrows("`mid`='$modeid' and `islu`=1 and `iszb`=$iszb",'`name`,`fields`,`isbt`,`fieldstype`,`savewhere`,`dev`,`data`','`sort`');
$sort = 0;
for($i=0; $i<$oi; $i++){
$sid = (int)$this->post('sid'.$xu.'_'.$i.'');
$bos = true;
$uaarr['id'] = $sid;
foreach($farr as $k=>$rs){
$fid= $rs['fields'];
$flx= $rs['fieldstype'];
if(substr($fid,0,5)=='temp_')continue;
$na = ''.$fid.''.$xu.'_'.$i.'';
$val= $this->post($na);
if($rs['isbt']==1&&$this->isempt($val))$bos=false;
$uaarr[$fid] = $val;
if(substr($flx,0,6)=='change' && !isempt($rs['data'])){
$na = ''.$rs['data'].''.$xu.'_'.$i.'';
$val= $this->post($na);
$uaarr[$rs['data']] = $val;
}
}
if(!$bos)continue;
$uaarr['sort'] = $sort;
$sort++;
$arr[] = $uaarr;
}
return $arr;
}
//多行子表的保存
private function savesubtable($tables, $mid, $xu, $addbo)
{
$dbs = m($tables);
$data = $this->getsubtabledata($xu);
$data = $this->savesubbefore($data,$tables);
$len = count($data);
$idss = '0';
$whes = '';
$allfields = $this->db->getallfields('[Q]'.$tables.'');
$oarray = array();
if(in_array('optdt', $allfields))$oarray['optdt'] = $this->now;
if(in_array('optid', $allfields))$oarray['optid'] = $this->adminid;
if(in_array('optname', $allfields))$oarray['optname'] = $this->adminname;
if(in_array('uid', $allfields) && $addbo)$oarray['uid'] = $this->post('uid', $this->adminid);
if(in_array('applydt', $allfields) && $addbo)$oarray['applydt'] = $this->post('applydt', $this->date);
if(in_array('status', $allfields))$oarray['status'] = 0;
if(in_array('sslx', $allfields)){
$oarray['sslx'] = $xu;
$whes = ' and `sslx`='.$xu.'';
}
if(in_array('comid', $allfields))$oarray['comid'] = $this->companyid;
if($data)foreach($data as $k=>$uaarr){
$sid = $uaarr['id'];
$where = "`id`='$sid'";
$uaarr['mid'] = $mid;
if($sid==0)$where = '';
foreach($oarray as $k1=>$v1)$uaarr[$k1]=$v1;
$dbs->record($uaarr, $where);
if($sid==0)$sid = $this->db->insert_id();
$idss.=','.$sid.'';
}
$delwhere = "`mid`='$mid'".$whes." and `id` not in($idss)";
$dbs->delete($delwhere);
}
//获取数据
public function getdataAjax()
{
$flownum = $this->request('flownum');
$id = (int)$this->request('mid');
$arr = m('flow')->getdataedit($flownum, $id);
$this->backmsg('', '', $arr);
}
public function lumAction()
{
$this->ismobile = 1;
$this->luactions();
}
public function luAction()
{
$this->ismobile = 0;
$this->luactions();
}
public function lusAction()
{
$this->ismobile = 1;
$menuid = (int)$this->get('menuid');
$fields = m('flow_menu')->getmou('fields', $menuid);
if(isempt($fields))exit('sorry;');
$fields = str_replace(',',"','", $fields);
$stwhe = "and `fields` in('$fields')";
$this->luactions(1, $stwhe);
}
//高级搜索显示框
public function highsouAction()
{
$this->displayfile = ''.P.'/flow/input/tpl_input_lus.html';
$this->ismobile = 1;
$this->luactions(0, '', 1);
}
//$lutype=1高级搜索用的
private function luactions($slx=0, $stwhe='', $lutype=0)
{
$this->tpltype = 'html';
$uid = $this->adminid;
$num = $this->jm->gettoken('num');
$mid = (int)$this->jm->gettoken('mid');
$this->mid = $mid;
$this->rs = array();
$this->flow = m('flow')->initflow($num);
$moders = $this->flow->moders;
$modename = $moders['name'];
if($moders['status']=='0')exit('模块['.$modename.']已停用了;');
$apaths = ''.P.'/flow/input/mode_'.$moders['num'].'Action.php';
if(!file_exists($apaths))exit('没有创建布局录入页面,无法打开,请到【流程模块→表单元素管理】下的点按钮“PC端录入页面布局”,更多查看'.c('xinhu')->helpstr('bwb3mf').'。');
$isflow = (int)$moders['isflow'];
$this->smartydata['moders'] = array(
'num' => $moders['num'],
'id' => $moders['id'],
'name' => $moders['name'],
'names' => $moders['names'],
'isflow'=> $isflow,
'iscs' => $moders['iscs'],
'isbxs' => $moders['isbxs'],
);
$this->smartydata['chao'] = $this->flow->getcsname($mid);
$modeid = $moders['id'];
if($mid==0 && $lutype==0){
$isadd = m('view')->isadd($modeid, $uid);
if(!$isadd)exit('无权添加['.$modename.']的数据;');
}
$content = '';
$oldrs = m($moders['table'])->getone($mid);
$this->rs = $oldrs;
$this->gongsiarr = array();
$fieldarr = m('flow_element')->getrows("`mid`='$modeid' and `iszb`=0 $stwhe",'fields,fieldstype,name,dev,data,isbt,islu,attr,iszb,issou,gongsi,placeholder','`sort`');
$fieldarr = $this->flow->flowfieldarr($fieldarr, $this->ismobile);
$modelu = '';
foreach($fieldarr as $k=>$rs){
if($slx==1 && $oldrs){
$rs['value'] = $oldrs[$rs['fields']];
}
if($lutype==1){
$rs['isbt'] = 0;
if($rs['issou']==1)$modelu.='{'.$rs['fields'].'}';
}else{
if($rs['islu'] || $stwhe!='')$modelu.='{'.$rs['fields'].'}';
if(!isempt($rs['gongsi']) && contain($rs['gongsi'],'{'))$this->gongsiarr[] = array(
'iszb' => 0,
'fields' => $rs['fields'],
'gongsi' => $rs['gongsi'],
);
}
$this->fieldarr[$rs['fields']] = $rs;
}
$this->smartydata['fieldsjson'] = json_encode($fieldarr);
$this->moders = $moders;
$zbshu = 0;
$tableas = false;
if(!isempt($moders['tables'])){
$tableas = explode(',', $moders['tables']);
$zbshu = count($tableas);
}
$path = ''.P.'/flow/page/input_'.$num.'.html';
$pclucont = '';
if(file_exists($path))$pclucont = file_get_contents($path);
$isupfile = 0;
$nameaas = explode(',', $moders['names']); //子表名
//PC端
if($this->ismobile==0){
$content = $pclucont;
}else{
$content = $modelu;
if($tableas && $slx==0){
foreach($tableas as $k1=>$tableass){
$zbstr = m('input')->getsubtable($modeid,$k1+1,1,1);
if($zbstr!=''){
$content.='<tr><td style="padding:5px;" colspan="2"><div><b>'.arrvalue($nameaas, $k1).'</b></div>';
if($this->flow->minwidth>300){
$content.='<div tmp="mobilezbiao" style="width:280px;overflow:auto;"><div
style="min-width:'.$this->flow->minwidth.'px">'.$zbstr.'</div></div>';
}else{
$content.='<div>'.$zbstr.'</div>';
}
$content.= '</td></tr>';
}
}
}
$isupfile = contain($pclucont, '{file_content}') ? 1 : 0;
}
if($content=='')exit('未设置录入页面,请到[流程模块→表单元素管理]下设置');
$content = $this->flow->flowinputtpl($content, $this->ismobile);
$this->actclss = $this;
$pathss = ''.P.'/flow/input/mode_'.$num.'Action.php';
if(file_exists($pathss)){
include_once($pathss);
$clsnam = 'mode_'.$num.'ClassAction';
$this->actclss = new $clsnam();
$this->actclss->flow = $this->flow;
$this->actclss->mid = $this->mid;
$this->actclss->rs = $this->rs;
$this->actclss->ismobile= $this->ismobile;
}
//初始表单插件元素
$this->inputobj = c('input');
$this->inputobj->ismobile = $this->ismobile;
$this->inputobj->fieldarr = $this->fieldarr;
$this->inputobj->flow = $this->flow;
$this->inputobj->mid = $this->mid;
$this->inputobj->initUser($this->adminid);
preg_match_all('/\{(.*?)\}/', $content, $list);
foreach($list[1] as $k=>$nrs){
$str = $this->inputobj->getfieldcont($nrs, $this->actclss);
$content = str_replace('{'.$nrs.'}', $str, $content);
}
$this->subfielsa = array();
$content = $this->pisubduolie($content, $modeid, $nameaas);//多列子表匹配的是[]
$content = str_replace('*','<font color=red>*</font>', $content);
$course = array();
$nowcourseid = 0;
if($isflow>0 && $lutype==0){
$course[]= array('name'=>'提交','id'=>0);
$courses = $this->flow->getflowpipei($this->adminid);
if($mid>0){
$nowcourseid = $this->flow->billmodel->getmou('nowcourseid',"`table`='".$this->flow->mtable."' and `mid`='$mid'");
}
foreach($courses as $k=>$rs1){
$na = $rs1['name'];
if(!$this->isempt($rs1['explain']))$na.= '<br><span style="font-size:12px">('.$rs1['explain'].')</span>';
$rs1['name'] = $na;
$rs1['k'] = $k;
$rs1['isnow']= $rs1['id']==$nowcourseid;
if(arrvalue($moders,'isflowlx')=='1'){
$rs1['isnow'] = $k==0; //如果走重头审批第一步就是第一步的
}
//读取上次选择的2019-03-06 23:10:00添加
$cuid = $name = '';
if($rs1['isnow'] && $rs1['checktype']=='change' && $mid>0){
$cheorws= $this->flow->checksmodel->getall("`table`='".$this->flow->mtable."' and `mid`='$mid' and `courseid`=".$rs1['id']."",'checkid,checkname');
if($cheorws){
foreach($cheorws as $k3=>$rs3){
$cuid.=','.$rs3['checkid'].'';
$name.=','.$rs3['checkname'].'';
}
if($cuid != ''){
$cuid = substr($cuid, 1);
$name = substr($name, 1);
}
}
}
$rs1['sysnextoptid']= $cuid;
$rs1['sysnextopt'] = $name;
$course[]=$rs1;
}
$course[]= array('name'=>'结束','id'=>-1);
}
$this->title = $this->flow->inputtitle();//录入页面的标题
$this->smartydata['content'] = $content;
$this->smartydata['gongsiarr'] = $this->gongsiarr;
$this->smartydata['subfielsa'] = $this->subfielsa;
$this->smartydata['mid'] = $mid;
$this->smartydata['isflow'] = $isflow;
$this->smartydata['zbnamearr'] = $nameaas;
$this->smartydata['zbshu'] = $zbshu;//子表数
$this->smartydata['isupfile'] = $isupfile;//是否有上传
$this->assign('inputobj', c('input'));
$this->smartydata['course'] = $course;
$this->smartydata['inputwidth'] = $this->option->getval('inputwidth', 750);
}
//多行子表内替换
private function pisubduolie($content, $modeid, $nameaas)
{
$fieldarr = m('flow_element')->getrows("`mid`='$modeid' and `iszb`>0",'fields,fieldstype,name,dev,data,isbt,islu,attr,iszb,gongsi','`sort`');
if(!$fieldarr)return $content;
$this->fieldarr = array();
foreach($fieldarr as $k=>$rs){
$oi = $rs['iszb']-1;
$this->fieldarr['xuhao'.$oi.''] = array(
'fields' => 'xuhao'.$oi.'',
'fieldstype'=> 'xuhao',
'data' => '',
'attr' => 'style="text-align:center" readonly temp="xuhao"',
'dev' => '1',
'isbt' => '0',
'fieldss' => 'sid'.$oi.''
);
$this->fieldarr[$rs['fields'].''.$oi.''] = $rs;
if(!isempt($rs['gongsi']))$this->gongsiarr[] = array(
'iszb' => $rs['iszb'],
'fields' => $rs['fields'],
'gongsi' => $rs['gongsi'],
);
if($rs['isbt']=='1'){
$this->subfielsa[] = array(
'name' => $rs['name'],
'fields' => $rs['fields'],
'type' => $rs['fieldstype'],
'isbt' => $rs['isbt'],
'iszb' => (int)$rs['iszb'],
'zbname'=> arrvalue($nameaas, $oi)
);
}
}
$this->inputobj->fieldarr = $this->fieldarr;
preg_match_all('/\[(.*?)\]/', $content, $list);
foreach($list[1] as $k=>$nrs){
if(!$this->isempt($nrs)){
$fida= explode(',', $nrs);$xu0='0';
if(isset($fida[1]))$xu0=$fida[1];
$iszb = floatval(substr($fida[0],-1))+1;//第几个子表如果超过第10个子表就麻烦了
$str = $this->inputobj->getfieldcont($fida[0], $this->actclss,'_'.$xu0.'', $iszb);
$content = str_replace('['.$nrs.']', $str, $content);
}
}
return $content;
}
public function getselectdataAjax()
{
$rows = array();
$act = $this->get('act');
$modenum= $this->get('sysmodenum');
//用:读取model上的数据
if(!isempt($act) && contain($act,':')){
$acta = explode(':', $act);
$objs = m($acta[0]);
$tacs = $acta[1];
if(method_exists($objs, $tacs)){
$rows = $objs->$tacs();
}
}
if(!$rows && !isempt($act) && method_exists($this, $act)){
$rows = $this->$act();
}
//从Model上读取
if(!$rows && !isempt($modenum)){
$this->flow = m('flow')->initflow($modenum);
if(method_exists($this->flow, $act)){
$rows = $this->flow->$act();
}
}
return $rows;
}
/**
* 公共读取数据之前处理
*/
public function storebeforeshow($table)
{
$this->atypearr = false;
$this->modeid = (int)$this->get('modeid');
$pnum = $this->get('pnum');
if($this->post('atype')=='grant'){
$this->atypearr = array();
$this->atypearr[] = array(
'id' => 0,
'num' => 'grant',
'name' => ''.$this->flow->modename.'授权查看',
);
}else if($this->loadci==1 && $this->adminid>0){
$this->atypearr = m('where')->getmywhere($this->modeid, $this->adminid, $pnum);
if(isempt($pnum)){
$mors = $this->flow->moders;
if((int)arrvalue($mors,'iscs','0')>0)$this->atypearr[] = array(
'id' => 0,
'num' => 'chaos',
'name' => ''.$mors['name'].'抄送给我',
);
// if($mors['isflow']>0){
// $this->atypearr[] = array(
// 'id' => 0,
// 'num' => 'mychuli',
// 'name' => ''.$mors['name'].'经我处理',
// );
// }
}
}
$this->initAtypeArr();
return $this->storebefore($table);
}
/**
* 公共读取数据之后处理,展示列数
*/
public function storeaftershow($table, $rows)
{
$barr['rows'] = $rows;
$barr['atypearr'] = $this->atypearr;
if($this->loadci==1){
$vobj = m('view');
$barr['isadd'] = $vobj->isadd($this->modeid, $this->adminid); //判断是否可添加
$barr['isdaoru'] = $vobj->isdaoru($this->modeid, $this->adminid); //判断是否可导入
$barr['isdaochu'] = $vobj->isdaochu($this->modeid, $this->adminid); //判断是否可导入
}
$barr['souarr'] = $this->flow->flowsearchfields();
$rows = $this->flow->viewjinfields($rows);//禁看字段处理
$farrl = array();
foreach($this->flow->fieldsarra as $k2=>$rs2){
if($rs2['fieldstype']=='uploadimg')$farrl[$rs2['fields']]=$rs2['fieldstype'];
}
if($rows)foreach($rows as $k1=>$rs1){
foreach($farrl as $fid=>$flx){
if(isset($rs1[$fid])){
$val = $rs1[$fid];
if($flx=='uploadimg'){
$val = $this->rock->gethttppath($val);
$rows[$k1][$fid] = $val;
//if($this->flow->modeid>92)$val='<img src="'.$val.'" height="60">';
}
}
}
}
$barr['rows'] = $rows;
$scarr = $this->storeafter($table, $rows);
if(is_array($scarr))foreach($scarr as $k=>$v)$barr[$k]=$v;
return $barr;
}
//获取可搜索列表
public function getcolumnsAjax()
{
$modeid = (int)$this->get('modeid');
$modenum = $this->get('modenum');
$flow = m('flow')->initflow($modenum);
$souarr = array();
$this->input= c('input');
foreach($flow->fieldsarra as $k=>$rs){
if($rs['issou']==1){
$rs['store'] = $this->input->getdatastore($rs['fieldstype'], $this, $rs['data']);
$souarr[] = $rs;
}
}
$this->returnjson($souarr);
}
//初始化导入
public function initdaoruAjax()
{
$modenum = $this->get('modenum');
$flow = m('flow')->initflow($modenum);
$rows = m('flow_element')->getall('mid='.$flow->modeid.' and `isdr`=1 and `iszb`=0','name,isbt,fields','`sort`,`id`');
return $rows;
}
//确定导入数据
public function daorudataAjax()
{
$modenum = $this->post('modenum');
$flow = m('flow')->initflow($modenum);
$rows = m('flow_element')->getall('mid='.$flow->modeid.' and `isdr`=1 and `iszb`=0','name,isbt,fields,isonly','`sort`,`id`');
$fields = $fieldss = '';
if(!$rows)return returnerror('没有导入的字段');
$onlyfield = array();
foreach($rows as $k=>$rs){
$fields.=','.$rs['fields'].'';
if($rs['isbt']=='1')$fieldss.=','.$rs['fields'].'';
if($rs['isonly']=='1')$onlyfield[] = $rs['fields']; //唯一字段
}
$fields = substr($fields, 1);
if($fieldss!='')$fieldss = substr($fieldss,1);
$data = c('html')->importdata($fields, $fieldss); //获取提交过来要导入的数据库
if(!$data)return returnerror('没有可导入的数据,注意*是必填的哦');
$msgstr = '';
//保存前判断
if(method_exists($flow,'flowdaorubefore')){
$data = $flow->flowdaorubefore($data);
if(is_string($data))return returnerror($data);
}
//判断是否有重复
$ldata = array();
foreach($data as $k=>$rs){
$bos = true;
foreach($onlyfield as $onid){
$val = arrvalue($rs, $onid);
if(!isempt($val)){
$tos = $flow->rows("`$onid`='$val'");
if($tos>0){
$bos = false;
$msgstr.='行'.($k+1).'的字段'.$onid.'存在重复;';
break;
}
}
}
if($bos)$ldata[] = $rs;
}
if(!$ldata)return returnerror('没有可导入的数据'.$msgstr.'');
$allfields = $this->db->getallfields('[Q]'.$flow->mtable.'');
$oi = 0;
$dorudat= array();
foreach($ldata as $k=>$rs){
$id = (int)arrvalue($rs,'id','0');
$where = '';
if($id>0){
if($flow->rows($id)>0){
$where='`id`='.$id.'';
}else{
$id = 0;
}
}
if($id==0){
if(!isset($rs['createid']) && in_array('createid', $allfields))$rs['createid'] = $this->adminid;
if(!isset($rs['createname']) && in_array('createname', $allfields))$rs['createname'] = $this->adminname;
if(!isset($rs['adddt']) && in_array('adddt', $allfields))$rs['adddt'] = $this->now;
if(!isset($rs['createdt']) && in_array('createdt', $allfields))$rs['createdt'] = $this->now;
if(!isset($rs['comid']) && in_array('comid', $allfields))$rs['comid'] = m('admin')->getcompanyid();
}
if(!isset($rs['uid']) && in_array('uid', $allfields))$rs['uid'] = $this->adminid;
if(!isset($rs['optid']) && in_array('optid', $allfields))$rs['optid'] = $this->adminid;
if(!isset($rs['optname']) && in_array('optname', $allfields))$rs['optname'] = $this->adminname;
if(!isset($rs['optdt']) && in_array('optdt', $allfields))$rs['optdt'] = $this->now;
if(!isset($rs['applydt']) && in_array('applydt', $allfields))$rs['applydt'] = $this->date;
if($id==0){
$bo = $flow->insert($rs);
}else{
$bo = $id;
$flow->update($rs, $where);
}
if($bo){
$rs['id'] = $bo;
$dorudat[]= $rs;
$oi++;
//有流程的模块就要提交操作
$status = arrvalue($rs,'status','0'); //状态
$isturn = arrvalue($rs,'isturn','1'); //默认是提交的
if($flow->isflow>0 && $status=='0'){
$flow->loaddata($rs['id'], false);
$na = ($isturn=='1') ? '提交' : '保存';
$flow->submit($na);
}
}else{
$msgstr.='行'.($k+1).'保存数据库错误;';
}
}
if($oi==0)return returnerror('导入数据为0条'.$msgstr.'');
//保存后判断
if(method_exists($flow,'flowdaoruafter')){
$flow->flowdaoruafter($dorudat);
}
return returnsuccess('成功导入'.$oi.'条数据'.$msgstr.'');
}
//读取导入的excel数据
public function readxlsAjax()
{
$fileid = (int)$this->get('fileid','0');
$fpath = m('file')->getmou('filepath', $fileid);
if(isempt($fpath))return returnerror('文件不存在了');
$phpexcel = c('PHPExcelReader');
$rows = $phpexcel->reader($fpath);
if(is_string($rows))return returnerror('无法读取Excel文件('.$rows.')');
$modenum= $this->get('modenum');
$flow = m('flow')->initflow($modenum);
$dtarr = array();//日期读取需要判断
$xuha = -1;
foreach($flow->fieldsarra as $k2=>$rs2){
if($rs2['isdr']=='1' && $rs2['iszb']=='0'){
$xuha++;
if(in_array($rs2['fieldstype'], array('date','datetime'))){
$dtarr[$phpexcel->A[$xuha]] = $rs2['fieldstype'];
}
}
}
$str = '';
foreach($rows as $k=>$rs){
$str1 = '';
$xi = 0;
foreach($rs as $k1=>$v1){
if($xi>0)$str1.=' ';
if(isset($dtarr[$k1]) && is_numeric($v1)){
$v1 = $phpexcel->ExcelToDate($dtarr[$k1], $v1);
}
$v1 = str_replace("\n", '[XINHUBR]', $v1); //有\n转
$str1.=''.$v1.'';
$xi++;
}
if($k>0)$str.="\n";
$str.=$str1;
}
return returnsuccess($str);
}
//下载导入的模版
public function daoruexcelAction()
{
$this->display = false;
$modenum = $this->get('modenum');
$flow = m('flow')->initflow($modenum);
$rows = m('flow_element')->getall('mid='.$flow->modeid.' and `isdr`=1 and `iszb`=0','name,isbt,fields','`sort`,`id`');
if(!$rows)return '对应模块没有设置导入字段';
$testdata = $texdata = array();
if(method_exists($flow,'flowdaorutestdata')){
$testdata = $flow->flowdaorutestdata();
}
m('file')->fileheader(''.$modenum.'import.xls');
$str1 = '';
$str2 = '';
$col = 0;
$headArr = array();
foreach($rows as $k=>$rs){
$col++;
$xi = $rs['isbt']=='1'? '<font color=red>*</font>' : '';
$x1 = $rs['isbt']=='1'? '*' : '';
$str1.='<td style="border:.5pt #000000 solid; background:#cdf79e" height="30" align="center">'.$xi.'<b>'.$rs['name'].'('.$rs['fields'].')</b></td>';
$headArr[$rs['fields']] = ''.$x1.''.$rs['name'].'('.$rs['fields'].')';
}
if($testdata){
$texdata = $testdata;
if(!isset($testdata[0]))$texdata = array($testdata);
foreach($texdata as $j=>$jrs){
$str2.='<tr>';
foreach($rows as $k=>$rs){
$val = arrvalue($jrs, $rs['fields']);
$str2.='<td style="border:.5pt #000000 solid;" height="30" align="center">'.$val.'</td>';
}
$str2.='</tr>';
}
}
$str = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<table style="border-spacing: 0;border-collapse: collapse;"><tr bgcolor="#f1f1f1">'.$str1.'</tr>'.$str2.'';
for($i=1;$i<=100;$i++){
$str.='<tr>';
for($j=1;$j<=$col; $j++){
$str.='<td style="border:.5pt #000000 solid" height="30" align="center"></td>';
}
$str.='</tr>';
}
$str.= '</table>';
$pexecl = c('PHPExcel');
if($pexecl->isBool()){
$pexecl->title = ''.$modenum.'_import';
$pexecl->titlebool = false;
$pexecl->borderbool = false;
$pexecl->headArr = $headArr;
$pexecl->rows = $texdata;
$pexecl->display('xls', 'down');
}else{
return $str;
}
}
public function getuinfoAjax()
{
$uid = $this->post('uid', $this->adminid);
$rs = m('admin')->getone($uid,'id,name,deptname,deptallname,ranking,workdate,pingyin');
$unrs= m('userinfo')->getone($uid, 'syenddt,positivedt');
if($unrs)foreach($unrs as $k=>$v)$rs[$k] =$v;
return $rs;
}
public function upimagepathAjax()
{
$fileid = (int)$this->get('fileid');
$fid = $this->get('fid');
$frs = m('file')->getone($fileid);
$path = '';
if(!isempt($frs['thumbplat'])){
$path = str_replace('_s.','.',$frs['thumbplat']);
}
return returnsuccess(array(
'path' => $path,
'fid' => $fid,
));
}
//数据字典
public function getuids($num){
$numarr = m('option')->getone('num = "'.$num.'"','id');
$data = m('option')->getall('pid = "'.$numarr['id'].'"','id,num');
$ids = [];
foreach ($data as $v){
$ids[] = $v['num'];
}
return $ids;
}
private function initAtypeArr(){
$uid = $this->adminid;
$num = $this->post('modenum');
//1.获取数据字典
$dd = m('option')->getall('pid = 1186');
$nd = []; //节点数据
$tagarr[] = 'my'; //tags
//2.获取编号
foreach ($dd as $k1 => $v1){
if($v1['name'] == $num){
$nd = m('option')->getall('pid = '.$v1['id']); //all,archive
foreach ($nd as $k2 => $v2){
$tag = m('option')->getone('`name` = "'.$v2['num'].'"'); //$v['num'] = ug_htall
$users = m('option')->getall('pid = '.$tag['id']); //uids
foreach ($users as $u) {
if($uid == $u['num']){
$tagarr[] = $v2['name'];
continue;
}
}
}
}
}
foreach ($this->atypearr as $k => $value){ //all my
$flag = 0;
foreach ($tagarr as $aty){ //my all archive
if($value['num'] == $aty){
$flag = 1;
continue;
}
}
if($flag == 0){
unset($this->atypearr[$k]);
}
}
$this->atypearr = array_values($this->atypearr);
}
}
class inputClassAction extends inputAction{}
\ No newline at end of file
...@@ -11,7 +11,7 @@ $(document).ready(function(){ ...@@ -11,7 +11,7 @@ $(document).ready(function(){
{params} {params}
var modenum = 'hisoa',modename='历史OA信息展示',isflow=0,modeid='112',atype = params.atype,pnum=params.pnum,modenames=''; var modenum = 'hisoa',modename='历史OA信息展示',isflow=0,modeid='112',atype = params.atype,pnum=params.pnum,modenames='';
if(!atype)atype='';if(!pnum)pnum=''; if(!atype)atype='';if(!pnum)pnum='';
var fieldsarr = [{"name":"\u7533\u8bf7\u4eba","fields":"base_name"},{"name":"\u7533\u8bf7\u4eba\u90e8\u95e8","fields":"base_deptname"},{"name":"\u5355\u53f7","fields":"sericnum"},{"fields":"his_oa_numb","name":"\u5386\u53f2OA\u6d41\u6c34\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"payment_type","name":"\u4ed8\u6b3e\u7c7b\u578b","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"project_name","name":"\u9879\u76ee\u540d\u79f0","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"amount","name":"\u4ed8\u6b3e\u91d1\u989d","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"payee","name":"\u6536\u6b3e\u4eba","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"payment_mode","name":"\u4ed8\u6b3e\u65b9\u5f0f","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"applicant","name":"\u7533\u8bf7\u4eba","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"department","name":"\u6240\u5c5e\u90e8\u95e8","fieldstype":"changedept","ispx":"0","isalign":"0","islb":"1"},{"fields":"create_time","name":"\u7533\u8bf7\u65f6\u95f4","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"final_status","name":"\u6700\u7ec8\u72b6\u6001","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"contract","name":"\u6240\u5c5e\u5408\u540c\u7f16\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"pay_explain","name":"\u4ed8\u6b3e\u8bf4\u660e","fieldstype":"textarea","ispx":"0","isalign":"0","islb":"1"},{"fields":"project_numb","name":"\u76f8\u5173\u9879\u76ee\u7f16\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"his_dept","name":"\u5386\u53f2\u5f52\u5c5e\u90e8\u95e8","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"}],fieldsselarr= []; var fieldsarr = [{"name":"\u7533\u8bf7\u4eba","fields":"base_name"},{"name":"\u7533\u8bf7\u4eba\u90e8\u95e8","fields":"base_deptname"},{"name":"\u5355\u53f7","fields":"sericnum"},{"fields":"his_oa_numb","name":"\u5386\u53f2OA\u6d41\u6c34\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"payment_type","name":"\u4ed8\u6b3e\u7c7b\u578b","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"project_name","name":"\u9879\u76ee\u540d\u79f0","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"amount","name":"\u4ed8\u6b3e\u91d1\u989d","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"payee","name":"\u6536\u6b3e\u4eba","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"uid","name":"\u5458\u5de5ID","fieldstype":"number","ispx":"0","isalign":"0","islb":"0"},{"fields":"payment_mode","name":"\u4ed8\u6b3e\u65b9\u5f0f","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"applicant","name":"\u7533\u8bf7\u4eba","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"department","name":"\u6240\u5c5e\u90e8\u95e8","fieldstype":"changedept","ispx":"0","isalign":"0","islb":"1"},{"fields":"create_time","name":"\u7533\u8bf7\u65f6\u95f4","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"final_status","name":"\u6700\u7ec8\u72b6\u6001","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"contract","name":"\u6240\u5c5e\u5408\u540c\u7f16\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"pay_explain","name":"\u4ed8\u6b3e\u8bf4\u660e","fieldstype":"textarea","ispx":"0","isalign":"0","islb":"1"},{"fields":"project_numb","name":"\u76f8\u5173\u9879\u76ee\u7f16\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"his_dept","name":"\u5386\u53f2\u5f52\u5c5e\u90e8\u95e8","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"}],fieldsselarr= [];
var c = { var c = {
reload:function(){ reload:function(){
......
...@@ -11,7 +11,7 @@ $(document).ready(function(){ ...@@ -11,7 +11,7 @@ $(document).ready(function(){
{params} {params}
var modenum = 'oayfk',modename='预付款申请单',isflow=1,modeid='103',atype = params.atype,pnum=params.pnum,modenames=''; var modenum = 'oayfk',modename='预付款申请单',isflow=1,modeid='103',atype = params.atype,pnum=params.pnum,modenames='';
if(!atype)atype='';if(!pnum)pnum=''; if(!atype)atype='';if(!pnum)pnum='';
var fieldsarr = [{"name":"\u7533\u8bf7\u4eba","fields":"base_name"},{"name":"\u7533\u8bf7\u4eba\u90e8\u95e8","fields":"base_deptname"},{"name":"\u5355\u53f7","fields":"sericnum"},{"fields":"fkinfo","name":"\u6536\u6b3e\u4eba\u4fe1\u606f","fieldstype":"textarea","ispx":"0","isalign":"0","islb":"0"},{"fields":"userid","name":"\u7528\u6237\u7f16\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"paymentMethod","name":"\u4ed8\u6b3e\u65b9\u5f0f","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"payee","name":"\u6536\u6b3e\u65b9","fieldstype":"selectdatafalse","ispx":"1","isalign":"0","islb":"0"},{"fields":"paymentBy","name":"\u4ed8\u6b3e\u4e8b\u7531","fieldstype":"textarea","ispx":"1","isalign":"0","islb":"0"},{"fields":"fkorg","name":"\u4ed8\u6b3e\u7ec4\u7ec7","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"applicant","name":"\u7533\u8bf7\u4eba","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"application","name":"\u7533\u8bf7\u90e8\u95e8","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"fujian","name":"\u9644\u4ef6","fieldstype":"uploadfile","ispx":"0","isalign":"0","islb":"0"},{"fields":"applydate","name":"\u7533\u8bf7\u65e5\u671f","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"docnum","name":"\u5355\u636e\u7f16\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"yfkname","name":"\u6807\u9898","fieldstype":"text","ispx":"0","isalign":"0","islb":"1"},{"fields":"amountOfThisPayment","name":"\u4ed8\u6b3e\u91d1\u989d","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"}],fieldsselarr= {"columns_oayfk_all":"base_name,base_deptname,applydate,docnum,yfkname,amountOfThisPayment,caozuo"}; var fieldsarr = [{"name":"\u7533\u8bf7\u4eba","fields":"base_name"},{"name":"\u7533\u8bf7\u4eba\u90e8\u95e8","fields":"base_deptname"},{"name":"\u5355\u53f7","fields":"sericnum"},{"fields":"fkinfo","name":"\u6536\u6b3e\u4eba\u4fe1\u606f","fieldstype":"textarea","ispx":"0","isalign":"0","islb":"0"},{"fields":"userid","name":"\u7528\u6237\u7f16\u53f7","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"paymentMethod","name":"\u4ed8\u6b3e\u65b9\u5f0f","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"payee","name":"\u6536\u6b3e\u65b9","fieldstype":"selectdatafalse","ispx":"1","isalign":"0","islb":"0"},{"fields":"paymentBy","name":"\u4ed8\u6b3e\u4e8b\u7531","fieldstype":"textarea","ispx":"1","isalign":"0","islb":"0"},{"fields":"fkorg","name":"\u4ed8\u6b3e\u7ec4\u7ec7","fieldstype":"rockcombo","ispx":"0","isalign":"0","islb":"0"},{"fields":"applicant","name":"\u7533\u8bf7\u4eba","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"application","name":"\u7533\u8bf7\u90e8\u95e8","fieldstype":"text","ispx":"0","isalign":"0","islb":"0"},{"fields":"fujian","name":"\u9644\u4ef6","fieldstype":"uploadfile","ispx":"0","isalign":"0","islb":"0"},{"fields":"applydate","name":"\u7533\u8bf7\u65e5\u671f","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"docnum","name":"\u5355\u636e\u7f16\u53f7","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"yfkname","name":"\u6807\u9898","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"},{"fields":"amountOfThisPayment","name":"\u4ed8\u6b3e\u91d1\u989d","fieldstype":"text","ispx":"1","isalign":"0","islb":"1"}],fieldsselarr= {"columns_oayfk_all":"base_name,base_deptname,applydate,docnum,yfkname,amountOfThisPayment,caozuo"};
var c = { var c = {
reload:function(){ reload:function(){
...@@ -210,7 +210,7 @@ $(document).ready(function(){ ...@@ -210,7 +210,7 @@ $(document).ready(function(){
fanye:true,modenum:modenum,modename:modename,statuschange:false,tablename:jm.base64decode('Y19maW5pbmZvbV9vYXlmaw::'), fanye:true,modenum:modenum,modename:modename,statuschange:false,tablename:jm.base64decode('Y19maW5pbmZvbV9vYXlmaw::'),
url:c.storeurl(),storeafteraction:'storeaftershow',storebeforeaction:'storebeforeshow', url:c.storeurl(),storeafteraction:'storeaftershow',storebeforeaction:'storebeforeshow',
params:{atype:atype}, params:{atype:atype},
columns:[{text:"申请人",dataIndex:"base_name",sortable:true},{text:"申请人部门",dataIndex:"base_deptname",sortable:true},{text:"单号",dataIndex:"sericnum"},{text:"申请日期",dataIndex:"applydate"},{text:"单据编号",dataIndex:"docnum"},{text:"标题",dataIndex:"yfkname"},{text:"付款金额",dataIndex:"amountOfThisPayment",sortable:true},{text:"状态",dataIndex:"statustext"},{ columns:[{text:"申请人",dataIndex:"base_name",sortable:true},{text:"申请人部门",dataIndex:"base_deptname",sortable:true},{text:"单号",dataIndex:"sericnum"},{text:"申请日期",dataIndex:"applydate",sortable:true},{text:"单据编号",dataIndex:"docnum",sortable:true},{text:"标题",dataIndex:"yfkname",sortable:true},{text:"付款金额",dataIndex:"amountOfThisPayment",sortable:true},{text:"状态",dataIndex:"statustext"},{
text:'',dataIndex:'caozuo',callback:'opegs{rand}' text:'',dataIndex:'caozuo',callback:'opegs{rand}'
}], }],
itemdblclick:function(){ itemdblclick:function(){
......
...@@ -2267,8 +2267,17 @@ sssss; ...@@ -2267,8 +2267,17 @@ sssss;
$this->rs['now_adminname'] = $this->adminname; $this->rs['now_adminname'] = $this->adminname;
$this->rs['now_modename'] = $modename; $this->rs['now_modename'] = $modename;
$cont = $this->rock->reparr($cont, $this->rs); $cont = $this->rock->reparr($cont, $this->rs);
$contt = strip_tags($cont);
#var_dump($contt);
$date = date("Y/m/d H:i:s");
if(strpos($contt,'北京广厦网络技术股份公司 GONN Network Technology Inc OA系统提示,') !== false){
$contt=str_replace('北京广厦网络技术股份公司 GONN Network Technology Inc OA系统提示,','',$contt);
$contt=str_replace('链 接:>>> 更多信息请登录&nbsp;广厦网络OA办公系统&nbsp;进行查看,感谢您的使用和支持。 通过邮件或电话(010-62419724转829)联系我们,获得更多帮助。 OA办公系统本邮件由系统自动发出,请勿直接回复 ','',$contt);
$contt=str_replace('更多信息请登录&nbsp;广厦网络OA办公系统&nbsp;进行查看,感谢您的使用和支持。 通过邮件或电话(010-62419724转829)联系我们,获得更多帮助。 OA办公系统本邮件由系统自动发出,请勿直接回复 ','',$contt);
}
$receid = $this->adminmodel->gjoins($receid); $receid = $this->adminmodel->gjoins($receid);
$uids = m('todo')->addtodo($receid, $modename, $cont, $modenum, $id);
$uids = m('todo')->addtodo($receid, $modename, $contt, $modenum, $id);
if($uids!='' && $moders['type'] != '系统' && $id > 0)$this->todosmodel->addtotouids($uids, array( if($uids!='' && $moders['type'] != '系统' && $id > 0)$this->todosmodel->addtotouids($uids, array(
'table' => $this->mtable, 'table' => $this->mtable,
'mid' => $id, 'mid' => $id,
......
...@@ -30,12 +30,13 @@ class flowModel extends Model ...@@ -30,12 +30,13 @@ class flowModel extends Model
public $atype = ''; public $atype = '';
public $daochubo= false; //是否导出操作 public $daochubo= false; //是否导出操作
public $companyid= 1; //默认单位Id public $companyid= 1; //默认单位Id
/**------------------------------扩展字段开始--------------------------------**/ /**------------------------------扩展字段开始--------------------------------**/
public $_customerTable = 'customer' ; public $_customerTable = 'customer' ;
public $_contractTable = 'c_contract' ; public $_contractTable = 'c_contract' ;
public $_supplierTable = 'supplier' ; public $_supplierTable = 'supplier' ;
public $emurl = '';
/**------------------------------扩展字段结束--------------------------------**/ /**------------------------------扩展字段结束--------------------------------**/
...@@ -1809,70 +1810,85 @@ class flowModel extends Model ...@@ -1809,70 +1810,85 @@ class flowModel extends Model
*/ */
public function nexttodo($nuid, $type, $sm='', $act='') public function nexttodo($nuid, $type, $sm='', $act='')
{ {
$date = date("Y/m/d H:i:s");
$cont = ''; $cont = '';
$tit = ''; $emurl = $this->getxiangurl($modenum, $id, 'a');
$emurl = arrvalue($params, 'emurl', $emurl);
$tit = 'OA系统提示:您有一条待办需要处理';
$gname = '流程待办'; $gname = '流程待办';
$summary= $this->getsummary(); $summary= $this->getsummary();
if($type=='submit' || $type=='next' || $type == 'cuiban'){ if($type=='submit' || $type=='next' || $type == 'cuiban'){
$cont = '您有['.$this->uname.']的['.$this->modename.',单号:'.$this->sericnum.']需要处理'; $cont=<<<sss
if($sm!='')$cont.=',说明:'.$sm.''; <table class="ke-zeroborder" style="width:600px;font-family:Microsoft YaHei;"><tbody><tr><td style="background-color:#666666;text-align:center;vertical-align:bottom;"><img src="http://oa.gonn.com.cn/images/logo.png" width="40" height="40" title="" alt="" align="left" /> <div style="text-align:right;"><span style="color:#FFFFFF;font-size:14px;font-family:Microsoft YaHei;">北京广厦网络技术股份公司</span> </div><div style="text-align:right;"><span style="color:#FFFFFF;font-size:14px;font-family:Microsoft YaHei;">GONN Network Technology Inc</span> </div></td></tr><tr><td><br /><span style="font-size:14px;font-family:Microsoft YaHei;">OA系统提示,您有一条审批需要处理。</span><br /><br /><ul><li><span style="font-size:14px;font-family:Microsoft YaHei;">来 自:$this->uname</span> </li><li><span style="font-size:14px;font-family:Microsoft YaHei;">类 型:$this->modename</span> </li><li><span style="font-size:14px;font-family:Microsoft YaHei;">单 号:<u><a href="$emurl" target="_blank">$this->sericnum</a></u></span> </li><li><span style="font-size:14px;font-family:Microsoft YaHei;">日 期:$date</span> </li><li><span style="font-size:14px;">链 接:<a href="$emurl" style='text-decoration:none;'>>>></a></span> </li></ul><p><span style="font-size:14px;font-family:Microsoft YaHei;">更多信息请登录&nbsp;<a href="http://oa.gonn.com.cn/" target="_blank">广厦网络OA办公系统</a>&nbsp;进行查看,感谢您的使用和支持。</span> </p><p><span style="font-size:12px;font-family:Microsoft YaHei;">通过<a href="mailto:it@gonn.com.cn">邮件</a>或电话(010-62419724转829)联系我们,获得更多帮助。</span> </p></td></tr><tr><td style="background-color:#666666;text-align:left;"><span style="font-size:14px;color:#FFFFFF;font-family:Microsoft YaHei;">OA办公系统</span><br /><span style="font-size:10px;color:#FFFFFF;font-family:Microsoft YaHei;">本邮件由系统自动发出,请勿直接回复</span> </td></tr></tbody></table>
$tit = ''.$this->uname.'的'.$this->modename.''; sss;
// if($sm!='')$cont.=',说明:'.$sm.'';
// $tit = ''.$this->uname.'的'.$this->modename.'';
//短信提醒 //短信提醒
if($type != 'cuiban'){ // if($type != 'cuiban'){
$txnum = $this->option->getval('sms_txnum'); // $txnum = $this->option->getval('sms_txnum');
if(!isempt($txnum)){ // if(!isempt($txnum)){
$mknum = $this->option->getval('sms_mknum'); // $mknum = $this->option->getval('sms_mknum');
if($mknum=='all' || contain(','.$mknum.',',','.$this->modenum.',')){ // if($mknum=='all' || contain(','.$mknum.',',','.$this->modenum.',')){
$wxurl = $this->getxiangurlx(); // $wxurl = $this->getxiangurlx();
$barr = c('xinhuapi')->sendsms($nuid, '', $txnum, array( // $barr = c('xinhuapi')->sendsms($nuid, '', $txnum, array(
'modename' => $this->modename, // 'modename' => $this->modename,
'sericnum' => $this->sericnum, // 'sericnum' => $this->sericnum,
'applyname'=> $this->uname, // 'applyname'=> $this->uname,
'deptname' => $this->rs['base_deptname'], // 'deptname' => $this->rs['base_deptname'],
),$wxurl); // ),$wxurl);
} // }
} // }
} // }
$type = 'daiban'; // $type = 'daiban';
} }
//审核不同意 //审核不同意
if($type == 'nothrough'){ if($type == 'nothrough'){
$cont = '你提交['.$this->modename.',单号:'.$this->sericnum.']'.$this->adminname.'处理['.$act.'],原因:['.$sm.']'; $cont=<<<ssss
<table class="ke-zeroborder" style="width:600px;font-family:Microsoft YaHei;"><tbody><tr><td style="background-color:#666666;text-align:center;vertical-align:bottom;"><img src="http://oa.gonn.com.cn/images/logo.png" width="40" height="40" title="" alt="" align="left" /> <div style="text-align:right;"><span style="color:#FFFFFF;font-size:14px;font-family:Microsoft YaHei;">北京广厦网络技术股份公司</span> </div><div style="text-align:right;"><span style="color:#FFFFFF;font-size:14px;font-family:Microsoft YaHei;">GONN Network Technology Inc</span> </div></td></tr><tr><td><br/><span style="font-size:14px;font-family:Microsoft YaHei;">OA系统提示,您有一条审批<span style="color:#E53333;"><strong>被拒绝</strong></span>。</span><br/><br/> <ul><li><span style="font-size:14px;font-family:Microsoft YaHei;">处 理 人:$this->adminname</span></li><li><span style="font-size:14px;font-family:Microsoft YaHei;">类 型:$this->modename</span> </li><li><span style="font-size:14px;font-family:Microsoft YaHei;">单 号:<u><a href="$emurl" target="_blank">$this->sericnum</a></u></span> </li><li><span style="font-size:14px;font-family:Microsoft YaHei;">原 因:$sm</span></li><li><span style="font-size:14px;font-family:Microsoft YaHei;">日 期:$date</span><br/></li></ul><p><span style="font-size:14px;font-family:Microsoft YaHei;">更多信息请登录&nbsp;<a href="http://oa.gonn.com.cn/" target="_blank">广厦网络OA办公系统</a>&nbsp;进行查看,感谢您的使用和支持。</span> </p><p><span style="font-size:12px;font-family:Microsoft YaHei;">通过<a href="mailto:it@gonn.com.cn">邮件</a>或电话(010-62419724转829)联系我们,获得更多帮助。</span> </p></td></tr><tr><td style="background-color:#666666;text-align:left;"><span style="font-size:14px;color:#FFFFFF;font-family:Microsoft YaHei;">OA办公系统</span><br/><span style="font-size:10px;color:#FFFFFF;font-family:Microsoft YaHei;">本邮件由系统自动发出,请勿直接回复</span> </td></tr></tbody></table>
ssss;
//'你提交['.$this->modename.',单号:'.$this->sericnum.']'.$this->adminname.'处理['.$act.'],原因:['.$sm.']';
$gname= '流程申请'; $gname= '流程申请';
} }
if($type == 'finish'){ if($type == 'finish'){
$cont = '你提交的['.$this->modename.',单号:'.$this->sericnum.']已全部处理完成'; $cont=<<<sssss
} <table class="ke-zeroborder" style="width:600px;font-family:Microsoft YaHei;"><tbody><tr><td style="background-color:#666666;text-align:center;vertical-align:bottom;"><img src="http://oa.gonn.com.cn/images/logo.png" width="40" height="40" title="" alt="" align="left" /> <div style="text-align:right;"><span style="color:#FFFFFF;font-size:14px;font-family:Microsoft YaHei;">北京广厦网络技术股份公司</span> </div><div style="text-align:right;"><span style="color:#FFFFFF;font-size:14px;font-family:Microsoft YaHei;">GONN Network Technology Inc</span> </div></td></tr><tr><td><br /><span style="font-size:14px;font-family:Microsoft YaHei;">OA系统提示,您有一条审批<span style="color:#009900;"><span style="color:#009900;"><strong>已完成</strong></span></span>。</span><br /><br /><ul><li><span style="font-size:14px;font-family:Microsoft YaHei;">处 理 人:$this->adminname</span> </li><li><span style="font-size:14px;font-family:Microsoft YaHei;">类 型:$this->modename</span> </li><li><span style="font-size:14px;font-family:Microsoft YaHei;">单 号:<u><a href="$emurl" target="_blank">$this->sericnum</a></u></span> </li><li><span style="font-size:14px;font-family:Microsoft YaHei;">备 注:$sm</span> </li><li><span style="font-size:14px;font-family:Microsoft YaHei;">日 期:$date</span><br /></li></ul><p><span style="font-size:14px;font-family:Microsoft YaHei;">更多信息请登录&nbsp;<a href="http://oa.gonn.com.cn/" target="_blank">广厦网络OA办公系统</a>&nbsp;进行查看,感谢您的使用和支持。</span> </p><p><span style="font-size:12px;font-family:Microsoft YaHei;">通过<a href="mailto:it@gonn.com.cn">邮件</a>或电话(010-62419724转829)联系我们,获得更多帮助。</span> </p></td></tr><tr><td style="background-color:#666666;text-align:left;"><span style="font-size:14px;color:#FFFFFF;font-family:Microsoft YaHei;">OA办公系统</span><br /><span style="font-size:10px;color:#FFFFFF;font-family:Microsoft YaHei;">本邮件由系统自动发出,请勿直接回复</span> </td></tr></tbody></table>
if($type == 'zhui'){ sssss;
$cont = ''.$this->adminname.'追加单据说明['.$this->modename.',单号:'.$this->sericnum.'],说明:['.$sm.']';
//'你提交的['.$this->modename.',单号:'.$this->sericnum.']已全部处理完成';
} }
// if($type == 'zhui'){
// $cont = ''.$this->adminname.'追加单据说明['.$this->modename.',单号:'.$this->sericnum.'],说明:['.$sm.']';
// }
//退回 //退回
if($type == 'tui'){ // if($type == 'tui'){
$cont = '['.$this->adminname.']退回单据['.$this->modename.',单号:'.$this->sericnum.']到你这请及时处理,说明:'.$sm.''; // $cont = '['.$this->adminname.']退回单据['.$this->modename.',单号:'.$this->sericnum.']到你这请及时处理,说明:'.$sm.'';
} // }
//提交抄送 //提交抄送
if($type == 'chao'){ // if($type == 'chao'){
$cont = ''.$this->adminname.''.$sm.'了“'.$this->modename.'”'; // $cont = ''.$this->adminname.''.$sm.'了“'.$this->modename.'”';
if(!isempt($summary))$cont.=',摘要“'.$summary.'”'; // if(!isempt($summary))$cont.=',摘要“'.$summary.'”';
if($this->isflow>0)$cont.=',单号“'.$this->sericnum.'”'; // if($this->isflow>0)$cont.=',单号“'.$this->sericnum.'”';
$gname= ''; // $gname= '';
} // }
//评论 // //评论
if($type=='pinglun'){ // if($type=='pinglun'){
$cont = ''.$this->adminname.''.$act.'你的['.$this->modename.']单据,说明:'.$sm.''; // $cont = ''.$this->adminname.''.$act.'你的['.$this->modename.']单据,说明:'.$sm.'';
$gname = ''; // $gname = '';
} // }
//回执确认 //回执确认
if($type=='receipt'){ // if($type=='receipt'){
$cont = ''.$this->adminname.''.$act.'['.$this->modename.']的单据'; // $cont = ''.$this->adminname.''.$act.'['.$this->modename.']的单据';
if($sm!='')$cont.=',说明:'.$sm.''; // if($sm!='')$cont.=',说明:'.$sm.'';
$gname = '回执确认'; // $gname = '回执确认';
$tit = '回执确认'; // $tit = '回执确认';
} // }
$nbis = $this->flownexttodo($type); //自定义推送内容 $nbis = $this->flownexttodo($type); //自定义推送内容
if($nbis){ if($nbis){
...@@ -1883,6 +1899,8 @@ class flowModel extends Model ...@@ -1883,6 +1899,8 @@ class flowModel extends Model
$cont = arrvalue($nbis, 'cont', $cont); $cont = arrvalue($nbis, 'cont', $cont);
} }
} }
if($type == 'finish')$tit="OA系统提示:您有一条审批已完成";
if($type == 'nothrough')$tit="OA系统提示:您有一条审批被拒绝";
if($cont!='')$this->push($nuid, $gname, $cont, $tit); if($cont!='')$this->push($nuid, $gname, $cont, $tit);
} }
...@@ -2236,6 +2254,7 @@ class flowModel extends Model ...@@ -2236,6 +2254,7 @@ class flowModel extends Model
$wxurl = arrvalue($params, 'wxurl', $wxurl); //移动端URL $wxurl = arrvalue($params, 'wxurl', $wxurl); //移动端URL
$emurl = arrvalue($params, 'emurl', $emurl); //邮件上URL $emurl = arrvalue($params, 'emurl', $emurl); //邮件上URL
$this->emurl = $emurl;
$slx = 0; $slx = 0;
$pctx = $moders['pctx']; $pctx = $moders['pctx'];
$mctx = $moders['mctx']; $mctx = $moders['mctx'];
...@@ -2248,6 +2267,15 @@ class flowModel extends Model ...@@ -2248,6 +2267,15 @@ class flowModel extends Model
$this->rs['now_adminname'] = $this->adminname; $this->rs['now_adminname'] = $this->adminname;
$this->rs['now_modename'] = $modename; $this->rs['now_modename'] = $modename;
$cont = $this->rock->reparr($cont, $this->rs); $cont = $this->rock->reparr($cont, $this->rs);
$contt = strip_tags($cont);
if(strpos($contt,'北京广厦网络技术股份公司 GONN Network Technology Inc OA系统提示>,') !== false){
$contt=str_replace('北京广厦网络技术股份公司 GONN Network Technology Inc OA系统提示,','',$contt);
$contt=str_replace('链 接:>>> 更多信息请登录&nbsp;广厦网络OA办公系统&nbsp;进行查看,感谢您的使用和支持。 通过邮件或电话(010-62419724转829)联系我们,获得更多帮助。 OA办公系
统本邮件由系统自动发出,请勿直接回复 ','',$contt);
}
$receid = $this->adminmodel->gjoins($receid); $receid = $this->adminmodel->gjoins($receid);
$uids = m('todo')->addtodo($receid, $modename, $cont, $modenum, $id); $uids = m('todo')->addtodo($receid, $modename, $cont, $modenum, $id);
if($uids!='' && $moders['type'] != '系统' && $id > 0)$this->todosmodel->addtotouids($uids, array( if($uids!='' && $moders['type'] != '系统' && $id > 0)$this->todosmodel->addtotouids($uids, array(
...@@ -2264,9 +2292,9 @@ class flowModel extends Model ...@@ -2264,9 +2292,9 @@ class flowModel extends Model
//邮件提醒发送不发送全体人员的,太多了 //邮件提醒发送不发送全体人员的,太多了
if($emtx == 1 && $receid != 'all'){ if($emtx == 1 && $receid != 'all'){
$emcont = '您好:<br>'.$cont.'(邮件由系统自动发送)'; $emcont = ''.$cont.'';
if($emurl!=''){ if($emurl!=''){
$emcont.='<br><a href="'.$emurl.'" target="_blank" style="color:blue"><u>详情&gt;&gt;</u></a>'; $emcont.='<br><a href="'.$emurl.'" target="_blank" style="color:blue"><u></u></a>';
} }
$msg = m('email')->sendmail($title, $emcont, $receid); $msg = m('email')->sendmail($title, $emcont, $receid);
if($msg!='ok')m('log')->addlogs('邮件', $msg , 2); if($msg!='ok')m('log')->addlogs('邮件', $msg , 2);
...@@ -3396,8 +3424,10 @@ class flowModel extends Model ...@@ -3396,8 +3424,10 @@ class flowModel extends Model
if(!empty($customer)) { if(!empty($customer)) {
$url .= $customer['id']; $url .= $customer['id'];
$link = '<a href="'.$url.'" target="_blank" style="color:#2fa4e7">'.$customer['name']?:$name.'</a>'; $link = '<a href="'.$url.'" target="_blank" style="color:#2fa4e7">'.$customer['name']?:$name.'</a>';
return $link; } else {
$link = $name;
} }
return $link;
} }
public function getSupplierLink($name){ public function getSupplierLink($name){
...@@ -3411,8 +3441,10 @@ class flowModel extends Model ...@@ -3411,8 +3441,10 @@ class flowModel extends Model
if(!empty($supplier)) { if(!empty($supplier)) {
$url .= $supplier['id']; $url .= $supplier['id'];
$link = '<a href="'.$url.'" target="_blank" style="color:#2fa4e7">'.$supplier['name']?:$name.'</a>'; $link = '<a href="'.$url.'" target="_blank" style="color:#2fa4e7">'.$supplier['name']?:$name.'</a>';
return $link; } else {
$link = $name;
} }
return $link;
} }
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论