From 62ce64fad6351cee0718895b6417461a1782468d Mon Sep 17 00:00:00 2001 From: Cheng Date: Fri, 12 Jan 2024 17:39:04 +0800 Subject: [PATCH 1/2] 20240112 --- wms/contract/api/testT8API.php | 175 ++++++++++++++++++++------------- wms/mkt/pricereview-index.php | 8 +- 2 files changed, 113 insertions(+), 70 deletions(-) diff --git a/wms/contract/api/testT8API.php b/wms/contract/api/testT8API.php index 2a28efc2..d9481e16 100644 --- a/wms/contract/api/testT8API.php +++ b/wms/contract/api/testT8API.php @@ -1,66 +1,109 @@ - "OtherStockOutMtable", - "rows" => [ - [ - "BillNo" => "00850110", // 單據編號 varchar(20) - "BillDate" => 20210427, // 單據日期 int - "OrgId" => "1000", //組織 varchar(20) - "FOrgId" => "1000", //核算組織 varchar(20) - "TypeId" => "OS", //單據類型 varchar(10) - "BizPartnerId" => "", //往來對象(供應商) 可為空 - "PersonId" => "C0003", // 經辦人員 varchar(20) - "DeptId" => "250", // 經辦部門 varchar(20) - "CompId" => "1001" // 公司 varchar(20) - ] - ] - ], [ - "name" => "OtherStockOutDetail", - "rows" => [ - [ - "BillNo" => "00850110", //單據編號 varchar(20) - "RowCode" => 1, // 序號 int(10) - "MaterialId" => "MX00021003", // 產品代碼 -> 產品集成 varchar(40) - "SupplyOrgId" => "1000", // 供貨組織代碼 varchar(20) - "SQuantity" => 1, // 交易數量 numeric(19) - "WarehouseId" => "100" // 倉庫代碼 varchar(20) - ] - ] - ] -]; -$api_url = 'https://erp.masada.com.tw:780/twWebAPI/V1/STKOTHERSTOCKOUT/PostERPData'; -$header = [ - "CHI_Authorization :" . $validation -]; -$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); -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); - if ($result['Status'] == 'Error') { - echo '
';
-        print_r($result);
-        echo '
'; - echo 'API 傳入錯誤,' . $result['ErrorMsg']; - } else { - echo '
';
-        print_r($result['Status']);
-        echo '
'; - return $result; - } -} - -curl_close($ch); +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
   
   
  
+
公式加載
+
+
+
+
    +
  • +

    +
  • +
  • +

    +
  • +
  • +

    +
  • +
+
+
+
  
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+      +
+
請選擇要上傳的文件
+
+
圖片上傳
+
+
+
+
+ + + + + + + + + +
+
  
+
+
+
全選
刪除 +
+
添加行上移下移
+
批量導出批量導入
+
+
+
  
\ No newline at end of file diff --git a/wms/mkt/pricereview-index.php b/wms/mkt/pricereview-index.php index b5acebdc..b835bdc0 100644 --- a/wms/mkt/pricereview-index.php +++ b/wms/mkt/pricereview-index.php @@ -28,9 +28,9 @@ if (!empty($_GET['system_id']) && !empty($_GET['flow_id'])) { $where_system_id $where_flow_id "; - echo '
';
-    print_r($sql_get);
-    echo '
'; + // echo '
';
+    // print_r($sql_get);
+    // echo '
'; $result = mysqli_query($link, $sql_get); if ($result == false) { @@ -63,7 +63,7 @@ if (!empty($_GET['system_id']) && !empty($_GET['flow_id'])) { $data = array(); // sql語法存在變數中 $sql_cmd = sql_myself($user_id, "pricereview_main .creater"); -$sql = "select pricereview_main.*, contract_new_apply.status as applystatus, contract_new_apply.progress as applyprogress from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where pricereview_main.creater = '$user_id' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; +$sql = "SELECT pricereview_main.*, contract_new_apply.status AS applystatus, contract_new_apply.progress AS applyprogress FROM pricereview_main LEFT JOIN contract_new_apply ON pricereview_main.id = contract_new_apply.mid where pricereview_main.creater = '$user_id' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; // M0024許伃廷,M0107許紓晴,,M0175陳君敏,M0189權限全開 if ($user_id == "M0024" || $user_id == 'M0026' || $user_id == "M0107" || $user_id == "M0174" || $user_id == "M0175" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") { $sql_cmd = "where create_at >= '2023-01-01 00:00:00'"; From 5ca075f37b529ff3e58c472b903ec616fc016cb3 Mon Sep 17 00:00:00 2001 From: Cheng Date: Mon, 15 Jan 2024 16:30:57 +0800 Subject: [PATCH 2/2] option id debug --- wms/contract-repair/api/bpmAPI.php | 13 +++++++++ wms/crm/crmm02-index.php | 2 +- wms/mkt/assets/js/alpine.js | 2 +- wms/mkt/pricereview-create.php | 29 +++++++++++--------- wms/mkt/pricereview-record-submit.php | 8 +++--- wms/mkt/pricereview_repair-record-submit.php | 3 +- 6 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 wms/contract-repair/api/bpmAPI.php diff --git a/wms/contract-repair/api/bpmAPI.php b/wms/contract-repair/api/bpmAPI.php new file mode 100644 index 00000000..b6b686be --- /dev/null +++ b/wms/contract-repair/api/bpmAPI.php @@ -0,0 +1,13 @@ +prepare($sql); +$stmt->execute(); +$result = $stmt->fetch(PDO::FETCH_ASSOC); + +// echo '
';
+// print_r(json_encode($result));
+// echo '
'; + +return json_encode($result); diff --git a/wms/crm/crmm02-index.php b/wms/crm/crmm02-index.php index 92a073d4..1e18dcd3 100644 --- a/wms/crm/crmm02-index.php +++ b/wms/crm/crmm02-index.php @@ -170,7 +170,7 @@ if ($data) : - + 轉價審 diff --git a/wms/mkt/assets/js/alpine.js b/wms/mkt/assets/js/alpine.js index ec04fbd2..92bb356c 100644 --- a/wms/mkt/assets/js/alpine.js +++ b/wms/mkt/assets/js/alpine.js @@ -199,8 +199,8 @@ const pricereviewOptionSelect = () => { init() { this.optionCategory = 0 this.initButtons(); + console.log(this.options) }, - id: 1233, options: options, orioptions: options, optionalArr: { diff --git a/wms/mkt/pricereview-create.php b/wms/mkt/pricereview-create.php index 6ef6ed92..79fdffdd 100644 --- a/wms/mkt/pricereview-create.php +++ b/wms/mkt/pricereview-create.php @@ -749,16 +749,18 @@ $option_str .= ""; $('#table_index2_filter input').keyup(); // 恢復search前狀態 }); $('#tb2').on('focus', 'tr[name=option_templ] a[name=option_href]', function() { + $("#optionModal").modal('show'); var jobj = $(this); // 父視窗 $("#optionModal .modal-body td").unbind().click(function() { var pobj = $(this).closest('td').parent(); - console.log(jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html())); - console.log(pobj.find('td').eq(0).html() + pobj.find('td').eq(2).html() + ' ' + pobj.find('td').eq(1).html()); + // console.log(pobj.find('input[name=optionID]').val()); + // console.log(jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html())); + console.log(pobj.find('td').eq(0).html()); jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html() + '
(' + pobj.find('td').eq(2).html() + ')'); jobj.closest('td').parent().find('input[name=option_unit_price]').val(pobj.find('td').eq(5).html()); jobj.closest('td').parent().find('input[name=option_price_bp]').val(commafy(pobj.find('td').eq(5).html().replace(/[,]+/g, "") * jobj.closest('td').parent().find('input[name=option_qty]').val().replace(/[,]+/g, ""))); - jobj.closest('td').parent().find('input[name=op_id]').val(pobj.find('input[name=option_id]').val()); + jobj.closest('td').parent().find('input[name=op_id]').val(pobj.find('td').eq(0).html()); $("#optionModal").modal('hide'); }); @@ -1050,11 +1052,11 @@ $option_str .= ""; optionSeatArr.push($(this).html() + "@@"); }) $('#option_seat_all').val(optionSeatArr); - var optionID = []; - $("td[class='_optionid']").each(function() { - optionID.push($(this).val()); - }) - $('#optionid_all').val() + // var optionID = []; + // $("td[class='_optionid']").each(function() { + // optionID.push($(this).val()); + // }) + // $('#optionid_all').val() var optionUnitPriceArr = []; $("input[name='option_unit_price']").each(function() { optionUnitPriceArr.push($(this).val().replace(/[,]+/g, "")); @@ -1281,7 +1283,7 @@ $options = $stmt->fetchAll(PDO::FETCH_ASSOC);