Browse Source

除外費用

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

2
wms/fun_global.php

@ -223,7 +223,7 @@ function accountid2name()
global $link;
$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);
while ($row = mysqli_fetch_row($res)) {
$arr[$row[0]] = $row[1];

49
wms/mkt/pricereview-create.php

@ -743,7 +743,7 @@ $option_str .= "</tbody></table>";
$("#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('td').eq(0).html() + pobj.find('td').eq(2).html() + ' ' + pobj.find('td').eq(1).html());
jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html() + '<br />(' + 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, "")));
@ -820,7 +820,7 @@ $option_str .= "</tbody></table>";
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 {
alert("請先新增OPTION");
@ -1065,6 +1065,9 @@ $option_str .= "</tbody></table>";
})
$('#option_relate_facil_all').val(optionRelateFacilArr);
var mnIdArr = [];
$("input[name='mn_id']").each(function() {
mnIdArr.push($(this).val());
})
@ -1115,11 +1118,21 @@ $option_str .= "</tbody></table>";
})
$('#mn_relate_facil_all').val(mnRelateFacilArr);
var exNoteArr = [];
$("input[name='except_note']").each(function() {
exNoteArr.push($(this).val());
})
$('#except_note_all').val(exNoteArr);
var exSpecArr = [];
$("td[name='Exclusions']").each(function() {
exNoteArr.push($(this).html());
})
$('#Exclusions_all').val(exNoteArr);
var exSpecArr = [];
$("input[name='except_spec']").each(function() {
exSpecArr.push($(this).val());
})
@ -1218,7 +1231,7 @@ $options = $stmt->fetchAll(PDO::FETCH_ASSOC);
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<label for="" >
<label for="">
<input type="text" class="form-control" style="float:left" placeholder="搜尋..." x-model="searchtext" @keyup="searchOptions($event)" />
</label>
<div class="categories">
@ -1230,13 +1243,13 @@ $options = $stmt->fetchAll(PDO::FETCH_ASSOC);
<button :class="['btn', (kind=='E') ? 'btn-primary' : 'btn-secondary text-light']" @click="changeCategory('E')">B-1 平台梯</button>
<button :class="['btn', (kind=='F') ? 'btn-primary' : 'btn-secondary text-light']" @click="changeCategory('F')">C-1 汰改</button>
<br /><br />
<template x-for="button in buttons" >
<template x-for="button in buttons">
<button style="margin-right:3px" :class="['btn', (button.type == subkind) ? 'btn-primary' : 'btn-secondary text-light']" @click="changeCategory('sub', button.type)" x-text="button.name"></button>
</template>
</div>
</div>
<div class="modal-body" >
<div class="modal-body">
<table id="" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr class="kind-col">
@ -1249,7 +1262,7 @@ $options = $stmt->fetchAll(PDO::FETCH_ASSOC);
</tr>
</thead>
<tbody>
<template x-for="option in options" >
<template x-for="option in options">
<tr style="cursor:pointer">
<td x-text="option.group_name"> </td>
<td x-text="option.spec"></td>
@ -1978,6 +1991,16 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
<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>
</thead>
<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_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_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">
<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="mn_relate_facil" nowrap></td>
</tr>
<?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_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>
<!-- <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="btndel3" class="btn btn-danger btn-sm">X</a>
</td>
<td name="mn_relate_facil" nowrap></td>
</tr>
<?php
}
@ -2402,7 +2430,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
</table>
<ul>
<li>營業權限85%以上;85-80%呈至區處長審核;80%以下呈至總經理審核。</li>
</ul>
</ul>
</div>
@ -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_memo_all" id="option_memo_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_kind_all" id="mn_kind_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_flow_id
";
// echo '<pre>';
// print_r($sql_get);
// echo '</pre>';
echo '<pre>';
print_r($sql_get);
echo '</pre>';
$result = mysqli_query($link, $sql_get);
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_qty_arr = explode(",", $except_qty_all);
$except_price_bp_arr = explode(",", $except_price_bp_all);
// 除外費用對應電梯
$except_relate_facil_arr = explode(",", htmlspecialchars_decode($Exclusions_all));
$item_no = 1;
for ($i = 0; $i < count($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_qty_arr[$i] = str_replace(",", "", $except_qty_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 (";
$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]')";
$tmp_arr = explode("<br>", $except_price_bp_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);
$item_no++;
}

2
wms/mkt/pricereview_renovate-index.php

@ -61,7 +61,7 @@ $data = array();
// sql語法存在變數中
$sql_cmd = sql_myself($user_id);
// M0024許伃廷,M0107許紓晴,M0012李盈瑩權限全開
if ($user_id == "M0024" || $user_id == "M0107" || $user_id == "M0012" || $user_id == "M0060" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04" || $user_id=="M0029") {
if ($user_id == "M0024" || $user_id == "M0107" || $user_id == "M0012" || $user_id == "M0060" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04" || $user_id == "M0029") {
$sql_cmd = "where create_at >= '2023-01-01 00:00:00'";
}
if ($user_id == "M0008") {

Loading…
Cancel
Save