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.
 
 
 
 
 
 

77 lines
2.3 KiB

<?php
$now = gmdate("YmdHis");
$data = 'M0000.' . $now;
$sign = hash_hmac('SHA256', $data, 'B2D6395D2883E26C', false);
?>
<script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
<script>
var body = [{
"name": "salIncomeApplyMaster",
"rows": [{
"BillNo": "Z001",
"BillDate": 20160811,
"OrgId": "1000",
"FOrgId": "1000",
"TypeId": "RR",
"BpOrgId": "1000",
"BizPartnerId": "C002",
"CurrId": "RMB",
"CurrOAmount": 1,
"CurrLAmount": 1,
"PersonId": "T001",
"DtOrgId": "1000",
"DueToId": "C002",
"TaxId": "123",
"CompId": "1000"
}]
},
{
"name": "salIncomeApplyDetail",
"rows": [{
"BillNo": "Z001",
"IncomeId": "F203",
"TaxId": "ST003",
"RowCode": 1,
"ItemType": "1",
"SPrice": 50,
"SQuantity": 1,
"FromSourceTag": 0,
"FromBillNo": "123"
}]
}
]
var json = JSON.stringify(body);
console.log(json);
// obj = {
// type: 'POST',
// // url: `${corsurl}${apiurl}`,
// url: `${apiurl}`,
// dataType: 'json',
// headers: headerParam,
// data: json,
// // dataType: "json",
// success: function(res) {
// console.log(res.Status);
// console.log(res.ErrorMsg);
// console.log(res.Data);
// }
// };
// jQuery.ajax(obj);
// // }
// })
$.ajax({
url: 'https://127.0.0.1:780/twWebAPI/V1/SALINCOMEAPPLY/PostERPData',
method: 'POST',
dataType: 'json',
// headers: headerParam,
data: body,
success: function(res) {
console.log('Success');
},
error: function(err) {
console.log(err);
}
})
</script>