...
03.根据列表某一字段的值进行按钮的隐藏显示
代码块 | ||||
---|---|---|---|---|
| ||||
{ "condition": ["ITEM"], "label": "提交", "key": "submit", "hide": "=function(){if(ITEM()==null){return true} else { return ITEM().state!=1?false:true}}", "func": "=function(){var data=ITEM();if (data.state==1){SCOPE.show_warning('该数据已提交');return;};SCOPE.show_warning('正在处理,不要重复点击');SCOPE.dynamicAction('submit',{'data':data}).then(function(data){SCOPE.fetchData();});SCOPE.fetchData();}" }, { "label": "发送通知", "condition": "MULTI_ITEM", "key": "send_message", "hide": "=function(){if(ITEMS()==null){return true} else {var datas=ITEMS();var len=datas.length;for(var index=0;index<len;index++){if(datas[index].status==1){return true;}}return false;}}", "func": "=function(){var data=ITEMS();SCOPE.show_warning('正在处理,不要重复点击');SCOPE.dynamicAction('send_message',{'data':data}).then(function(data){SCOPE.fetchData();});SCOPE.fetchData();}" } |
04.点击按钮弹出另一个模型卡片
代码块 | ||
---|---|---|
| ||
{ "action": "DYNAMIC_INFO", "key": "dialog", "label": "编辑", "params": { "async": true, "model": "recruitment_plan_year", "state": "single_view", "mode": "edit", #new|edit|view "data": "=function(){return dataService.callHcmOpenApi('hcm.model.get',{'model':'recruitment_plan_year','id_':ITEM().id}) }" } } |
05.
...
查看流程
代码块 | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "actions": [ { "conditionlabel": ["ITEM查看流程"], "labelkey": "数据拆分workflow_check", "keycondition": "splitITEM", "hide": "=function(){if(ITEM()==null){return true} else { return ITEM().workFlowInstance.splitstate==0null?true:false:true}}", "left": true, "func": "=function(){var data=ITEM();if (data.split==1){SCOPE.showsuper_warninggo('该数据已拆分');return;};SCOPE.show_warning('正在处理,不要重复点击');SCOPE.dynamicAction('split',{'data':data}).then(function(data){SCOPE.fetchData();});SCOPE.fetchData();}" }, { workflow_bill_v3',{'business_id':229,'wf_inst_id':ITEM().wf_inst_id})}" } |
06.info层子模型增加导入导出按钮
代码块 | ||||
---|---|---|---|---|
| ||||
{ "sequence": 30, "conditionkey": ["ITEMimport"], "label": "提交导入", "keyfunc": "submit""=SCOPE.sub_import" }, { "sequence": 40, "hide "key": "=function(){if(ITEM()==null){return true} else { return ITEM().state!=1?false:true}}", "export", "label": "导出", "func": "=function(){var data=ITEM();if (data.state==1){SCOPE.show_warning('该数据已提交');return;};SCOPE.show_warning('正在处理,不要重复点击');SCOPE.dynamicAction('submit',{'data':data}).then(function(data){SCOPE.fetchData();});SCOPE.fetchData();}" sub_export" } |
07.点击按钮弹出 List界面
代码块 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
{ },{ "conditionkey": ["ITEMlist"], "label": "取消提交封存", "keyaction": "cancelDYNAMIC_LIST", "hideparams": "=function(){if(ITEM()==null){return true} else { return ITEM().state==1?false:true}}", { "model": "salary_budget_warn", "func "filter_dict": "=function(){var data=ITEM();if (data.state!=1){SCOPE.show_warning('该数据未提交');return;};SCOPE.show_warning('正在处理,不要重复点击');SCOPE.dynamicAction('cancel',{'data':data}).then(function(data){SCOPE.fetchData();});SCOPE.fetchData();}" }], "list_config": { return SCOPE.getAllFilterDict()}" }, "operate_defaultsequence": "=function(item){if(item.state!=1){SCOPE.editItem(item);}else{SCOPE.show_warning('该单据已提交不能修改')}}" } }, |