Cheng 1 year ago
parent
commit
684dcfe8bf
  1. 44
      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. 23
      wms/mkt/pricereview-index.php
  6. 3
      wms/mkt/pricereview-record-check.php
  7. 5
      wms/mkt/pricereview_mi-api.php

44
wms/fun_global.php

@ -99,17 +99,19 @@ function pricereview_class($rate, $user_id, &$ret = [], $special_fee, $i = 0)
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] = "M0175,,<##>M0107,,"; // 業務部專員:M0175陳君敏、M0107許紓晴(第2關有多位審核人)
$ret[3] = "M0060,,"; // 業務協理 $ret[3] = "M0060,,"; // 業務協理
if ($rate < 80 || $special_fee > 0) { if ($rate < 80 || $special_fee > 0) {
$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] = "M0137,,"; $ret[1] = "M0137,,";
$i++; $i++;
@ -120,10 +122,8 @@ function pricereview_class($rate, $user_id, &$ret = [], $special_fee, $i = 0)
pricereview_class($rate, $row["manager"], $ret, $special_fee, $i); 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] = "M0175,,<##>M0107,,"; // 業務部專員:M0175陳君敏、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) {
$ret[4] = "M0006,,"; // 總經理 $ret[4] = "M0006,,"; // 總經理
@ -151,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";
@ -172,27 +163,16 @@ function pricereview_renovate_class($rate, $user_id, $renovate_flag)
if ($renovate_flag == "REN") { if ($renovate_flag == "REN") {
// $ret[2] = 'M0012'; // $ret[2] = 'M0012';
if ($rate <= 100) $ret[3] = "M0008"; // 詹總 if ($rate <= 100) $ret[3] = "M0008"; // 詹總
if ($rate < 75) $ret[4] = "M0006"; // 總經理 if ($rate < 80) $ret[4] = "M0006"; // 總經理
} else { } else {
// 全汰改 // 全汰改
if ($rate <= 100) $ret[3] = "M0008"; // 詹總 if ($rate <= 100) $ret[3] = "M0008"; // 詹總
if ($rate < 75) $ret[4] = "M0006"; // 總經理 if ($rate < 80) $ret[4] = "M0006"; // 總經理
} }
mysqli_free_result($res); mysqli_free_result($res);
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)
{
}
/** /**
* 檢查使用者選單權限 * 檢查使用者選單權限
* *
@ -256,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) {

23
wms/mkt/pricereview-index.php

@ -299,6 +299,7 @@ function get_pending($token)
t.flow_name t.flow_name
LIMIT 0, 6 LIMIT 0, 6
"; ";
// echo '<pre>'; // echo '<pre>';
// print_r($sql); // print_r($sql);
// echo '</pre>'; // echo '</pre>';
@ -322,6 +323,7 @@ function get_pending($token)
} }
$result = get_pending($token); $result = get_pending($token);
print_r($result);
$result[1]['sid'] = !empty($result) ? $result[1]['sid'] : 'prm'; $result[1]['sid'] = !empty($result) ? $result[1]['sid'] : 'prm';
$result[1]['fid'] = !empty($result) ? $result[1]['fid'] : 'prm01'; $result[1]['fid'] = !empty($result) ? $result[1]['fid'] : 'prm01';
@ -336,14 +338,23 @@ if ($data) :
} }
*/ */
?> ?>
<style>
.categoryBtn{
width:120px;
height: 32px;
padding: 0;
line-height: 30px;
}
</style>
<link rel="stylesheet" href="common.css"> <link rel="stylesheet" href="common.css">
<div style="overflow-x:auto; white-space:nowrap;"> <div style="overflow-x:auto; white-space:nowrap;">
<a href="/wms/mkt/pricereview-index.php?&function_name=pricereview&token=<?php echo $token; ?>" class=" btn btn-primary btn-sm"> 所有價審</a> <?php if($user_id=== "M0060" || $user_id==="M0107" || $user_id==="M0175" || $user_id==="M0174" || $user_id==="M0225"){ ?>
<a href="/wms/mkt/pricereview-index.php?system_id=<?= $result[1]['sid'] ?>&flow_id=<?= $result[1]['fid'] ?>&function_name=pricereview&token=<?php echo $token; ?>" class=" btn btn-primary btn-sm"> 待我簽核</a> <a href="/wms/mkt/pricereview-index.php?&function_name=pricereview&token=<?php echo $token; ?>" class=" btn <?php echo (!isset($_GET['system_id']) && !isset($_GET['check'])) ? "btn btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 所有價審</a>
<a href="/wms/mkt/pricereview-index.php?check=1&function_name=pricereview&token=<?php echo $token; ?>" class=" btn btn-primary btn-sm"> 簽核完畢</a> <a href="/wms/mkt/pricereview-index.php?system_id=<?= $result[1]['sid'] ?>&flow_id=<?= $result[1]['fid'] ?>&function_name=pricereview&token=<?php echo $token; ?>" class=" btn <?php echo (isset($_GET['system_id'])) ? "btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 待我簽核</a>
<a href="/wms/mkt/pricereview-index.php?check=2&function_name=pricereview&token=<?php echo $token; ?>" class=" btn btn-primary btn-sm"> 結案同意</a> <a href="/wms/mkt/pricereview-index.php?check=1&function_name=pricereview&token=<?php echo $token; ?>" class=" btn <?php echo (isset($_GET['check']) && $_GET['check'] == 1) ? "btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 簽核完畢</a>
<a href="/wms/mkt/pricereview-index.php?check=3&function_name=pricereview&token=<?php echo $token; ?>" class=" btn btn-primary btn-sm"> 結案不同意</a> <a href="/wms/mkt/pricereview-index.php?check=2&function_name=pricereview&token=<?php echo $token; ?>" class=" btn <?php echo (isset($_GET['check']) && $_GET['check'] == 2) ? "btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 結案同意</a>
<a href="/wms/mkt/pricereview-index.php?check=3&function_name=pricereview&token=<?php echo $token; ?>" class=" btn <?php echo (isset($_GET['check']) && $_GET['check'] == 3) ? "btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 結案不同意</a>
<?php } ?>
<table id="table_index" class="table table-striped table-bordered" style="width:100%"> <table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead> <thead>
<tr> <tr>

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