钉钉发起OA审批实例报错:Missingvalue
测试已解决,方案:``` $detail=[ [['name'=>'费用归类','value'=>'材料'], ['name'=>'名称','value'=>'测试材料'], ['name'=>'税金合计','value'=>'20'], ['name'=>'数量','value'=>'2'], ['name'=>'计量单位','value'=>'台'], ['name'=>'未税单价','value'=>'100'], ['name'=>'未税合计','value'=>'200'], ['name'=>'供应商','value'=>'测试供应商'], ['name'=>'发生日期','value'=>'2022-6-27'], ['name'=>'原始凭证号','value'=>'12313213'], ['name'=>'凭证照片','value'=>['http://test.univoa.com/storage/bxpz/62b6596e7af37.png']], ['name'=>'项备注','value'=>'测试备注']], ]; $formValue=[ ['name'=>'项目','value'=>'测试项目'], ['name'=>'系统单据号','value'=>'CESHI123213132'], ['name'=>'报销人','value'=>'测试报销人'], ['name'=>'单据金额汇总','value'=>'300.01'], ['name'=>'单据说明','value'=>'测试流程单据'], ['name'=>'单据明细','value'=>json_encode($detail,JSON_UNESCAPED_UNICODE)], ];
值需要转换为json格式,其他控件只要是数组的应该都需要转,比如图片控件;然后就是没有子控件列表,直接使用循环```$formValue=[];
foreach($param['formValue'] as $val){
$formValue[]=new formComponentValues($val);
}
``` 或者有子控件的:```foreach($param['formValue'] as $val){
if(isset($val['details'])){
$formValueDetail=[];
foreach($val['details'] as $value){
if(isset($value['details'])){
$details=[];
foreach($value['details'] as $value_1){
$details[]=new details($value_1);
}
$formValueDetail[]=new \AlibabaCloud\SDK\Dingtalk\Vworkflow_1_0\Models\StartProcessInstanceRequest\formComponentValues\details([
'name'=>$value['name'],'value'=>$value['value'],'details'=>$details
]);
}else{
$formValueDetail[]= new \AlibabaCloud\SDK\Dingtalk\Vworkflow_1_0\Models\StartProcessInstanceRequest\formComponentValues\details($value);
}
}
$formValue[]=new formComponentValues(['name'=>$val['name'],'value'=>$val['value'],'details'=>$formValueDetail]);
}else{
$formValue[]=new formComponentValues($val);
}
}
赞0
踩0