Browse Source

價審 牌價將舊版停用

main
10994015 1 year ago
parent
commit
93bb2fd094
  1. 45
      wms/fun_global.php
  2. 2
      wms/mkt/price_option-index.php
  3. 2
      wms/mkt/price_option-select.php
  4. 2
      wms/mkt/pricereview-check.php
  5. 3
      wms/mkt/pricereview-record-check.php
  6. 5
      wms/mkt/pricereview_mi-api.php

45
wms/fun_global.php

@ -83,13 +83,12 @@ function manage_class($user_id, &$ret = [])
* @return array * @return array
* *
*/ */
function pricereview_class($rate, $user_id, &$ret = [], $special_fee) function pricereview_class($rate, $user_id, &$ret = [], $special_fee, $i = 0)
{ {
global $link; global $link;
$sql = "select manager from account where accountid = '$user_id'"; $sql = "select manager from account where accountid = '$user_id'";
$res = mysqli_query($link, $sql); $res = mysqli_query($link, $sql);
$i = 0;
while ($row = mysqli_fetch_assoc($res)) { while ($row = mysqli_fetch_assoc($res)) {
if ($row["manager"] == "M0001") return; // 董事長略過 if ($row["manager"] == "M0001") return; // 董事長略過
if ($user_id == 'TEST01') { if ($user_id == 'TEST01') {
@ -100,6 +99,7 @@ function pricereview_class($rate, $user_id, &$ret = [], $special_fee)
return $ret; return $ret;
exit; exit;
} else { } else {
// 若為第一層且使用者ID為區經理,直接訂好接下來的簽核人員並跳出。
if ($i == 0 && ($user_id == 'M0033' || $user_id == "M0137" || $user_id == 'M0029' || $user_id == 'M0054' || $user_id == "M0086")) { if ($i == 0 && ($user_id == 'M0033' || $user_id == "M0137" || $user_id == 'M0029' || $user_id == 'M0054' || $user_id == "M0086")) {
$ret[1] = $user_id . ",,"; $ret[1] = $user_id . ",,";
$ret[2] = "M0024,,<##>M0107,,"; // 業務部專員:M0024許伃廷、M0107許紓晴(第2關有多位審核人) $ret[2] = "M0024,,<##>M0107,,"; // 業務部專員:M0024許伃廷、M0107許紓晴(第2關有多位審核人)
@ -108,22 +108,21 @@ function pricereview_class($rate, $user_id, &$ret = [], $special_fee)
$ret[4] = "M0006,,"; // 總經理 $ret[4] = "M0006,,"; // 總經理
} }
return $ret; return $ret;
exit(); exit;
} }
if ($row["manager"] != "M0060" && $row["manager"] != "M0006" && $row["manager"] != "M0008") { if ($row["manager"] != "M0060" && $row["manager"] != "M0006" && $row["manager"] != "M0008") {
// 新梯的部分 桃竹本該給陳家文,改為劉永德
if ($row["manager"] == 'M0029') { if ($row["manager"] == 'M0029') {
$ret[1] = "M0147,,"; $ret[1] = "M0137,,";
$i++; $i++;
pricereview_class($rate, $row["manager"], $ret, $special_fee); pricereview_class($rate, $row["manager"], $ret, $special_fee, $i);
} else { } else {
$ret[1] = $row["manager"] . ",,"; $ret[1] = $row["manager"] . ",,";
$i++; $i++;
pricereview_class($rate, $row["manager"], $ret, $special_fee); pricereview_class($rate, $row["manager"], $ret, $special_fee, $i);
} }
} else { } else {
// if ($user_id == 'M0033' || $user_id == 'M0137' || $user_id == 'M0029' || $user_id == 'M0054' || $user_id == 'M0086') {
// $ret[1] = $user_id . ",,";
// }
$ret[2] = "M0024,,<##>M0107,,"; // 業務部專員:M0024許伃廷、M0107許紓晴(第2關有多位審核人) $ret[2] = "M0024,,<##>M0107,,"; // 業務部專員:M0024許伃廷、M0107許紓晴(第2關有多位審核人)
$ret[3] = "M0060,,"; // 業務協理 $ret[3] = "M0060,,"; // 業務協理
if ($rate < 80 || $special_fee > 0) { if ($rate < 80 || $special_fee > 0) {
@ -152,19 +151,10 @@ function pricereview_renovate_class($rate, $user_id, $renovate_flag)
$res = mysqli_query($link, $sql); $res = mysqli_query($link, $sql);
if ($row = mysqli_fetch_assoc($res)) { if ($row = mysqli_fetch_assoc($res)) {
if ($row["manager"] == "M0001") return; // 董事長略過 if ($row["manager"] == "M0001") return; // 董事長略過
if ($row["manager"] == "TEST04" || $user_id == 'TEST01') { if ($row["manager"] != "M0060" && $row["manager"] != "M0006" && $row["manager"] != "M0008") {
$ret[1] = "test04,,"; $ret[1] = $row["manager"];
$ret[2] = "test02,,";
$ret[3] = "test03,,";
$ret[4] = "test05,,";
return $ret;
exit();
} else { } else {
if ($row["manager"] != "M0060" && $row["manager"] != "M0006" && $row["manager"] != "M0008") { $ret[1] = $user_id;
$ret[1] = $row["manager"];
} else {
$ret[1] = $user_id;
}
} }
} }
// $ret[1] = "M0029"; // $ret[1] = "M0029";
@ -183,17 +173,6 @@ function pricereview_renovate_class($rate, $user_id, $renovate_flag)
return $ret; return $ret;
} }
/**
* 汰改(契約)價審簽核順位
* @param string $rate:破價比
* @param string $user_id:使用者ID
* @param string $renovate_flag:REN=M1改
* @return array
*
*/
function pricereview_maintainance_class($rate, $user_id, $renovate_flag)
{
}
/** /**
* 檢查使用者選單權限 * 檢查使用者選單權限
* *
@ -257,7 +236,7 @@ function accountid2name()
global $link; global $link;
$arr = []; $arr = [];
$sql = "select accountid, name from account where 1=1"; $sql = "select accountid, name from account where accounttype in ('B','E','M')";
$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];

2
wms/mkt/price_option-index.php

@ -67,6 +67,7 @@ $optional_arr = [1 => '標', 2 => '選'];
<table id="table_index2" class="table table-striped table-bordered" style="width:100%"> <table id="table_index2" class="table table-striped table-bordered" style="width:100%">
<thead> <thead>
<tr class="kind-col"> <tr class="kind-col">
<th scope="col" nowrap>ID</th>
<th scope="col" nowrap>名稱</th> <th scope="col" nowrap>名稱</th>
<th scope="col" nowrap>規格</th> <th scope="col" nowrap>規格</th>
<th scope="col" nowrap>備註</th> <th scope="col" nowrap>備註</th>
@ -88,6 +89,7 @@ $optional_arr = [1 => '標', 2 => '選'];
</template> </template>
<template x-for="option in options"> <template x-for="option in options">
<tr> <tr>
<td x-text="option.id"></td>
<td x-text="option.group_name"></td> <td x-text="option.group_name"></td>
<td x-text="option.spec"></td> <td x-text="option.spec"></td>
<td x-text="option.memo"></td> <td x-text="option.memo"></td>

2
wms/mkt/price_option-select.php

@ -51,6 +51,7 @@ $optional_arr = [1 => '標配', 2 => '選配',3=>'加價'];
<table id="table_index2" class="table table-striped table-bordered" style="width:100%"> <table id="table_index2" class="table table-striped table-bordered" style="width:100%">
<thead> <thead>
<tr class="kind-col"> <tr class="kind-col">
<th scope="col" nowrap>ID</th>
<th scope="col" nowrap>名稱</th> <th scope="col" nowrap>名稱</th>
<th scope="col" nowrap>規格</th> <th scope="col" nowrap>規格</th>
<th scope="col" nowrap>備註</th> <th scope="col" nowrap>備註</th>
@ -72,6 +73,7 @@ $optional_arr = [1 => '標配', 2 => '選配',3=>'加價'];
</template> </template>
<template x-for="option in options"> <template x-for="option in options">
<tr> <tr>
<td x-text="option.id"></td>
<td x-text="option.group_name"></td> <td x-text="option.group_name"></td>
<td x-text="option.spec"></td> <td x-text="option.spec"></td>
<td x-text="option.memo"></td> <td x-text="option.memo"></td>

2
wms/mkt/pricereview-check.php

@ -368,7 +368,7 @@ foreach ($res as $data) {
console.log(data.content[k][12]); console.log(data.content[k][12]);
Object.keys(data.content[k][14]).forEach(function(m) { Object.keys(data.content[k][14]).forEach(function(m) {
if (data.content[k][14][m][0] != '') { if (data.content[k][14][m][0] != '') {
mihtml += "<li>" + data.content[k][14][m][0].replace("&lt;br&gt;", "").replace("&amp;", "").replace("amp;", "").replace("()", "").replace(/\s+/g, '') + ":" + commafy(data.content[k][14][m][1]) + "</li>"; mihtml += "<li>" + data.content[k][14][m][0].replace("&amp;lt;br&amp;gt;", "").replace("&lt;br&gt;", "").replace("&amp;", "").replace("amp;", "").replace("()", "").replace(/\s+/g, '') + ":" + commafy(data.content[k][14][m][1]) + "</li>";
} }
}); });
Object.keys(data.content[k][16]).forEach(function(m) { Object.keys(data.content[k][16]).forEach(function(m) {

3
wms/mkt/pricereview-record-check.php

@ -1,6 +1,6 @@
<?php <?php
include "../header.php"; include "../header.php";
require_once("./conn.php");
if (isset($_POST['status'])) { if (isset($_POST['status'])) {
$fromsign = $_POST['fromsign']; $fromsign = $_POST['fromsign'];
foreach ($_POST as $k => $v) { foreach ($_POST as $k => $v) {
@ -60,6 +60,7 @@ if (isset($_POST['status'])) {
} else { } else {
$sql2 .= "status = 'YY'"; $sql2 .= "status = 'YY'";
} }
$sql_str = "";
} else { } else {
$sql2 .= "status = 'YY'"; $sql2 .= "status = 'YY'";
} }

5
wms/mkt/pricereview_mi-api.php

@ -330,10 +330,11 @@ $sql4 = "SELECT option_price.id, elevator_quotation_rule.equipment, option_mi.ba
FROM option_price FROM option_price
LEFT JOIN option_mi ON option_price.id = option_mi.option_price_id LEFT JOIN option_mi ON option_price.id = option_mi.option_price_id
LEFT JOIN elevator_quotation_rule ON option_mi.quotation_no = elevator_quotation_rule.quotation_no LEFT JOIN elevator_quotation_rule ON option_mi.quotation_no = elevator_quotation_rule.quotation_no
WHERE option_price.status = 'Y' WHERE option_mi.option_price_id = " . $opt_elev_arr[$val]["price_id"] . "
AND option_mi.option_price_id = " . $opt_elev_arr[$val]["price_id"] . "
AND (" . $v["item_weight"] . " BETWEEN option_mi.min_weight AND option_mi.max_weight) AND (" . $v["item_weight"] . " BETWEEN option_mi.min_weight AND option_mi.max_weight)
AND option_mi.open_kind = '" . $v["item_op"] . "'"; AND option_mi.open_kind = '" . $v["item_op"] . "'";
$res_om = mysqli_query($link, $sql4); $res_om = mysqli_query($link, $sql4);
if ($row_om = mysqli_fetch_assoc($res_om)) { if ($row_om = mysqli_fetch_assoc($res_om)) {
$row_om['price'] = (int)ceil($row_om['price']); $row_om['price'] = (int)ceil($row_om['price']);

Loading…
Cancel
Save