diff --git a/wms/mkt/mkt/pricereview_renovate-check.php b/wms/mkt/mkt/pricereview_renovate-check.php index 616a55a9..577c7391 100644 --- a/wms/mkt/mkt/pricereview_renovate-check.php +++ b/wms/mkt/mkt/pricereview_renovate-check.php @@ -303,7 +303,7 @@ $(function () { var pa = ''; pa = ''+','; pa += $(this).closest('td').prev().find('input[name=item_no]').val(); - var plink = ''; + var plink = ''; $('.modal-footer').find('button').prop('disabled',false); //$('.navbar').hide(); $("#specModal .modal-body").html(plink); diff --git a/wms/mkt/pricereview-check.php b/wms/mkt/pricereview-check.php index 3edbced4..656060c7 100644 --- a/wms/mkt/pricereview-check.php +++ b/wms/mkt/pricereview-check.php @@ -206,6 +206,7 @@ foreach ($res as $data) { $mn_arr[$row['item_no']]['item_price_bp'] = $row['item_price_bp']; $mn_arr[$row['item_no']]['note'] = $row['note']; $mn_arr[$row['item_no']]['memo'] = $row['memo']; + $mn_arr[$row['item_no']]['option_relate_spec'] = $row['option_relate_spec']; } elseif ($row['item_group'] == "E") { $ex_arr[$row['item_no']]['item_spec'] = $row['item_spec']; $ex_arr[$row['item_no']]['item_unit_price'] = $row['item_unit_price']; @@ -284,6 +285,12 @@ function getMI(id) { Object.keys(data.content[k][14]).forEach(function(m){ mihtml += "
  • "+data.content[k][14][m][0]+":"+commafy(data.content[k][14][m][1])+"
  • "; }); + Object.keys(data.content[k][16]).forEach(function(m){ + mihtml += "
  • "+data.content[k][16][m][0]+":"+commafy(data.content[k][16][m][1])+"
  • "; + }); + Object.keys(data.content[k][18]).forEach(function(m){ + mihtml += "
  • "+data.content[k][18][m][0]+":"+commafy(data.content[k][18][m][1])+"
  • "; + }); mihtml += "以上合計:"+commafy(data.content[k][13])+"
    "; $("#tb1").find("tr[name=facil_templ2]").eq(k).find('td').eq(1).html(mihtml); //$("#tb1").find("input[name=mi_fix]").eq(k).closest('td').append(mihtml); @@ -295,7 +302,9 @@ function getMI(id) { } $(function () { + getMI(''); + $(":input").prop("disabled", true); $("#checker").prop("disabled", false); $("#status_n").prop("disabled", false); @@ -444,31 +453,41 @@ hr { $idx = 1; foreach ($item_arr as $item_no => $val) { $item_amt_A_all += $val["item_price_bp"]; - ?> + if ($viewmi) { + for ($i=0; $i<$val["item_qty"]; $i++) { + ?> [規調] "> - "> - "> - + + "> "> - "> + "> "> "> - - - + + + [規調] + "> + "> + "> + + @@ -495,7 +514,7 @@ hr { 數量 複價 備註 - 所屬電梯 + 所屬電梯項次 @@ -512,7 +531,7 @@ hr { "> "> "> - ", $val["option_relate_spec"]); ?> + - 保固延長 + 保固延長 項次 @@ -588,6 +607,7 @@ hr { 數量(月) 複價 備註 + 所屬電梯項次 @@ -608,7 +628,8 @@ hr { "> "> "> - "> + "> + 小計 - + + diff --git a/wms/mkt/pricereview-create.php b/wms/mkt/pricereview-create.php index b2282c67..6ac012df 100644 --- a/wms/mkt/pricereview-create.php +++ b/wms/mkt/pricereview-create.php @@ -403,7 +403,7 @@ function selFacil(o) { fp.find('input[name=item_spec]').val(data.model); fp.find('input[name=item_weight]').val(data.weight); fp.find('input[name=item_group]').val(data.group); - fp.find('input[name=item_price]').val(data.iamt.substr(1)*fp.find('input[name=item_qty]').val()); + //fp.find('input[name=item_price]').val(data.iamt.substr(1)*fp.find('input[name=item_qty]').val()); //fp.find('input[name=gross_profit]').val(($('#price_total').val().replace(/[,]+/g,"")-data.iamt.substr(1))*fp.find('input[name=item_qty]').val()); fp.find('input[name=gross_profit]').val(fp.find('input[name=item_price]').val()); dataFormat(); @@ -566,7 +566,7 @@ $(function(){ $(this).val($(this).val().replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",")); dataFormat(); }); - $('#tb1').on('keyup', 'input[name=fp_numberofstop], input[name=item_qty], input[name=item_price]', function(){ + $('#tb1').on('keyup', 'input[name=fp_numberofstop], input[name=item_qty], input[name=item_price], input[name=item_price_ct]', function(){ //$("input[name='item_price']").keyup(function(){ $(this).val($(this).val().replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",")); //}); @@ -636,6 +636,7 @@ $(function(){ }); $('#btnadd4').click(function(){ $('#tb4 tr:last').prev().after($("tr[name='maintain_templ']").last().clone().find('input,select').val('').end()); + $('#tb4 tr:last').prev().find('td[name=mn_relate_facil]').html(''); //$('#tb4 tr:last').prev().find('td').first().html($("tr[name='maintain_templ']").length); //$('#tb4 tr:last').prev().find('td').eq(1).find('a').attr('id', $("tr[name='maintain_templ']").length); }); @@ -699,15 +700,17 @@ $(function(){ $('#tb2').on('click', 'a[name=btnfaci]', function(){ var jobj = $(this); // 父視窗 if (jobj.closest('td').parent().find('a[name=option_href]').html() != '點選') { + var k=1; $("input[name=item_spec]").each(function(){ if ($(this).val() == '') return; var objInput = document.createElement("input"); objInput.setAttribute("type", "checkbox"); objInput.setAttribute("name", "sub_faci"); - objInput.setAttribute("value", $(this).val()); + objInput.setAttribute("value", k+'.'+$(this).val()); $("#optionFaciModal .modal-body").append(objInput); - $("#optionFaciModal .modal-body").append($(this).val()); + $("#optionFaciModal .modal-body").append(k+'.'+$(this).val()); $("#optionFaciModal .modal-body").append("
    "); + k++; }); $("#optionFaciModal .modal-body").append("

    "); $("#optionFaciModal").modal('show'); @@ -721,7 +724,40 @@ $(function(){ jobj.closest('td').parent().find('td[name=option_relate_facil]').html(str); }); } else { - alert("請先新增OPTION。"); + alert("請先新增OPTION"); + return false; + } + }); + $('#tb4').on('click', 'a[name=btnfaci]', function(){ + var jobj = $(this); // 父視窗 + if (jobj.closest('td').parent().find('select[name=mn_kind]').val() != '') { + var k=1; + $("input[name=item_spec]").each(function(){ + if ($(this).val() == '') return; + var objInput = document.createElement("input"); + objInput.setAttribute("type", "checkbox"); + objInput.setAttribute("name", "sub_faci"); + //objInput.setAttribute("value", $(this).val()+"#"+$(this).closest('td').parent().find('input[name=item_qty]').val()); + objInput.setAttribute("value", k+'.'+$(this).val()); + $("#optionFaciModal .modal-body").append(objInput); + $("#optionFaciModal .modal-body").append(k+'.'+$(this).val()); + $("#optionFaciModal .modal-body").append("
    "); + k++; + }); + $("#optionFaciModal .modal-body").append("

    "); + $("#optionFaciModal").modal('show'); + var str = ""; + $("button[name=btnpost]").click(function(){ + $('input[name=sub_faci]').each(function(){ + if ($(this).prop('checked')) { + str += $(this).val()+"
    "; + } + }); + jobj.closest('td').parent().find('td[name=mn_relate_facil]').html(str); + }); + } else { + alert("請先在左測下拉欲保固延長的電梯"); + jobj.closest('td').parent().find('select[name=mn_kind]').eq(0).focus(); return false; } }); @@ -899,6 +935,9 @@ $(function(){ var mnMemoArr = []; $("input[name='mn_memo']").each(function(){ mnMemoArr.push($(this).val()+"@@"); }) $('#mn_memo_all').val(mnMemoArr); + var mnRelateFacilArr = []; + $("td[name='mn_relate_facil']").each(function(){ mnRelateFacilArr.push($(this).html()); }) + $('#mn_relate_facil_all').val(mnRelateFacilArr); var exNoteArr = []; $("input[name='except_note']").each(function(){ exNoteArr.push($(this).val()); }) $('#except_note_all').val(exNoteArr); @@ -919,13 +958,25 @@ $(function(){ var rv = true; $("td[name='option_relate_facil']").each(function(){ if ($(this).html() == "") { - alert("【所屬電梯】資料空白!\n請至OPTION加價區塊點選紅色按鈕「電梯」並勾選項目。"); - location.href = '#btnadd2'; - return rv = false; + if (!confirm("【所屬電梯】資料空白!\n確認要送出?")) { + //alert("【所屬電梯】資料空白!\n請至OPTION加價區塊點選紅色按鈕「電梯」並勾選項目。"); + location.href = '#btnadd2'; + return rv = false; + } } }); if ((rv === false)) return rv; + var rv2 = true; + $("td[name='mn_relate_facil']").each(function(){ + if ($(this).closest('td').parent().find('select[name=mn_kind').val() != '' && $(this).html() == "") { + alert("【所屬電梯】資料空白!\n請至 保固延長區 點選紅色按鈕「電梯」並勾選項目。"); + location.href = '#btnadd4'; + return rv2 = false; + } + }); + if ((rv2 === false)) return rv2; + if ($("#pay_all_amount").val() != $("#price_total").val()) { alert("【付款辦法】金額合計有誤!"); $("input[name=pay_scale]").eq(0).trigger( "focus" ); @@ -1040,7 +1091,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ - + @@ -1049,10 +1100,11 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ - + + - + - - + + + + + + + + @@ -480,7 +501,7 @@ hr { - + @@ -497,7 +518,7 @@ hr { - + - + @@ -573,6 +594,7 @@ hr { + @@ -593,7 +615,8 @@ hr { - + + - + +
    整機單價整機單價
    停數 速度 開門方式規格規格 單價 數量 複價售價 "> ">
    [規調]">">">
    數量 複價 備註所屬電梯所屬電梯項次
    "> "> ">", $val["option_relate_spec"]); ?>
    保固延長保固延長
    項次數量(月) 複價 備註所屬電梯項次
    "> "> ">">">
    小計
    diff --git a/wms/mkt/pricereview_renovate-create.php b/wms/mkt/pricereview_renovate-create.php index 9b8d8f4a..0cd40fde 100644 --- a/wms/mkt/pricereview_renovate-create.php +++ b/wms/mkt/pricereview_renovate-create.php @@ -410,7 +410,7 @@ function selFacil(o) { fp.find('input[name=item_spec]').val(data.model); fp.find('input[name=item_weight]').val(data.weight); fp.find('input[name=item_group]').val(data.group); - fp.find('input[name=item_price]').val(data.iamt.substr(1)*fp.find('input[name=item_qty]').val()); + //fp.find('input[name=item_price]').val(data.iamt.substr(1)*fp.find('input[name=item_qty]').val()); //fp.find('input[name=gross_profit]').val(($('#price_total').val().replace(/[,]+/g,"")-data.iamt.substr(1))*fp.find('input[name=item_qty]').val()); fp.find('input[name=gross_profit]').val(fp.find('input[name=item_price]').val()); dataFormat(); @@ -603,7 +603,7 @@ $(function(){ $(this).val($(this).val().replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",")); dataFormat(); }); - $('#tb1').on('keyup', 'input[name=fp_numberofstop], input[name=item_qty], input[name=item_price]', function(){ + $('#tb1').on('keyup', 'input[name=fp_numberofstop], input[name=item_qty], input[name=item_price], input[name=item_price_ct]', function(){ //$("input[name='item_price']").keyup(function(){ $(this).val($(this).val().replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",")); //}); @@ -673,6 +673,7 @@ $(function(){ }); $('#btnadd4').click(function(){ $('#tb4 tr:last').prev().after($("tr[name='maintain_templ']").last().clone().find('input,select').val('').end()); + $('#tb4 tr:last').prev().find('td[name=mn_relate_facil]').html(''); //$('#tb4 tr:last').prev().find('td').first().html($("tr[name='maintain_templ']").length); //$('#tb4 tr:last').prev().find('td').eq(1).find('a').attr('id', $("tr[name='maintain_templ']").length); }); @@ -741,15 +742,17 @@ $(function(){ $('#tb2').on('click', 'a[name=btnfaci]', function(){ var jobj = $(this); // 父視窗 if (jobj.closest('td').parent().find('a[name=option_href]').html() != '點選') { + var k=1; $("input[name=item_spec]").each(function(){ if ($(this).val() == '') return; var objInput = document.createElement("input"); objInput.setAttribute("type", "checkbox"); objInput.setAttribute("name", "sub_faci"); - objInput.setAttribute("value", $(this).val()); + objInput.setAttribute("value", k+'.'+$(this).val()); $("#optionFaciModal .modal-body").append(objInput); - $("#optionFaciModal .modal-body").append($(this).val()); + $("#optionFaciModal .modal-body").append(k+'.'+$(this).val()); $("#optionFaciModal .modal-body").append("
    "); + k++; }); $("#optionFaciModal .modal-body").append("

    "); $("#optionFaciModal").modal('show'); @@ -763,11 +766,44 @@ $(function(){ jobj.closest('td').parent().find('td[name=option_relate_facil]').html(str); }); } else { - alert("請先新增OPTION。"); + alert("請先新增OPTION"); return false; } - $("input[name=pay_scale]").keyup(function(){ }); + $('#tb4').on('click', 'a[name=btnfaci]', function(){ + var jobj = $(this); // 父視窗 + if (jobj.closest('td').parent().find('select[name=mn_kind]').val() != '') { + var k=1; + $("input[name=item_spec]").each(function(){ + if ($(this).val() == '') return; + var objInput = document.createElement("input"); + objInput.setAttribute("type", "checkbox"); + objInput.setAttribute("name", "sub_faci"); + //objInput.setAttribute("value", $(this).val()+"#"+$(this).closest('td').parent().find('input[name=item_qty]').val()); + objInput.setAttribute("value", k+'.'+$(this).val()); + $("#optionFaciModal .modal-body").append(objInput); + $("#optionFaciModal .modal-body").append(k+'.'+$(this).val()); + $("#optionFaciModal .modal-body").append("
    "); + k++; + }); + $("#optionFaciModal .modal-body").append("

    "); + $("#optionFaciModal").modal('show'); + var str = ""; + $("button[name=btnpost]").click(function(){ + $('input[name=sub_faci]').each(function(){ + if ($(this).prop('checked')) { + str += $(this).val()+"
    "; + } + }); + jobj.closest('td').parent().find('td[name=mn_relate_facil]').html(str); + }); + } else { + alert("請先在左測下拉欲保固延長的電梯"); + jobj.closest('td').parent().find('select[name=mn_kind]').eq(0).focus(); + return false; + } + }); + $("input[name=pay_scale]").keyup(function(){ $(this).closest('td').next('td').find('input[name=pay_amount]').val(commafy(($("#price_total").val().replace(/[,]+/g,"")/100*$(this).val()).toFixed(0))); var payAllScale = 0; var payAllAmt = 0; @@ -970,6 +1006,9 @@ $(function(){ var mnMemoArr = []; $("input[name='mn_memo']").each(function(){ mnMemoArr.push($(this).val()+"@@"); }) $('#mn_memo_all').val(mnMemoArr); + var mnRelateFacilArr = []; + $("td[name='mn_relate_facil']").each(function(){ mnRelateFacilArr.push($(this).html()); }) + $('#mn_relate_facil_all').val(mnRelateFacilArr); var exNoteArr = []; $("input[name='except_note']").each(function(){ exNoteArr.push($(this).val()); }) $('#except_note_all').val(exNoteArr); @@ -1008,13 +1047,25 @@ $(function(){ var rv = true; $("td[name='option_relate_facil']").each(function(){ if ($(this).html() == "") { - alert("【所屬電梯】資料空白!\n請至OPTION加價區塊點選紅色按鈕「電梯」並勾選項目。"); - location.href = '#btnadd2'; - return rv = false; + if (!confirm("【所屬電梯】資料空白!\n確認要送出?")) { + //alert("【所屬電梯】資料空白!\n請至OPTION加價區塊點選紅色按鈕「電梯」並勾選項目。"); + location.href = '#btnadd2'; + return rv = false; + } } }); if ((rv === false)) return rv; + var rv2 = true; + $("td[name='mn_relate_facil']").each(function(){ + if ($(this).closest('td').parent().find('select[name=mn_kind').val() != '' && $(this).html() == "") { + alert("【所屬電梯】資料空白!\n請至 保固延長區 點選紅色按鈕「電梯」並勾選項目。"); + location.href = '#btnadd4'; + return rv2 = false; + } + }); + if ((rv2 === false)) return rv2; + if ($("#pay_all_amount").val() != $("#price_total").val()) { alert("【付款辦法】金額合計有誤!"); $("input[name=pay_scale]").eq(0).trigger( "focus" ); @@ -1128,7 +1179,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ - + @@ -1137,10 +1188,11 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ - + +
    - - + +

    基本規格

    - @@ -284,7 +279,7 @@ C:當天第3版,依次類推……" readonly>
    - @@ -311,7 +306,7 @@ C:當天第3版,依次類推……" readonly>
    - @@ -2005,7 +2000,7 @@ C:當天第3版,依次類推……" readonly>
    - + \ No newline at end of file diff --git a/wms/mkt/specsurvey-edit.php b/wms/mkt/specsurvey-edit.php index 8174fa5d..7772cd38 100644 --- a/wms/mkt/specsurvey-edit.php +++ b/wms/mkt/specsurvey-edit.php @@ -1,11 +1,12 @@ num_rows) { //echo '"; echo "alert('新增失敗,請重新操作[F]');"; - echo "location.href = 'specsurvey-index.php?function_name=specsurvey&".$token_link."';"; + echo "history.go(-1);"; + //echo "location.href = 'specsurvey-index.php?function_name=specsurvey&".$token_link."';"; echo ""; } } else { echo ""; } } else { echo ""; } } else { echo ""; } diff --git a/wms/mkt/specsurvey-view.php b/wms/mkt/specsurvey-view.php index 18be15ba..264fa219 100644 --- a/wms/mkt/specsurvey-view.php +++ b/wms/mkt/specsurvey-view.php @@ -25,7 +25,40 @@ if (0 == $res->num_rows) { //echo ''; exit; } - +?> + + + - -
    @@ -161,11 +162,11 @@ C:當天第3版,依次類推……">
    - +
    - +

    基本規格

    @@ -1865,6 +1866,7 @@ C:當天第3版,依次類推……">
    +
    ,'+pArr[6]); + formdata.append('pa', ','+pArr[6]+','+pArr[7]); var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(){ if(this.readyState == 4 && this.status == 200){ @@ -78,7 +87,7 @@ $(function () { return false; } if (data.pver) { - location.href = 'specsurvey_renovate-edit.php?pa=,'+pArr[0]+','+data.pver+','+data.ver+'&function=specsurvey_renovate&' + location.href = 'specsurvey_renovate-edit.php?pa=,'+pArr[0]+','+pArr[7]+','+data.pver+','+data.ver+'&function=specsurvey_renovate&' } else { $('#version').val(data.ver); $('#rtype').val(pArr[1]); @@ -86,14 +95,8 @@ $(function () { $('#numberofstop').val(pArr[3]); $('#numberofdoor').val(pArr[3]); $('#speed').val(pArr[4]); - - var optStr = ''; - for (var os=1; os<36; os++) { - optStr += ''; - } - for (var m=0; m<(pArr[5]-1); m++) { - $("#address").parent().after('
    '); - } + $('#serial_no').val(pArr[7]); + $('#sub_item_id').val(pArr[7]); //$('#tai_count').val(pArr[5]); } } @@ -146,12 +149,6 @@ $(function () { $('#door_r_floor').prop('readonly', false); } }); - - $('#submit').click(function(){ - var serialArr = []; - $("select[name='serial']").each(function(){ serialArr.push($(this).val()); }) - $('#serial_all').val(serialArr); - }); });
    - + +
    +
    + +
    - - + 重選號機

    基本規格

    - @@ -188,7 +196,7 @@ C:當天第3版,依次類推……" readonly>
    - @@ -214,7 +222,7 @@ C:當天第3版,依次類推……" readonly>
    - @@ -1880,7 +1888,7 @@ C:當天第3版,依次類推……" readonly>
    - + "; echo "alert('新增失敗,請重新操作[F]');"; - echo "location.href = 'specsurvey_renovate-index.php?function_name=specsurvey_renovate&".$token_link."';"; + echo "history.go(-1);"; + //echo "location.href = 'specsurvey_renovate-index.php?function_name=specsurvey_renovate&".$token_link."';"; echo ""; } } else { echo ""; } } else { echo ""; } } else { echo ""; } diff --git a/wms/mkt/specsurvey_renovate-view.php b/wms/mkt/specsurvey_renovate-view.php index c208d6cc..b747ab72 100644 --- a/wms/mkt/specsurvey_renovate-view.php +++ b/wms/mkt/specsurvey_renovate-view.php @@ -161,11 +161,11 @@ C:當天第3版,依次類推……">
    - +
    - +

    基本規格

    diff --git a/wms/mkt/specsurvey_version-api.php b/wms/mkt/specsurvey_version-api.php index 81cda419..0b7ce453 100644 --- a/wms/mkt/specsurvey_version-api.php +++ b/wms/mkt/specsurvey_version-api.php @@ -9,7 +9,7 @@ * { * "pa" * } - * pa : 價審單序號,電梯項次 + * pa : 價審單序號,電梯項次,子項目編號 * respons json * { * "st" : "ok", @@ -28,12 +28,12 @@ try { $$k = htmlspecialchars(stripslashes(trim($v))); } - list($mid, $pr_item_id) = explode(",", $pa); + list($mid, $pr_item_id, $sub_item_id) = explode(",", $pa); if (!$mid || !$pr_item_id) throw new \Exception("parameter empty[2]"); $prev_version = $version = ""; $tds = date("Y-m-d"); - $sql = "select max(version)from specsurvey_main where mid = '$mid' and pr_item_id = '$pr_item_id'";// and version like '".$version."%'"; + $sql = "select max(version)from specsurvey_main where mid = '$mid' and pr_item_id = '$pr_item_id' and sub_item_id = '$sub_item_id'";// and version like '".$version."%'"; $res = mysqli_query($link, $sql); $row = mysqli_fetch_row($res); if ($row[0]) {
    整機單價整機單價
    停數 速度 開門方式規格規格 單價 數量 複價售價