From d6dd098b156f49f5967776c1cf9dafd33c35d02c Mon Sep 17 00:00:00 2001 From: Cheng Date: Mon, 15 Jan 2024 16:30:57 +0800 Subject: [PATCH] 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 | 30 +++++++++++--------- wms/mkt/pricereview-record-submit.php | 8 +++--- wms/mkt/pricereview_repair-record-submit.php | 3 +- 6 files changed, 37 insertions(+), 21 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 17e14a51..297445e7 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 cc392190..adbed315 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 c55abe3c..79fdffdd 100644 --- a/wms/mkt/pricereview-create.php +++ b/wms/mkt/pricereview-create.php @@ -749,17 +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(1111111111111); - 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'); }); @@ -1051,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, "")); @@ -1282,7 +1283,7 @@ $options = $stmt->fetchAll(PDO::FETCH_ASSOC);