You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

129 lines
3.7 KiB

<?php
include 'day_off-schema.php';
include "../header.php";
/**
* 发起流程
*/
#error_reporting(E_ALL);
#ini_set("display_errors", "on");
require_once "wf_common.php";
#系统ID
$system_id = 'con';
#流程ID
$flow_id = 'con02';
#表单号 $form_id;
$form_id = "";
$wf = new WorkFlow($system_id, $flow_id, $form_id);
$wf->initWorkFlow(ID);
$form_key = $wf->flowContext->getFormKey();
$flowName = $wf->getFlowName();
$assigner = $wf->getAssignerList();
$assign_status = $wf->getAssignStatus($assigner);
//结束
?>
<!--workflow JS新增 start -->
<script type="text/javascript" src='../assets/js/lib/jquery-3.4.1.min.js'></script>
<script type="text/javascript">
$(document).ready(function() {
var assigner = eval('<?= json_encode($assigner) ?>');
$('#assign_status').change(function() {
$("#next_users").empty();
var _selected_status = $(this).children('option:selected').val(); //获取被选择的状态
var _option_tmp = ""; //获取下拉列表
for (a in assigner) { //遍历assigner
if (assigner[a][0] == _selected_status) {
_tmp = assigner[a][1].split(',');
for (var b in _tmp) {
if (_tmp[b] == '') {
continue;
}
_uname = _tmp[b].split('-')[1];
_uid = _tmp[b].split('-')[0];
/* console.log(_tmp[b]);*/
_option_tmp += '<option value=' + _uid + '>' + _tmp[b] + '</option>';
}
}
}
$("#next_users").append(_option_tmp);
});
});
</script>
<!--workflow JS新增 end -->
<div class="container">
<?php
include "$system_name-record-submit.php";
/*
if($_SERVER["REQUEST_METHOD"] == "POST"){
if(empty($_POST["id"]) && empty($_POST["expert_id"]) && empty($_POST["personal_id"])){
echo "<p class='error'>Please fill up the required field!</p>";
} else {
echo "<p class='success'>Record has added successfully</p>";
}
}
*/
?>
<form class="form-inline" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data">
<input type='hidden' value='<?= $form_key ?>' name='form_key' id='form_key'>
<?php for ($i = 0; $i < count($html_schema); ++$i) { ?>
<div>
<?php
$label = $html_schema[$i]["label"];
$element_type = $html_schema[$i]["type"];
$name_id = $html_schema[$i]["id"];
$placeholder = $html_schema[$i]["placeHolder"];
$others = $html_schema[$i]["others"];
# 產生Label
if (stripos($others, "required")) {
echo "<label for='$name_id'>" . $label . "(必填)</label>";
} else {
echo "<label for='$name_id'>" . $label . "</label>";
};
# 產生輸入內容
switch ($element_type) {
case "text":
#echo "<input type='" . $html_schema[$i]["type"] . "' name='" . $html_schema[$i]["id"] . "' id='" $html_schema[$i]["id"] . "' placeholder='" . $html_schema[$i]["placeHolder"] . " " . $html_schema[$i]["others"] . ">";
echo "<input type='text' name='$name_id' id='$name_id' $others>";
break;
default:
echo "<input type='text' name='$name_id' id='$name_id' $others>";
break;
};
?>
</div>
<?php }; ?>
<label for="assign_opinion">签核意见</label>
<input type='text' value='' name='assign_opinion' id='assign_opinion '>
<label for="assign_status">签核状态</label>
<select name="assign_status" id="assign_status">
<?php echo $assign_status; ?>
</select>
<label for="next_users">下位签核者</label>
<select name="next_users" id="next_users">
</select>
<div>
<p class="error"><?php echo $create_at_error; ?></p>
</div>
<div>
<button type="submit" name="submit">確定</button>
</div>
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form>
</div>