信呼v2.5.1版本

This commit is contained in:
雨中磐石
2022-11-17 16:20:57 +08:00
parent 44100a4ab9
commit f4d68700c7
65 changed files with 1642 additions and 245 deletions

View File

@@ -0,0 +1,101 @@
<?php
class flow_collectmClassModel extends flowModel
{
public function flowrsreplace($rs, $lx=0)
{
$state = $rs['state'];
if($state=='0')$rs['state']='<font color=blue>待生成</font>';
if($state=='1')$rs['state']='<font color=green>已生成</font>';
$rs['fenleival'] = $rs['fenlei'];
if($rs['fenlei']=='0')$rs['fenlei']='内部';
if($rs['fenlei']=='1')$rs['fenlei']='<font color=blue>外部</font>';
if($rs['fenleival']=='0'){
$yixs = $this->rows('`type`=3 and `leixing`='.$rs['id'].' and `isturn`=1');
$rs['leixing'] = ''.$rs['leixing'].'/'.$yixs.'';
}
return $rs;
}
//生成收集表格
protected function flowoptmenu($ors, $crs)
{
if($ors['num']=='noupcreate' && $this->rs['fenlei']=='0'){
$where = $this->adminmodel->gjoin($this->rs['runrenid'], 'ud', 'where');
$where = '`status`=1 and `workdate`<=\''.substr($this->rs['startdt'],0,10).'\' and '.$where.'';
$rows = $this->adminmodel->getall($where);
$flow = m('flow')->initflow('collects');
$shu = 0;
foreach($rows as $k=>$rs){
$shu++;
$uarr = array(
'uid' => $rs['id'],
'optdt' => $this->rock->now,
'optid' => $rs['id'],
'optname' => $rs['name'],
'applydt' => $this->rock->date,
'status' => 0,
'type' => 3,
'isturn' => 0,
'comid' => $this->rs['comid'],
'name' => $this->rs['name'],
'startdt' => $this->rs['startdt'],
'enddt' => $this->rs['enddt'],
'leixing' => $this->id,
'psren' => $this->uname,
'psrenid' => $this->rs['uid'],
);
$mid = $flow->insert($uarr);
$flow->loaddata($mid, false);
$flow->submit('保存', $crs['sm']);
$cont = '名称:'.$uarr['name'].'\n评审人'.$uarr['psren'].'\n截止时间'.$uarr['enddt'].'';
$flow->pushs($rs['id'],$cont, '你有信息收集表待完成');
}
$this->update('`state`=1,`leixing`='.$shu.'', $this->id);
}
//复制
if($ors['num']=='noupfuzhi'){
$flow = m('flow')->initflow('collectm');
$uarr = array(
'uid' => $this->adminid,
'optdt' => $this->rock->now,
'optid' => $this->adminid,
'optname' => $this->adminname,
'applydt' => $this->rock->date,
'status' => 0,
'state' => 0,
'type' => 2,
'isturn' => 0,
'comid' => $this->rs['comid'],
'name' => $this->rs['name'],
'startdt' => $this->rock->now,
'enddt' => date('Y-m-d H:i:s', time()+24*3600),
'leixing' => $this->rs['leixing'],
'runren' => $this->rs['runren'],
'runrenid' => $this->rs['runrenid'],
'explain' => $this->rs['explain'],
'fenlei' => $this->rs['fenlei'],
);
$mid = $flow->insert($uarr);
$dsbs = m('plans');
$zrows = $dsbs->getall('mid='.$this->id.'');
foreach($zrows as $k=>$rs1){
$iuarr = $rs1;
unset($iuarr['id']);
$iuarr['mid'] = $mid;
$dsbs->insert($iuarr);
}
$flow->loaddata($mid, false);
$flow->submit('保存', $crs['sm']);
}
}
}

View File

@@ -0,0 +1,159 @@
<?php
class flow_collectsClassModel extends flowModel
{
public $subtable = 'plans';
public function flowfieldarr($farr, $lx)
{
$mid = (int)$this->rock->post('mid','0');
//if($mid==0)$mid = (int)$this->rock->post('id','0');
$this->newfarr = array();
if($mid){
$mrs = $this->getone($mid);
$sid = $mrs['leixing'];
$zrows = m($this->subtable)->getall('mid='.$sid.'','*','`sort`');
foreach($zrows as $k=>$rs){
$frs = $farr[0];
$frs['name'] = $rs['pitem'];
$frs['fieldstype'] = $rs['zxren'];
$frs['data'] = $rs['zxrenid'];
$frs['attr'] = '';
$frs['lens'] = '0';
$frs['isbt'] = ($rs['itemid']=='1')?'1':'0';
$frs['islu'] = '1';
$frs['id'] = '0';
$frs['fields'] = 'sitemid_'.$rs['id'].'';
$farr[] = $frs;
$this->newfarr[] = $frs;
}
}
return $farr;
}
//在运行这个,模版处理
public function flowinputtpl($cont, $lx)
{
//pc
if($lx==0){
$str = '';
foreach($this->newfarr as $k=>$rs){
$str.='<tr><td class="ys1" align="right">'.(($rs['isbt']=='1')?'*':'').''.$rs['name'].'</td><td colspan="3" class="ys2">{'.$rs['fields'].'}</td></tr>';
}
$cont = str_replace('{autotpl}', $str, $cont);
}
return $cont;
}
//报错子表信息
protected function flowsubmit($na, $sm)
{
$sid = $this->rs['leixing'];
$dbs = m($this->subtable);
$zrows = $dbs->getall('mid='.$sid.'','*','`sort`');
foreach($zrows as $k=>$rs){
$fields = 'sitemid_'.$rs['id'].'';
$where = '`mid`='.$this->id.' and `itemid`='.$rs['id'].'';
$uarr = array(
'pitem' => $rs['pitem'],
'zxren' => $this->rock->post($fields),
'zxrenid' => $this->rock->post($fields.'id'),
'itemid'=> $rs['id'],
'mid' => $this->id,
'comid' => $this->rs['comid'],
'sort' => $rs['sort'],
);
if($dbs->rows($where)==0)$where='';
$dbs->record($uarr, $where);
}
$this->updaterenshu($sid);
}
public function updaterenshu($sid)
{
$zrshu = $this->rows('`leixing`='.$sid.' and `type`=3 and `status`<>5');
$this->update('`leixing`='.$zrshu.'', $sid);
}
protected function flowrsreplaceedit($rs)
{
$this->addotherfield();
$zrows = m($this->subtable)->getall('mid='.$rs['id'].'','*','`sort`');
foreach($zrows as $k=>$rs1){
$rs['sitemid_'.$rs1['itemid'].''] = $rs1['zxren'];
$this->rssust['sitemid_'.$rs1['itemid'].''] = $rs1['zxren'];
}
return $rs;
}
/*
protected function flowgetfields($lx)
{
$zrows = m($this->subtable)->getall('mid='.$this->id.'','*','`sort`');
$arr = array();
foreach($zrows as $k=>$rs1){
$arr['sitemid_'.$rs1['itemid'].''] = $rs1['pitem'];
}
return $arr;
}*/
private function addotherfield()
{
$frs = $this->fieldsarra[0];
$sid = $this->rs['leixing'];
$zrows = m($this->subtable)->getall('mid='.$sid.'','*','`sort`');
foreach($zrows as $k=>$rs1){
$frs['name'] = $rs1['pitem'];
$frs['fieldstype'] = $rs1['zxren'];
$frs['islu'] = '1';
$frs['fields'] = 'sitemid_'.$rs1['id'];
$this->fieldsarra[] = $frs;
$this->fieldsarr[] = $frs;
}
}
public function flowrsreplace($rs, $lx=0)
{
if($lx==1 || $lx==3){
$rs = $this->flowrsreplaceedit($rs);
}
return $rs;
}
protected function flowzuofeibill($sm)
{
//$this->update('`leixing`=`leixing`-1', $this->rs['leixing']);
$this->updaterenshu($this->rs['leixing']);
m($this->subtable)->delete('`mid`='.$this->id.'');
}
public function flowxiangfields(&$fields)
{
$fields['base_name'] = '填写人';
$fields['base_deptname'] = '填写人部门';
return $fields;
}
protected function flowbillwhere($uid, $lx)
{
$where = '';
$leixingid = (int)$this->rock->post('leixingid');
if($leixingid>0)$where='and `leixing`='.$leixingid.'';
return array(
'keywhere' => $where,
);
}
}

View File

@@ -11,6 +11,7 @@ class flow_custractClassModel extends flowModel
$this->goodmobj = m('goodm');
$this->wherejoin['custfina'] = 'htid';
$this->wherejoin['custfinb'] = 'htid';
}
//作废或删除时

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,16 @@
<?php
//健康报备
class flow_yqhealthyClassModel extends flowModel
{
public function flowrsreplace($rs, $lx=0)
{
$rs['stateval']=$rs['state'];
if($rs['state']=='0')$rs['state']='<font color="green">绿码</font>';
if($rs['state']=='1')$rs['state']='<font color="#ff6600">黄码</font>';
if($rs['state']=='2')$rs['state']='<font color="red">红码</font>';
return $rs;
}
}