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.
209 lines
5.5 KiB
209 lines
5.5 KiB
1 month ago
|
<script type="text/javascript">
|
||
|
var piid_wf = $.getURLParam('_piid');//piid
|
||
|
var todoid_wf = $.getURLParam('_todoid');//
|
||
|
var _gridcode_wf = 'pf.workflow.todo.opinions';
|
||
|
var _gridid_wf = $.getUUID();
|
||
|
var _height_wf = 0;
|
||
|
var _personList_wf = [];
|
||
|
$(function(){
|
||
|
if(todoid_wf && todoid_wf.length>0){
|
||
|
$('.workflow-user').css("display","block");
|
||
|
var dataParam = {
|
||
|
_SRVNAME : 'service.wf.frame',
|
||
|
_SRVMETHOD: 'getParticipantByNodenameSimple',
|
||
|
_DATA: $.json2str({
|
||
|
su:$.getSessionUser()
|
||
|
,piid: piid_wf
|
||
|
,todoid: todoid_wf
|
||
|
})
|
||
|
};
|
||
|
$.wait_open();
|
||
|
//初始化数据
|
||
|
$.cuajax({
|
||
|
url: 'wdk?action=wdk.pub&method=call_service&ajaxparam=' + new Date().getTime(),
|
||
|
method: 'post',
|
||
|
timeout: WDK_Timeout,
|
||
|
data: dataParam,
|
||
|
success: function(result) {
|
||
|
$.wait_close();
|
||
|
//返回值字符串转json
|
||
|
var jres = $.str2json(result);
|
||
|
|
||
|
if (jres && jres.result) { //操作成功
|
||
|
_personList_wf = jres.result;
|
||
|
if(_personList_wf.length>0){
|
||
|
$.combobox({
|
||
|
id:'wf_users'
|
||
|
,data:_personList_wf
|
||
|
,idField:'person_uuid'
|
||
|
,textField:'person_name'
|
||
|
,required:true
|
||
|
});
|
||
|
$.combobox_setValue({id:'wf_users',value:_personList_wf[0].person_uuid});
|
||
|
}else{
|
||
|
$('.workflow-user').css("display","none");
|
||
|
}
|
||
|
|
||
|
}
|
||
|
},
|
||
|
error: function(result) {
|
||
|
$.wait_close();
|
||
|
alert('网络错误!result=' + result);
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
$('.angle-change-updown').click(function(){
|
||
|
$(this).toggleClass("fa-angle-down");
|
||
|
$(this).toggleClass("fa-angle-up");
|
||
|
|
||
|
if($(this).hasClass('fa-angle-down')){
|
||
|
$('#deal_grid').css("display","");
|
||
|
if(!isRender()){
|
||
|
if(piid_wf){
|
||
|
var _data ={
|
||
|
_SRVNAME : 'service.wdk.wftodo',
|
||
|
_SRVMETHOD: 'queryDoneTodoBeanList',
|
||
|
_DATA: $.json2str({
|
||
|
op_acc_uuid:_sessionuser?_sessionuser.account_id:''
|
||
|
,piid: piid_wf
|
||
|
}),
|
||
|
_RSTYPE:'grid',
|
||
|
_RSFIELD:'result',
|
||
|
_RSPARAM:$.json2str({})
|
||
|
};
|
||
|
}
|
||
|
renderWfNotion(_data);
|
||
|
}else{
|
||
|
$('#deal_grid').parent().parent().css("height",$('#deal_grid').parent().parent().height()+(_height_wf-35));
|
||
|
}
|
||
|
}else{
|
||
|
$('#deal_grid').css("display","none");
|
||
|
$('#deal_grid').parent().parent().css("height",$('#deal_grid').parent().parent().height()-(_height_wf-35));
|
||
|
}
|
||
|
|
||
|
});
|
||
|
//默认隐藏
|
||
|
});
|
||
|
|
||
|
function formatter_senddt(value, row, index){
|
||
|
if(value.length>10 && value.indexOf("-") != -1){
|
||
|
return value.substr(0,10);
|
||
|
}else{
|
||
|
return value;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function isRender(){
|
||
|
var opts = $('#deal_grid').children();
|
||
|
if(opts && opts.length>0){
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
function renderWfNotion(_data){
|
||
|
$.grid({
|
||
|
id : _gridid_wf
|
||
|
,containerid : 'deal_grid'
|
||
|
,gridcode : _gridcode_wf
|
||
|
,checkbox : false
|
||
|
,checkOnSelect : false
|
||
|
,selectOnCheck : false
|
||
|
,url: 'wdk?action=wdk.pub&method=call_service&ajaxparam=' + new Date().getTime()
|
||
|
,queryParams: _data
|
||
|
,idField : 'id'
|
||
|
,fit:false
|
||
|
,fitColumns:true //是否自动填充满
|
||
|
,nowrap:true //自动换行
|
||
|
,pagination:false
|
||
|
,formatter:{
|
||
|
opercomment : "formatter_opercomment"
|
||
|
/* senddt : "formatter_senddt",
|
||
|
operdt : "formatter_operdt" */
|
||
|
}
|
||
|
,onClickRow:function(index, row){}
|
||
|
,onLoadSuccess:function(data){
|
||
|
var total = data.total;
|
||
|
if(total && total>0){
|
||
|
_height_wf = total*32+60;
|
||
|
}else{
|
||
|
_height_wf = 32+60;
|
||
|
}
|
||
|
|
||
|
$('#deal_grid').parent().parent().css("height",_height_wf);
|
||
|
}
|
||
|
,footer:[
|
||
|
|
||
|
]
|
||
|
});
|
||
|
}
|
||
|
|
||
|
function formatter_operdt(value, row, index){
|
||
|
if(value.length>10 && value.indexOf("-") != -1){
|
||
|
return value.substr(0,10);
|
||
|
}else{
|
||
|
return value;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function formatter_opercomment(value, row, index){
|
||
|
return "<span title='"+value+"'>"+value+"</span>";
|
||
|
}
|
||
|
|
||
|
$.extend({
|
||
|
getTodoSubmit:function(wf_committype,commment){
|
||
|
var selectedUserId = '';
|
||
|
try{
|
||
|
selectedUserId = $.combobox_getValue({id:'wf_users'});
|
||
|
}catch(e){
|
||
|
}
|
||
|
var selecedDeptId = '';
|
||
|
for(var i=0;i<_personList_wf.length;i++){
|
||
|
var row = _personList_wf[i];
|
||
|
if(row.person_uuid == selectedUserId){
|
||
|
selecedDeptId = row.depart_uuid;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
var TODO_SUBMIT = {
|
||
|
todoid:todoid_wf
|
||
|
,opertype:wf_committype
|
||
|
,opercomment:commment
|
||
|
};
|
||
|
if(selectedUserId && selecedDeptId && 'submit' == wf_committype){
|
||
|
//操作类型是提交才需要配置办理人
|
||
|
TODO_SUBMIT.targetactors = selectedUserId+',user,'+selecedDeptId
|
||
|
}
|
||
|
return TODO_SUBMIT;
|
||
|
}
|
||
|
});
|
||
|
</script>
|
||
|
<style type="text/css" >
|
||
|
.angle-change-updown{
|
||
|
float:right;
|
||
|
font-size:20px;
|
||
|
cursor:pointer;
|
||
|
}
|
||
|
</style>
|
||
|
<div class="" style="border-bottom: 1px solid #dadada;margin-bottom:5px;">
|
||
|
<span class="form-title-text">处理列表</span>
|
||
|
<span class="angle-change-updown fa fa-angle-up"></span>
|
||
|
<div style="clear: both;"></div>
|
||
|
</div>
|
||
|
<div style="height:100%;" class="workflow-area">
|
||
|
<div id="deal_grid">
|
||
|
</div>
|
||
|
<div class="row workflow-user" style="display:none;height:35px">
|
||
|
<div class="formgroup col-12" style="margin-bottom:6px;">
|
||
|
<label>下一环节处理人</label>
|
||
|
<div>
|
||
|
<input type="text" name="wf_users" id="wf_users" ></input>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|