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.
83 lines
2.2 KiB
83 lines
2.2 KiB
<?php
|
|
include "T8_Authorization.php";
|
|
echo "收貨申請單";
|
|
|
|
?>
|
|
<script>
|
|
console.log(<?= $now ?>);
|
|
get_Auth();
|
|
window.addEventListener('message', function(event) {
|
|
if (event.origin === "http://localhost:3000" && (typeof event.data === "string")) {
|
|
var validation = event.data;
|
|
console.log("event");
|
|
console.log(validation);
|
|
|
|
// var corsurl = 'http://cors-anywhere.herokuapp.com/';
|
|
var apiurl = 'http://60.244.87.101:880//twWebAPI/V1/PURRECEIVINGORDER/PostERPData';
|
|
headerParam = {
|
|
CHI_Authorization: `${validation}`,
|
|
};
|
|
var body = [
|
|
{
|
|
"name": "purReceivingOrderMaster",
|
|
"rows": [
|
|
{
|
|
"BillNo": "Z001",
|
|
"BillDate": 20210420,
|
|
"ReceiveOrgId": "1000",
|
|
"OrgId": "1000",
|
|
"DemandOrgId": "1000",
|
|
"TypeId": "RC",
|
|
"BizPartnerId": "Z001",
|
|
"PersonId": "Z001",
|
|
"CurrId": "NTD",
|
|
"CurrOAmount": 1,
|
|
"CurrLAmount": 1,
|
|
"ReciveDate": 20210420,
|
|
"DueToId": "Z001",
|
|
"TaxId": "ST005",
|
|
"DebtorOrgId": "1000",
|
|
"DebtorCurrOAmount": 1,
|
|
"DebtorCurrLAmount": 1,
|
|
"ReceiveCompId": "1000",
|
|
"DebtorCompId": "1000",
|
|
"DemandCompId": "1000"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "purReceivingOrderDetail",
|
|
"rows": [
|
|
{
|
|
"TaxId": "ST005",
|
|
"BillNo": "Z001",
|
|
"RowCode": "1",
|
|
"ItemType": 0,
|
|
"MaterialId": "Z001",
|
|
"ReceivingSQty": 1,
|
|
"SUnitId": "SET",
|
|
"SPrice": "100"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
;
|
|
var json = JSON.stringify(body);
|
|
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);
|
|
}
|
|
})
|
|
</script>
|