From 83623b559f4fb4491fc20eeb1a805cd9b908a2b7 Mon Sep 17 00:00:00 2001 From: jrbin Date: Mon, 13 Nov 2023 16:05:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A6=8F=E8=AA=BF=E6=9F=A5=E8=A9=A2bug=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/mkt/pricereview-check.php | 16 ++++++++++++---- wms/mkt/pricereview_renovate-check.php | 16 ++++++++++++---- wms/mkt/specsurvey-index.php | 5 +++-- wms/mkt/specsurvey-view.php | 11 +++++++---- wms/mkt/specsurvey_renovate-index.php | 5 +++-- wms/mkt/specsurvey_renovate-view.php | 11 +++++++---- 6 files changed, 44 insertions(+), 20 deletions(-) diff --git a/wms/mkt/pricereview-check.php b/wms/mkt/pricereview-check.php index e9b4758b..8c7f4d6a 100644 --- a/wms/mkt/pricereview-check.php +++ b/wms/mkt/pricereview-check.php @@ -192,6 +192,12 @@ foreach ($res as $data) { $item_arr[$row['item_no']]['note'] = $row['note']; $item_arr[$row['item_no']]['mi_fix'] = $row['mi_fix']; $data["qty_total"] += $row["item_qty"]; + $sql_spec = "select sub_item_id from specsurvey_main where mid = '$mid' and pr_item_id = '".$row['item_no']."' order by sub_item_id"; + $res_spec = mysqli_query($link, $sql_spec); + while ($row_spec = mysqli_fetch_row($res_spec)) { + $item_arr[$row['item_no']]['sub_item_id'][] = $row_spec[0]; + } + mysqli_free_result($res_spec); } elseif ($row['item_group'] == "B") { $option_arr[$row['item_no']]['item_spec'] = $row['item_spec']; $option_arr[$row['item_no']]['item_unit_price'] = $row['item_unit_price']; @@ -324,10 +330,12 @@ $(function () { $('#tb1').on('focus', 'tr[name=facil_templ] a', function(){ $(this).unbind().click(function(){ - // 價審單序號,電梯項次 + // 價審單序號,電梯項次,子項次 var pa = ''; pa = ''+','; - pa += $(this).closest('td').prev().find('input[name=item_no]').val(); + pa += $(this).closest('td').prev().find('input[name=item_no]').val()+','; + pa += ','; + pa += $(this).closest('td').prev().find('input[name=sub_item_id]').val(); var plink = ''; $('.modal-footer').find('button').prop('disabled',false); //$('.navbar').hide(); @@ -457,7 +465,7 @@ hr { for ($i=0; $i<$val["item_qty"]; $i++) { ?> - + "> [規調] "> @@ -480,7 +488,7 @@ hr { } else { ?> - + "> [規調] "> "> diff --git a/wms/mkt/pricereview_renovate-check.php b/wms/mkt/pricereview_renovate-check.php index 96731be2..c28dac8b 100644 --- a/wms/mkt/pricereview_renovate-check.php +++ b/wms/mkt/pricereview_renovate-check.php @@ -192,6 +192,12 @@ foreach ($res as $data) { $item_arr[$row['item_no']]['note'] = $row['note']; $item_arr[$row['item_no']]['mi_fix'] = $row['mi_fix']; $data["qty_total"] += $row["item_qty"]; + $sql_spec = "select sub_item_id from specsurvey_main where mid = '$mid' and pr_item_id = '".$row['item_no']."' order by sub_item_id"; + $res_spec = mysqli_query($link, $sql_spec); + while ($row_spec = mysqli_fetch_row($res_spec)) { + $item_arr[$row['item_no']]['sub_item_id'][] = $row_spec[0]; + } + mysqli_free_result($res_spec); } elseif ($row['item_group'] == "B") { $option_arr[$row['item_no']]['item_spec'] = $row['item_spec']; $option_arr[$row['item_no']]['item_unit_price'] = $row['item_unit_price']; @@ -326,10 +332,12 @@ $(function () { $('#tb1').on('focus', 'tr[name=facil_templ] a', function(){ $(this).unbind().click(function(){ - // 價審單序號,電梯項次 + // 價審單序號,電梯項次,子項次 var pa = ''; pa = ''+','; - pa += $(this).closest('td').prev().find('input[name=item_no]').val(); + pa += $(this).closest('td').prev().find('input[name=item_no]').val()+','; + pa += ','; + pa += $(this).closest('td').prev().find('input[name=sub_item_id]').val(); var plink = ''; $('.modal-footer').find('button').prop('disabled',false); //$('.navbar').hide(); @@ -459,7 +467,7 @@ hr { for ($i=0; $i<$val["item_qty"]; $i++) { ?> - + "> [規調] "> @@ -482,7 +490,7 @@ hr { } else { ?> - + "> [規調] "> "> diff --git a/wms/mkt/specsurvey-index.php b/wms/mkt/specsurvey-index.php index d99e607d..2a806f21 100644 --- a/wms/mkt/specsurvey-index.php +++ b/wms/mkt/specsurvey-index.php @@ -7,7 +7,8 @@ $data = array(); $sql_cmd = sql_myself($user_id, "s.creater"); if ($user_id == "M0060") $sql_cmd = ""; $sql2 = (empty($sql_cmd)) ? "where" : "and"; -$sql2 .= " s.mid = p.id and p.ekind = '新梯'"; +$sql2 .= " s.mid = p.id and p.ekind = '新梯' "; +$sql2 .= "and (s.mid, s.pr_item_id, s.sub_item_id, s.version) in (select s.mid, s.pr_item_id, s.sub_item_id, max(s.version) from specsurvey_main s, pricereview_main p where s.mid = p.id group by s.mid, s.pr_item_id, s.sub_item_id)"; $sql = "select s.* from specsurvey_main s, pricereview_main p $sql_cmd $sql2 order by s.id"; // 用mysqli_query方法執行(sql語法)將結果存在變數中 $data = mysqli_query($link, $sql); @@ -125,7 +126,7 @@ $(function () { - &function=specsurvey&" class="btn btn-warning btn-sm">檢視 + &function=specsurvey&" class="btn btn-warning btn-sm">檢視