Browse Source

除外費用

main
Cheng 1 year ago
parent
commit
a2df7a4f61
  1. 2
      wms/fun_global.php
  2. 37
      wms/mkt/pricereview-create.php
  3. 6
      wms/mkt/pricereview-index.php
  4. 7
      wms/mkt/pricereview-record-submit.php

2
wms/fun_global.php

@ -223,7 +223,7 @@ function accountid2name()
global $link; global $link;
$arr = []; $arr = [];
$sql = "select accountid, name from account where accounttype in ('B','E','M')"; $sql = "select accountid, name from account where 1=1";
$res = mysqli_query($link, $sql); $res = mysqli_query($link, $sql);
while ($row = mysqli_fetch_row($res)) { while ($row = mysqli_fetch_row($res)) {
$arr[$row[0]] = $row[1]; $arr[$row[0]] = $row[1];

37
wms/mkt/pricereview-create.php

@ -820,7 +820,7 @@ $option_str .= "</tbody></table>";
str += $(this).val() + "<br>"; str += $(this).val() + "<br>";
} }
}); });
jobj.closest('td').parent().find('td[name=option_relate_facil]').html(str); jobj.closest('td').parent().find('td[name=Exclusions]').html(str);
}); });
} else { } else {
alert("請先新增OPTION"); alert("請先新增OPTION");
@ -1065,6 +1065,9 @@ $option_str .= "</tbody></table>";
}) })
$('#option_relate_facil_all').val(optionRelateFacilArr); $('#option_relate_facil_all').val(optionRelateFacilArr);
var mnIdArr = []; var mnIdArr = [];
$("input[name='mn_id']").each(function() { $("input[name='mn_id']").each(function() {
mnIdArr.push($(this).val()); mnIdArr.push($(this).val());
}) })
@ -1115,11 +1118,21 @@ $option_str .= "</tbody></table>";
}) })
$('#mn_relate_facil_all').val(mnRelateFacilArr); $('#mn_relate_facil_all').val(mnRelateFacilArr);
var exNoteArr = []; var exNoteArr = [];
$("input[name='except_note']").each(function() { $("input[name='except_note']").each(function() {
exNoteArr.push($(this).val()); exNoteArr.push($(this).val());
}) })
$('#except_note_all').val(exNoteArr); $('#except_note_all').val(exNoteArr);
var exSpecArr = []; var exSpecArr = [];
$("td[name='Exclusions']").each(function() {
exNoteArr.push($(this).html());
})
$('#Exclusions_all').val(exNoteArr);
var exSpecArr = [];
$("input[name='except_spec']").each(function() { $("input[name='except_spec']").each(function() {
exSpecArr.push($(this).val()); exSpecArr.push($(this).val());
}) })
@ -1978,6 +1991,16 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
<th>單價</th> <th>單價</th>
<th>數量</th> <th>數量</th>
<th>複價</th> <th>複價</th>
<th class="star">
<div data-toggle="tooltip" data-placement="auto" title="每次選完【除外項目】後,請點選右方紅色按鈕「電梯」來勾選電梯項次">所屬電梯
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
<path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" />
</svg>
</div>
</th>
<th>功能</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -1990,12 +2013,13 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
<td><input type="text" name="except_spec" class="form-control" size="width:30em;" value="<?php echo $v["item_spec"]; ?>" readonly></td> <td><input type="text" name="except_spec" class="form-control" size="width:30em;" value="<?php echo $v["item_spec"]; ?>" readonly></td>
<td><input type="text" name="except_unit_price" class="form-control dollar-right" size="8" value="<?php echo number_format($v["item_unit_price"]); ?>" readonly></td> <td><input type="text" name="except_unit_price" class="form-control dollar-right" size="8" value="<?php echo number_format($v["item_unit_price"]); ?>" readonly></td>
<td><input type="text" name="except_qty" class="form-control" size="4" maxlength="4" value="<?php echo $v["item_qty"]; ?>"><input type="hidden" name="except_qty_ori" value="<?php echo $v["item_qty"]; ?>"></td> <td><input type="text" name="except_qty" class="form-control" size="4" maxlength="4" value="<?php echo $v["item_qty"]; ?>"><input type="hidden" name="except_qty_ori" value="<?php echo $v["item_qty"]; ?>"></td>
<td><input type="text" name="except_price_bp" class="form-control dollar-right" size="8" value="<?php echo number_format($v["item_price_bp"]); ?>" readonly> <td><input type="text" name="except_price_bp" class="form-control dollar-right" size="8" value="<?php echo number_format($v["item_price_bp"]); ?>" readonly></td>
<td name="Exclusions"></td>
<td name="mn_relate_facil" nowrap>
<input type="hidden" name="item_group" value="E"> <input type="hidden" name="item_group" value="E">
<a href="javascript:void(0);" name="btnfaci" class="btn btn-danger btn-sm">電梯</a> <a href="javascript:void(0);" name="btnfaci" class="btn btn-danger btn-sm">電梯</a>
<a href="javascript:void(0);" name="btndel3" class="btn btn-danger btn-sm">X</a> <a href="javascript:void(0);" name="btndel3" class="btn btn-danger btn-sm">X</a>
</td> </td>
<td name="mn_relate_facil" nowrap></td>
</tr> </tr>
<?php <?php
} }
@ -2007,10 +2031,14 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
<td><input type="text" name="except_unit_price" class="form-control dollar-right" size="8"></td> <td><input type="text" name="except_unit_price" class="form-control dollar-right" size="8"></td>
<td><input type="text" name="except_qty" class="form-control" size="4" maxlength="4"></td> <td><input type="text" name="except_qty" class="form-control" size="4" maxlength="4"></td>
<td><input type="text" name="except_price_bp" class="form-control dollar-right" size="8" readonly> <td><input type="text" name="except_price_bp" class="form-control dollar-right" size="8" readonly>
<!-- <a href="javascript:void(0);" name="btnfaci" class="btn btn-danger btn-sm">電梯</a>
<a href="javascript:void(0);" name="btndel3" class="btn btn-danger btn-sm">X</a> -->
</td>
<td name="Exclusions"></td>
<td name="mn_relate_facil" nowrap>
<a href="javascript:void(0);" name="btnfaci" class="btn btn-danger btn-sm">電梯</a> <a href="javascript:void(0);" name="btnfaci" class="btn btn-danger btn-sm">電梯</a>
<a href="javascript:void(0);" name="btndel3" class="btn btn-danger btn-sm">X</a> <a href="javascript:void(0);" name="btndel3" class="btn btn-danger btn-sm">X</a>
</td> </td>
<td name="mn_relate_facil" nowrap></td>
</tr> </tr>
<?php <?php
} }
@ -2446,6 +2474,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
<input type="hidden" name="option_price_bp_all" id="option_price_bp_all"> <input type="hidden" name="option_price_bp_all" id="option_price_bp_all">
<input type="hidden" name="option_memo_all" id="option_memo_all"> <input type="hidden" name="option_memo_all" id="option_memo_all">
<input type="hidden" name="option_relate_facil_all" id="option_relate_facil_all"> <input type="hidden" name="option_relate_facil_all" id="option_relate_facil_all">
<input type="hidden" name="Exclusions_all" id="Exclusions_all">
<input type="hidden" name="mn_id_all" id="mn_id_all"> <input type="hidden" name="mn_id_all" id="mn_id_all">
<input type="hidden" name="mn_kind_all" id="mn_kind_all"> <input type="hidden" name="mn_kind_all" id="mn_kind_all">
<input type="hidden" name="mn_seat_all" id="mn_seat_all"> <input type="hidden" name="mn_seat_all" id="mn_seat_all">

6
wms/mkt/pricereview-index.php

@ -28,9 +28,9 @@ if (!empty($_GET['system_id']) && !empty($_GET['flow_id'])) {
$where_system_id $where_system_id
$where_flow_id $where_flow_id
"; ";
// echo '<pre>'; echo '<pre>';
// print_r($sql_get); print_r($sql_get);
// echo '</pre>'; echo '</pre>';
$result = mysqli_query($link, $sql_get); $result = mysqli_query($link, $sql_get);
if ($result == false) { if ($result == false) {

7
wms/mkt/pricereview-record-submit.php

@ -253,6 +253,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$except_unit_price_arr = explode(",", $except_unit_price_all); $except_unit_price_arr = explode(",", $except_unit_price_all);
$except_qty_arr = explode(",", $except_qty_all); $except_qty_arr = explode(",", $except_qty_all);
$except_price_bp_arr = explode(",", $except_price_bp_all); $except_price_bp_arr = explode(",", $except_price_bp_all);
// 除外費用對應電梯
$except_relate_facil_arr = explode(",", htmlspecialchars_decode($Exclusions_all));
$item_no = 1; $item_no = 1;
for ($i = 0; $i < count($except_spec_arr); $i++) { for ($i = 0; $i < count($except_spec_arr); $i++) {
$spec = trim($except_spec_arr[$i]); $spec = trim($except_spec_arr[$i]);
@ -260,8 +262,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$except_unit_price_arr[$i] = str_replace(",", "", $except_unit_price_arr[$i]); $except_unit_price_arr[$i] = str_replace(",", "", $except_unit_price_arr[$i]);
$except_qty_arr[$i] = str_replace(",", "", $except_qty_arr[$i]); $except_qty_arr[$i] = str_replace(",", "", $except_qty_arr[$i]);
$except_price_bp_arr[$i] = str_replace(",", "", $except_price_bp_arr[$i]); $except_price_bp_arr[$i] = str_replace(",", "", $except_price_bp_arr[$i]);
$db_query = "insert into pricereview_item (mid, item_no, item_group, item_spec, item_unit_price, item_qty, item_price_bp, note) values ("; $tmp_arr = explode("<br>", $except_price_bp_arr[$i]);
$db_query .= "'$mid', '$item_no', 'E', '$spec', '$except_unit_price_arr[$i]', '$except_qty_arr[$i]', '$except_price_bp_arr[$i]', '$except_note_arr[$i]')"; $db_query = "insert into pricereview_item (mid, item_no, item_group, option_relate_spec,item_spec, item_unit_price, item_qty, item_price_bp, note) values (";
$db_query .= "'$mid', '$item_no', 'E','$tmp_arr' , '$spec', '$except_unit_price_arr[$i]', '$except_qty_arr[$i]', '$except_price_bp_arr[$i]', '$except_note_arr[$i]')";
$result = mysqli_query($link, $db_query); $result = mysqli_query($link, $db_query);
$item_no++; $item_no++;
} }

Loading…
Cancel
Save