var temp1 = [ { "id": 24386, "hospitalCode": "47000593033030211A1001", "type": "照片质量", "depArea": null, "dep": "MRI", "modality": null, "item": "不合格", "itemPy": "BHG", "itemValue": "≥10,<70", "sortid": 4, "remark": null, "remark2": null } ] for(let i= 0; i<temp1.length; i++) { var obj = temp1[i]; (function(i){ var obk = JSON.parse(JSON.stringify(obj)) obk.hospitalCode = 'demohospital' obk.sortId = obk.sortId + ''; insertItemList(obk).then(res => { }) })(i) }
---------------------
批量录入部位
var temp1 = [ { "id": 12898, "hospitalCode": "47000593033030211A1001", "itemCode": "27431973", "dep": "US", "modality": "USMF", "bigpart": "超声造影检查", "bigpartEn": "1973", "smallpart": "超声造影(脏器声学造影)", "smallpartEn": "1973", "workCount": null, "filter": null, "partType": 0, "templatePart": null, "itemProperty": "造影", "sortCode": null, "partSort": 16, "hisid": "27431973", "uisId": null, "examNoticeGroup": null, "itemName": null, "checkGroup": null, "partModality": null } ] for(let i= 0; i<temp1.length; i++) { var obj = temp1[i]; (function(i){ var obk = JSON.parse(JSON.stringify(obj)) obk.hospitalCode = 'demohospital' obk.sortId = ''; obk.examNotice = ''; obk.checkGroup = ''; delete obk.id; addHisRegister(obk).then(res => { }) })(i) } }