...
 
Commits (5)
    https://gitcode.net/phpchina/tpflow/-/commit/8384ee9653261c225f0bf83f4d5500f99a548d6c update src/service/method/Tpl.php. 2023-04-27T05:55:28+00:00 dragonseaErp 2125347375@qq.com 原有exit,影响模板后续HTML的输出,会破坏html的dom结构 Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:2125347375@qq.com" title="2125347375@qq.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg6" style="text-decoration: none">N</a><a href="mailto:2125347375@qq.com" title="2125347375@qq.com">dragonseaErp</a> &lt;<a href="mailto:2125347375@qq.com" title="2125347375@qq.com">2125347375@qq.com</a>&gt;</span> https://gitcode.net/phpchina/tpflow/-/commit/bfefcb15599ab53ce5e6d3975cfdf226a86f776e 转出条件取角色下,无权限审批BUG 2023-05-05T02:48:13+00:00 逆天的蝈蝈 632522043@qq.com Signed-off-by: <span data-trailer="Signed-off-by:" data-user="392949"><a href="https://gitcode.net/g632522043" title="632522043@qq.com"><img alt="逆天的蝈蝈's avatar" src="https://profile-avatar.csdnimg.cn/eedaf1a14146408daaf3efd0f78fd9c7_g632522043.jpg!1" class="avatar s16 avatar-inline" title="逆天的蝈蝈"></a><a href="https://gitcode.net/g632522043" title="632522043@qq.com">逆天的蝈蝈</a> &lt;<a href="mailto:632522043@qq.com" title="632522043@qq.com">632522043@qq.com</a>&gt;</span> https://gitcode.net/phpchina/tpflow/-/commit/8d34583e3cd24ad4543660561d50225a643677dc !40 转出条件取角色下,无权限审批BUG 2023-05-28T00:59:33+00:00 逆天的蝈蝈 632522043@qq.com Merge pull request !40 from 逆天的蝈蝈/N/A https://gitcode.net/phpchina/tpflow/-/commit/08ec5000bc890c906ea38dc6bf5dc10d2dcedb12 !39 update src/service/method/Tpl.php. 2023-05-28T01:06:26+00:00 逆天的蝈蝈 632522043@qq.com Merge pull request !39 from dragonseaErp/N/A https://gitcode.net/phpchina/tpflow/-/commit/99991f57ddbf57153a192c40533fa1a80de98ddf V7.0.3 正式版本 2023-05-28T09:09:56+08:00 guoguo 1838188896@qq.com
......@@ -30,6 +30,20 @@ var Tpflow = {
content: url
});
},
wopen : function(title,url) {
if (title == null || title === '') {
title=false;
}
layer.open({
type: 2,
area: ['550px', '320px'],
fix: false, //不固定
maxmin: true,
shade:0.4,
title: title,
content: url
});
},
lclose : function() {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
......
......@@ -52,6 +52,15 @@ use think\facade\Request;
return unit::return_msg(Control::WfCenter($act,input('wf_fid'),input('wf_type'),['wf_op'=>$wf_op,'ssing'=>$ssing,'submit'=>$submit]));
}
}
//通过ajax方式调用
if($act=='ajax_do'){
$wf_op = input('wf_op') ?? 'check';
$ssing = input('ssing') ?? 'sing';
$submit = input('submit') ?? 'ok';
$data = Control::WfCenter($act,input('wf_fid'),input('wf_type'),['wf_op'=>$wf_op,'ssing'=>$ssing,'submit'=>$submit]);
return unit::return_msg($data);
}
/*用户确认抄送*/
if($act=='entCc'){
return Control::WfCenter($act,input('id'));
......
......@@ -297,7 +297,15 @@ class Info
$arrMatches = [];
preg_match_all($strPattern, $strSubject, $arrMatches);
foreach($arrMatches[0] as $k1 => $v1){// Guoke 2021/11/25 17:08 官方BUG
$strSubject = str_ireplace(['【' . $v1 . '】'], [($bill_info[$v1] ?? ' sys field err ')], $strSubject);
//*增加模板变量*//
if (strpos($v1, '@') !== false) {
$v1_array = explode("@", $v1);
$v1_value = $bill_info[$v1_array[0]];
$v1_rvalue = Bill::getbillvalue($v1_array[1],$v1_value,$v1_array[2]) ?? ' sys field err ';
$strSubject = str_ireplace(['【' . $v1 . '】'], [$v1_rvalue], $strSubject);
}else{
$strSubject = str_ireplace(['【' . $v1 . '】'], [($bill_info[$v1] ?? ' sys field err ')], $strSubject);
}
}
$result[$k]['tmp'] =$strSubject;
$result[$k]['user'] = rtrim($sponsor_text, ",");
......
......@@ -93,7 +93,7 @@ class lib
/*事务增加角色判断*/
if ($flowinfo['status']['auto_person'] == 6) {
if ($flowinfo['status']['word_type']==1) {
if (in_array($thisuser['thisuid'], $user)) {
if (in_array($thisuser['thisrole'], $user)) {
$st = 1;
}
}else{
......@@ -752,15 +752,15 @@ php;
}
}
if ($flowinfo['sing_st'] == 0) {
$html = '<a class="button" onclick=Tpflow.lopen("提交工作流","' . $info['tpflow_ok'] . '",45,42) style="background-color: #19be6b">√ 同意</a> ';
$html = '<a class="button" onclick=Tpflow.wopen("提交工作流","' . $info['tpflow_ok'] . '",45,42) style="background-color: #19be6b">√ 同意</a> ';
if ($flowinfo['status']['is_back'] != 2) {
$html .= '<a class="button" onclick=Tpflow.lopen("工作流回退","' . $info['tpflow_back'] . '",45,42) style="background-color: #c9302c;">↺ 驳回</a> ';
$html .= '<a class="button" onclick=Tpflow.wopen("工作流回退","' . $info['tpflow_back'] . '",45,42) style="background-color: #c9302c;">↺ 驳回</a> ';
}
if ($flowinfo['status']['is_sing'] != 2) {
$html .= '<a class="button" onclick=Tpflow.lopen("工作流会签","' . $info['tpflow_sign'] . '&ssing=sing",45,42) style="background-color: #f37b1d;">⇅ 会签</a>';
$html .= '<a class="button" onclick=Tpflow.wopen("工作流会签","' . $info['tpflow_sign'] . '&ssing=sing",45,42) style="background-color: #f37b1d;">⇅ 会签</a>';
}
} else {
$html = '<a class="button" style="background-color: #19be6b" onclick=Tpflow.lopen("会签提交","' . $info['tpflow_ok'] . '&submit=sok",45,42)>↷ 会签提交</a> <a class="button" style="background-color: #c9302c;" onclick=Tpflow.lopen("会签回退","' . $info['tpflow_ok'] . '&submit=sback",45,42)>↶ 会签回退</a> <a class="button" style="background-color: #f37b1d;" onclick=Tpflow.lopen("工作流会签","' . $info['tpflow_sign'] . '&ssing=ssing",45,42)>⇅ 再会签</a>';
$html = '<a class="button" style="background-color: #19be6b" onclick=Tpflow.wopen("会签提交","' . $info['tpflow_ok'] . '&submit=sok",45,42)>↷ 会签提交</a> <a class="button" style="background-color: #c9302c;" onclick=Tpflow.wopen("会签回退","' . $info['tpflow_ok'] . '&submit=sback",45,42)>↶ 会签回退</a> <a class="button" style="background-color: #f37b1d;" onclick=Tpflow.wopen("工作流会签","' . $info['tpflow_sign'] . '&ssing=ssing",45,42)>⇅ 再会签</a>';
}
$html .= ' <a class="button" onclick=Tpflow.lopen("审批历史","' . $info['tpflow_log'] . '",50,40)>✤ 审批历史</a> <a class="button" onclick=Tpflow.lopen("审批历史","' . $tpflow_view. '",50,80) style="background-color: #3963bc;">❤ 流程图</a> ';
$tmp = self::commontmp('Tpflow V7.0 ');
......@@ -773,7 +773,7 @@ php;
<div class='TpflowForm' >
<div class='TpflowHead'>单据信息</div>
<div style='width:100%;overflow-y:scroll; height:100%;'>
<iframe src="{$url}" id="iframepage" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" onLoad="Tpflow.SetHeight()"></iframe>
<iframe src="{$url}&is_wf=1" id="iframepage" frameborder="0" scrolling="yes" marginheight="0" marginwidth="0" onLoad="Tpflow.SetHeight()"></iframe>
</div>
</div>
{$tmp['js']}
......@@ -781,7 +781,24 @@ php;
</html>
php;
}
public static function tmp_check_ajax($info, $flowinfo)
{
$tpflow_view = $info['tpflow_view'].$flowinfo['status']['run_flow'];
if ($flowinfo['sing_st'] == 0) {
$html = '<a class="button" onclick=Tpflow.lopen("提交工作流","' . $info['tpflow_ok'] . '",45,42) style="background-color: #19be6b">√ 同意</a> ';
if ($flowinfo['status']['is_back'] != 2) {
$html .= '<a class="button" onclick=Tpflow.lopen("工作流回退","' . $info['tpflow_back'] . '",45,42) style="background-color: #c9302c;">↺ 驳回</a> ';
}
if ($flowinfo['status']['is_sing'] != 2) {
$html .= '<a class="button" onclick=Tpflow.lopen("工作流会签","' . $info['tpflow_sign'] . '&ssing=sing",45,42) style="background-color: #f37b1d;">⇅ 会签</a>';
}
} else {
$html = '<a class="button" style="background-color: #19be6b" onclick=Tpflow.lopen("会签提交","' . $info['tpflow_ok'] . '&submit=sok",45,42)>↷ 会签提交</a> <a class="button" style="background-color: #c9302c;" onclick=Tpflow.lopen("会签回退","' . $info['tpflow_ok'] . '&submit=sback",45,42)>↶ 会签回退</a> <a class="button" style="background-color: #f37b1d;" onclick=Tpflow.lopen("工作流会签","' . $info['tpflow_sign'] . '&ssing=ssing",45,42)>⇅ 再会签</a>';
}
$html .= ' <a class="button" onclick=Tpflow.lopen("审批历史","' . $info['tpflow_log'] . '",50,40)>✤ 审批历史</a> <a class="button" onclick=Tpflow.lopen("审批历史","' . $tpflow_view. '",50,80) style="background-color: #3963bc;">❤ 流程图</a> ';
return $html;
}
/**
* 步骤属性模板
*
......
......@@ -162,6 +162,11 @@ class TaskFlow
public function Run($config, $uid, $todo)
{
//日志记录
$run_log = Log::AddrunLog($uid, $config['run_id'], $config, 'ok');
if (!$run_log) {
return ['msg' => '消息记录失败,数据库错误!!!', 'code' => '-1'];
}
$nex_pid = explode(",", $config['npid']);
foreach ($nex_pid as $v) {
$wf_process = Process::GetProcessInfo($v, $config['run_id']);
......@@ -171,10 +176,6 @@ class TaskFlow
if (!$wf_process_log) {
return ['msg' => '流程步骤操作记录失败,数据库错误!!!', 'code' => '-1'];
}
//日志记录
$run_log = Log::AddrunLog($uid, $config['run_id'], $config, 'ok');
if (!$run_log) {
return ['msg' => '消息记录失败,数据库错误!!!', 'code' => '-1'];
}
}
}
\ No newline at end of file
......@@ -79,6 +79,27 @@ class Tpl
}
if ($act == 'entCc') {
return Cc::ccCheck($wf_fid);
}
if ($act == 'ajax_do') {
$urls = unit::gconfig('wf_url');
$sup = $_GET['sup'] ?? '';
$wf_op = $data['wf_op'];
$info = [
'wf_fid' => $wf_fid,
'wf_type' => $wf_type,
'wf_submit' => $data['submit'],
'tpflow_ok' => $urls['wfdo'] . '?act=do&wf_op=ok&wf_type=' . $wf_type . '&wf_fid=' . $wf_fid . '&sup=' . $sup,
'tpflow_back' => $urls['wfdo'] . '?act=do&wf_op=back&wf_type=' . $wf_type . '&wf_fid=' . $wf_fid . '&sup=' . $sup,
'tpflow_sign' => $urls['wfdo'] . '?act=do&wf_op=sign&wf_type=' . $wf_type . '&wf_fid=' . $wf_fid . '&sup=' . $sup,
'tpflow_flow' => $urls['wfdo'] . '?act=do&wf_op=flow&wf_type=' . $wf_type . '&wf_fid=' . $wf_fid . '&sup=' . $sup,
'tpflow_log' => $urls['wfdo'] . '?act=do&wf_op=log&wf_type=' . $wf_type . '&wf_fid=' . $wf_fid . '&sup=' . $sup,
'tpflow_view' => $urls['wfapi'] . '?act=view&id=',
'tpflow_upload' => unit::gconfig('wf_upload_file')
];
if ($wf_op == 'check') {
return lib::tmp_check_ajax($info, self::WfCenter('Info', $wf_fid, $wf_type));
}
}
//流程审批
if ($act == 'do') {
......@@ -97,6 +118,7 @@ class Tpl
'tpflow_view' => $urls['wfapi'] . '?act=view&id=',
'tpflow_upload' => unit::gconfig('wf_upload_file')
];
if ($wf_op == 'check') {
return lib::tmp_check($info, self::WfCenter('Info', $wf_fid, $wf_type));
}
......@@ -648,8 +670,7 @@ class Tpl
function wfAccess($act, $data = '')
{
if ($act == 'log') {
echo Log::FlowLog($data['id'], $data['type']);
exit;
return Log::FlowLog($data['id'], $data['type']);
}
if ($act == 'btn') {
$info = [];
......@@ -684,7 +705,7 @@ class Tpl
$tmpRaw .= "$p FIND_IN_SET('$v',f.sponsor_ids)";
$p=' or';
}
$mapRaw = '(f.auto_person != 5 and FIND_IN_SET(' . unit::getuserinfo('uid') . ",f.sponsor_ids)) or (f.auto_person=5 and ($tmpRaw))";
$mapRaw = '(f.auto_person != 5 and FIND_IN_SET(' . unit::getuserinfo('uid') . ",f.sponsor_ids)) or (f.auto_person=5 and ($tmpRaw))or (f.auto_person=6 and ($tmpRaw))";
$data = Run::dataRunProcess($map,$mapRaw, $field, $order, $group,$page,$limit);
}
......