diff --git a/wms/contract-repair/api/bpmAPI.php b/wms/contract-repair/api/bpmAPI.php index b6b686be..a6d9d76e 100644 --- a/wms/contract-repair/api/bpmAPI.php +++ b/wms/contract-repair/api/bpmAPI.php @@ -1,4 +1,6 @@ execute(); $result = $stmt->fetch(PDO::FETCH_ASSOC); // echo '
';
-// print_r(json_encode($result));
+// print_r($result);
 // echo '
'; -return json_encode($result); +echo json_encode($result, JSON_UNESCAPED_UNICODE); diff --git a/wms/contract/api/T8salIncomeApply.php b/wms/contract/api/T8salIncomeApply.php index b0f4e018..96246a7c 100644 --- a/wms/contract/api/T8salIncomeApply.php +++ b/wms/contract/api/T8salIncomeApply.php @@ -39,3 +39,35 @@ function T8API($data) curl_close($ch); } // T8API($data); + +function pending($user_id, $token) +{ + $api_url = 'localhost:3000/wms/frame/api_getdata'; + $data = [ + 'p' => 'pending', + 'token' => $token + ]; + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $api_url); // 设置请求的URL + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + // curl_setopt($ch, CURLOPT_HTTPHEADER, $header); + curl_setopt($ch, CURLOPT_POST, 1); // 使用 POST + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); + $response = curl_exec($ch); + if ($response === false) { + echo 'Curl error: ' . curl_error($ch); + } else { + $result = json_decode($response, true); + // 若 API 傳入失敗。 + if ($result['Status'] == 'Erroe') { + echo 'API傳入失敗,' . $result['ErrorMsg']; + return $result; + } else { + echo '
';
+            print_r($result);
+            echo '
'; + return $result; + } + } +} diff --git a/wms/contract/api/postContractData.php b/wms/contract/api/postContractData.php index 3b00d2a9..d9b9f8b8 100644 --- a/wms/contract/api/postContractData.php +++ b/wms/contract/api/postContractData.php @@ -524,29 +524,34 @@ function T8insert($data, $facilityno) // 分期代碼計算 $IncomeId = [ - 'A40006' => 1, - 'A40007' => 4, - 'A40003' => 12, - 'A40004' => 6, - 'A40005' => 2 + 'A40006' => 1, //年繳 + 'A40007' => 4, //季繳 + 'A40003' => 12, //月繳 + 'A40004' => 6, //雙月繳 + 'A40005' => 2 //半年繳 ]; //分幾期 => 總共保養月 / 分期月 $SQuantity = $elevator['maintain_months'] / $IncomeId[$payType]; // 依每台電梯去加入各個的付款項 - for ($i = 1; $i <= $IncomeId[$payType]; $i++) { + for ($i = 0; $i < $IncomeId[$payType]; $i++) { + // 計算分期款的收款月份 + $paymonth = $i * $SQuantity; + $payday = date('Y-m-d', strtotime("$date_1 + $paymonth months")); + $rows_data = [ "BillNo" => "$contractno", "IncomeId" => "$payType", "TaxId" => "ST005", - "RowCode" => $i, - "RowNo" => $i, + "RowCode" => $i + 1, + "RowNo" => $i + 1, "ItemType" => 1, "SPrice" => $elevator['sold_price'], "SQuantity" => $SQuantity, "ProjectId" => "$contractno", "FromSourceTag" => 0, - "CU_MaterialId" => "$facilityno[$index]" + "CU_MaterialId" => "$facilityno[$index]", + "CU_EstPayDate" => "$payday" ]; $salIncomeApplyDetail_rows[] = $rows_data; } diff --git a/wms/contract/api/testT8API.php b/wms/contract/api/testT8API.php index d9481e16..3718df5d 100644 --- a/wms/contract/api/testT8API.php +++ b/wms/contract/api/testT8API.php @@ -1,109 +1,14 @@ -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   
   
  
-
公式加載
-
-
-
-
    -
  • -

    -
  • -
  • -

    -
  • -
  • -

    -
  • -
-
-
-
  
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-      -
-
請選擇要上傳的文件
-
-
圖片上傳
-
-
-
-
- - - - - - - - - -
-
  
-
-
-
全選
刪除 -
-
添加行上移下移
-
批量導出批量導入
-
-
-
  
\ No newline at end of file +'; + print_r($date1); + echo ''; +} diff --git a/wms/css/function.js b/wms/css/function.js index 0f786e08..2f28f699 100644 --- a/wms/css/function.js +++ b/wms/css/function.js @@ -330,6 +330,7 @@ function login() { password: password }, success: function (data) { + // console.log(data); console.log('返回的结果'); res = eval("(" + data + ")"); console.log(res); @@ -340,17 +341,12 @@ function login() { var name = res.name; var login = res.login; var menu = res.menu; - - var queryString = window.location.search; - var params = new URLSearchParams(queryString); - var redirect = params.get('redirect'); - + //console.log(token); + //window.localStorage.setItem("token",token); + //window.localStorage.setItem("name",name); + //window.localStorage.setItem("login",login); window.localStorage.setItem("menu_" + res.uid, menu); - if (redirect == '' || redirect == 'null' || redirect == null) { - window.location.href = 'index.php?token=' + token; - } else { - window.location.href = decodeURIComponent(redirect) + '&token=' + token; - } + window.location.href = 'index.php?token=' + token; } else { window.location.href = 'login.php?errno=1'; } diff --git a/wms/frame/api_getdata.php b/wms/frame/api_getdata.php index c19b8758..cfcee966 100644 --- a/wms/frame/api_getdata.php +++ b/wms/frame/api_getdata.php @@ -22,7 +22,7 @@ */ $json = array("st" => "ok", "err" => "", "errCode" => ""); - +echo '123'; /** * 表單列表 */ @@ -220,3 +220,4 @@ try { } echo json_encode($json, JSON_UNESCAPED_UNICODE); +return json_encode($json, JSON_UNESCAPED_UNICODE); diff --git a/wms/mkt/pricereview-index.php b/wms/mkt/pricereview-index.php index 3b9a7557..0c00475f 100644 --- a/wms/mkt/pricereview-index.php +++ b/wms/mkt/pricereview-index.php @@ -2,7 +2,7 @@ include "../header.php"; // if($user_id == "M0107" || $user_id == "M0174" || $user_id == "M0225"){ - + // }else{ // echo "維護中.."; // exit; @@ -37,7 +37,7 @@ if (!empty($_GET['system_id']) && !empty($_GET['flow_id'])) { // echo '
';
     // print_r($sql_get);
     // echo '
'; - + // exit; $result = mysqli_query($link, $sql_get); if ($result == false) { die(mysqli_error($link)); @@ -93,6 +93,7 @@ if (!empty($res_get)) { $data = mysqli_query($link, $sql); $para = "function_name=pricereview&" . $token_link; + ?>