如何获取关联表单的相关字段内容,发送通知

问答  收藏
1 / 507

我一开始使用的代码,类似这种,
var pici =JSON.parse(input.pici);
var num=JSON.parse(input.num);
var sunhao=JSON.parse(input.sunhao);
var op="";
for(var i=0;i<pici.length;i++){
op+="批次号:"+pici[i]+","+"出库数量:"+num[i]+"损耗数量:"+sunhao[i]+" \n ";
}
output={output:op}
但是换个表单使用,修改相应参数名称后,代码无法使用。
点测试,提示
代码错误

(node:21776) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token T in JSON at position 0 at JSON.parse () at API (api.js:3:17) at Object. (api.js:14:1) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19)(node:21776) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)(node:21776) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.