Browse Source

1.修正安裝大日程 edit 按鈕

2.出貨日調整單 地址新增縣市下拉式選單
3.出貨地區預定明細 新增全部作番 的表
4.index 狀態新增營業經理確認中 的選項
5.大日程新增 林靜雯 檢視權限
gary
gary_chen\gary_chen 1 year ago
parent
commit
b4b5778f16
  1. 1
      .gitignore
  2. 309
      wms/estimated_shipping_date_report.php
  3. 20
      wms/wipwhole-change-contractdate-function.php
  4. 3
      wms/wipwhole-change-contractdate-submit.php
  5. 10
      wms/wipwhole-change-contractdate.php
  6. 11
      wms/wipwhole-index-function.php
  7. 20
      wms/wipwhole-index.php
  8. 44
      wms/wipwhole-rec-invoice-edit.php
  9. 25
      wms/wipwhole-renovate-index-function.php
  10. 24
      wms/wipwhole-renovate-index.php
  11. 48
      wms/wipwhole-renovate-rec-invoice-edit.php
  12. 2
      wms/wipwholeinstall-index-function.php
  13. 2
      wms/wipwholeinstall-renovate-index-function.php

1
.gitignore

@ -25,3 +25,4 @@ wms/mkt/WriteOffRepair.xlsx
wms/contract/images/contracts wms/contract/images/contracts
wms/test.php wms/test.php
app/account_log/ app/account_log/
wms/gary2.php

309
wms/estimated_shipping_date_report.php

@ -148,6 +148,27 @@ while ($row = $result->fetch_assoc()) {
$data2[] = $row; $data2[] = $row;
} }
$sql = "
SELECT
new_order.facility_kind,
COUNT(new_order.facility_kind) AS facility_count
FROM(
SELECT
w.facility_kind
FROM wipwholestatus AS w
WHERE 1=1
AND status = '1'
AND contract_type = 'A'
) AS new_order
WHERE 1 = 1
GROUP BY new_order.facility_kind
";
$result = mysqli_query($link, $sql);
$data4 = [];
while ($row = $result->fetch_assoc()) {
$data4[] = $row;
}
function findFacilityTypeAllCount($data2) function findFacilityTypeAllCount($data2)
{ {
$count = 0; $count = 0;
@ -187,6 +208,20 @@ while ($row = $result->fetch_assoc()) {
$data3[] = $row; $data3[] = $row;
} }
$sql = "
SELECT
w.renovate_type
FROM wipwholestatus AS w
WHERE 1=1
AND status = '1'
AND contract_type = 'B'
";
$result = mysqli_query($link, $sql);
$data5 = [];
while ($row = $result->fetch_assoc()) {
$data5[] = $row;
}
// 分開計算 // 分開計算
// $M1 = 0; // $M1 = 0;
@ -222,6 +257,16 @@ foreach ($data3 as $row) {
$m_type_arr[implode("+", json_decode($row['renovate_type']))]++; $m_type_arr[implode("+", json_decode($row['renovate_type']))]++;
} }
$M_count2 = count($data5);
$m_type_arr2 = [];
$m_type_arr2[''] = 0;
foreach ($data5 as $row) {
$m_type_arr2[implode("+", json_decode($row['renovate_type']))] = 0;
}
foreach ($data5 as $row) {
$m_type_arr2[implode("+", json_decode($row['renovate_type']))]++;
}
//數字轉英文(0=>A、1=>B、26=>AA...以此類推) //數字轉英文(0=>A、1=>B、26=>AA...以此類推)
function num2alpha($n) function num2alpha($n)
@ -240,7 +285,7 @@ function alpha2num($a)
$n = $n * 26 + ord($a[$i]) - 0x40; $n = $n * 26 + ord($a[$i]) - 0x40;
return $n - 1; return $n - 1;
} }
if($_SERVER["REQUEST_METHOD"] == 'POST'){ if ($_SERVER["REQUEST_METHOD"] == 'POST') {
if ($_POST['excel_output'] == 'excel_output') { if ($_POST['excel_output'] == 'excel_output') {
$spreadsheet = new Spreadsheet(); $spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet(); $sheet = $spreadsheet->getActiveSheet();
@ -1183,96 +1228,186 @@ if($_SERVER["REQUEST_METHOD"] == 'POST'){
</table> </table>
</div> </div>
<br /><br />
<div class="col-12 col-md-8"> <div class="row">
<table class="table table-striped"> <div class="col-12 col-md-8">
<thead> <table class="table table-striped">
<tr> <thead>
<td colsapn="<?php echo count($data2); ?>">受定規格分析</td> <tr>
</tr> <td colsapn="<?php echo count($data2); ?>">受定規格分析(時間區間)</td>
</thead> </tr>
<tbody> </thead>
<tr> <tbody>
<th>代碼</th> <tr>
<?php <th>代碼</th>
foreach ($data2 as $row) { <?php
echo "<td>" . $row['facility_kind'] . "</td>"; foreach ($data2 as $row) {
} echo "<td>" . $row['facility_kind'] . "</td>";
?> }
<th></th> ?>
</tr> <th></th>
<tr> </tr>
<th>機種</th> <tr>
<?php <th>機種</th>
foreach ($data2 as $row) { <?php
echo "<td>" . getFacilityNamebyType($row['facility_kind']) . "</td>"; foreach ($data2 as $row) {
} echo "<td>" . getFacilityNamebyType($row['facility_kind']) . "</td>";
?> }
<th>合計</th> ?>
</tr> <th>合計</th>
<tr> </tr>
<th>數量</th> <tr>
<?php <th>數量</th>
foreach ($data2 as $row) { <?php
echo "<td>" . $row['facility_count'] . "</td>"; foreach ($data2 as $row) {
} echo "<td>" . $row['facility_count'] . "</td>";
?> }
<th><?php echo findFacilityTypeAllCount($data2); ?></th> ?>
</tr> <th><?php echo findFacilityTypeAllCount($data2); ?></th>
<tr> </tr>
<th>百分比</th> <tr>
<?php <th>百分比</th>
foreach ($data2 as $row) { <?php
echo "<td>" . (round($row['facility_count'] / findFacilityTypeAllCount($data2), 4) * 100) . "%" . "</td>"; foreach ($data2 as $row) {
} echo "<td>" . (round($row['facility_count'] / findFacilityTypeAllCount($data2), 4) * 100) . "%" . "</td>";
?> }
<th><?php echo "100%"; ?></th> ?>
</tr> <th><?php echo "100%"; ?></th>
</tbody> </tr>
</table> </tbody>
</div> </table>
</div>
<div class="col-12 col-md-4">
<table class="table table-striped">
<thead>
<tr>
<td colspan='3'>舊改受訂規格分析(時間區間)</td>
</tr>
</thead>
<tbody>
<tr>
<th>類型</th>
<?php
foreach ($m_type_arr as $key => $val) {
$title_tmp = empty($key) ? '未分類' : $key;
echo "<th>" . $title_tmp . "</th>";
}
?>
<th>合計</th>
</tr>
<tr>
<th>數量</th>
<?php
foreach ($m_type_arr as $key => $val) {
echo "<th>" . $val . "</th>";
}
?>
<th><?php echo $M_count; ?></th>
</tr>
<tr>
<th>百分比</th>
<?php
foreach ($m_type_arr as $key => $val) {
echo "<th>" . round($val / $M_count, 4) * 100 . "%" . "</th>";
}
?>
<th>100%</th>
</tr>
</tbody>
</table>
</div>
</div>
<br /><br /> <br /><br />
<div class="row">
<div class="col-12 col-md-8">
<table class="table table-striped">
<thead>
<tr>
<td colsapn="<?php echo count($data4); ?>">受定規格分析(全部)</td>
</tr>
</thead>
<tbody>
<tr>
<th>代碼</th>
<?php
foreach ($data4 as $row) {
echo "<td>" . $row['facility_kind'] . "</td>";
}
?>
<th></th>
</tr>
<tr>
<th>機種</th>
<?php
foreach ($data4 as $row) {
echo "<td>" . getFacilityNamebyType($row['facility_kind']) . "</td>";
}
?>
<th>合計</th>
</tr>
<tr>
<th>數量</th>
<?php
foreach ($data4 as $row) {
echo "<td>" . $row['facility_count'] . "</td>";
}
?>
<th><?php echo findFacilityTypeAllCount($data4); ?></th>
</tr>
<tr>
<th>百分比</th>
<?php
foreach ($data4 as $row) {
echo "<td>" . (round($row['facility_count'] / findFacilityTypeAllCount($data4), 4) * 100) . "%" . "</td>";
}
?>
<th><?php echo "100%"; ?></th>
</tr>
</tbody>
</table>
</div>
<div class="col-12 col-md-4"> <div class="col-12 col-md-4">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<td>舊改受訂規格分析</td> <td colspan='3'>舊改受訂規格分析(全部)</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<th>類型</th> <th>類型</th>
<?php <?php
foreach ($m_type_arr as $key => $val) { foreach ($m_type_arr2 as $key => $val) {
$title_tmp = empty($key) ? '未分類' : $key; $title_tmp = empty($key) ? '未分類' : $key;
echo "<th>" . $title_tmp . "</th>"; echo "<th>" . $title_tmp . "</th>";
} }
?> ?>
<th>合計</th> <th>合計</th>
</tr> </tr>
<tr> <tr>
<th>數量</th> <th>數量</th>
<?php <?php
foreach ($m_type_arr as $key => $val) { foreach ($m_type_arr2 as $key => $val) {
echo "<th>" . $val . "</th>"; echo "<th>" . $val . "</th>";
} }
?> ?>
<th><?php echo $M_count; ?></th> <th><?php echo $M_count2; ?></th>
</tr> </tr>
<tr> <tr>
<th>百分比</th> <th>百分比</th>
<?php <?php
foreach ($m_type_arr as $key => $val) { foreach ($m_type_arr2 as $key => $val) {
echo "<th>" . round($val / $M_count, 4) * 100 . "%" . "</th>"; echo "<th>" . round($val / $M_count2, 4) * 100 . "%" . "</th>";
} }
?> ?>
<th>100%</th> <th>100%</th>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
<script> <script>
const formData = new FormData(); const formData = new FormData();

20
wms/wipwhole-change-contractdate-function.php

@ -674,3 +674,23 @@ function checkStatus($link, $cid, $user_id)
$res = mysqli_query($link, $sql); $res = mysqli_query($link, $sql);
return $res->num_rows > 0 ? false : true; return $res->num_rows > 0 ? false : true;
} }
/**
* 取台灣縣市select
* @param object $link:資料庫連線
* @return object 回傳 mysqli_fetch_all
*/
function getCity($link)
{
$sql = "
SELECT
content,
code_name
FROM code
WHERE field_name = 'taiwan_city'
";
$result = mysqli_query($link, $sql);
$data = mysqli_fetch_all($result, MYSQLI_ASSOC);
mysqli_free_result($result);
return $data;
}

3
wms/wipwhole-change-contractdate-submit.php

@ -8,7 +8,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$all_contractno_change = empty($_POST['all_contractno_change']) ? null : $_POST['all_contractno_change']; $all_contractno_change = empty($_POST['all_contractno_change']) ? null : $_POST['all_contractno_change'];
$real_contract_arrival_date = $_POST['real_contract_arrival_date']; $real_contract_arrival_date = $_POST['real_contract_arrival_date'];
$contract_arrival_date = $_POST['contract_arrival_date']; $contract_arrival_date = $_POST['contract_arrival_date'];
$real_address = $_POST['real_address']; $city = $_POST['city'];
$real_address = $city.$_POST['real_address'];
$old_real_address = $_POST['old_real_address']; $old_real_address = $_POST['old_real_address'];
$estimated_shipping_schedule_date = $_POST['estimated_shipping_schedule_date']; $estimated_shipping_schedule_date = $_POST['estimated_shipping_schedule_date'];
$contractno = $_POST['contractno']; $contractno = $_POST['contractno'];

10
wms/wipwhole-change-contractdate.php

@ -283,7 +283,13 @@ if (!empty(checkNowFormStatus($link)))
<td colspan="3"> <td colspan="3">
<?php <?php
if (empty(checkNowFormStatus($link))) { if (empty(checkNowFormStatus($link))) {
echo "<input type='text' name='real_address' />"; echo "<select id='city' name='city' required>";
$citys = getCity($link);
print_r($citys);
foreach ($citys as $city)
echo "<option value='" . $city['content'] . "'>" . $city['content'] . "</option>";
echo "</select>";
echo "<input type='text' id='real_address' name='real_address' />";
} else { } else {
echo $row2["real_address"]; echo $row2["real_address"];
echo "<input type='hidden' name='real_address' value='" . $row2["real_address"] . "' />"; echo "<input type='hidden' name='real_address' value='" . $row2["real_address"] . "' />";
@ -340,7 +346,7 @@ if (!empty(checkNowFormStatus($link)))
</select> </select>
"; ";
} else if (checkNowFormStatus($link) == 'B') { } else if (checkNowFormStatus($link) == 'B') {
if (in_array(getDepartmentId($link, $user_id), ['521', '531', '541', '542', '543', '544', '545'])){ if (in_array(getDepartmentId($link, $user_id), ['521', '531', '541', '542', '543', '544', '545'])) {
echo "<select name='next_users' id='next_users'>"; echo "<select name='next_users' id='next_users'>";
foreach ($shengguanok_options as $shengguanok_option) : foreach ($shengguanok_options as $shengguanok_option) :
echo " echo "

11
wms/wipwhole-index-function.php

@ -147,11 +147,20 @@ function getDataSql($department_id, $role_id, $user_id)
if (in_array($user_id, ['M0166', 'M0091'])) { if (in_array($user_id, ['M0166', 'M0091'])) {
$user_id = 'M0086'; $user_id = 'M0086';
} }
// 補丁 許馨文 權限 = 李烘銘
if (in_array($user_id, ['M0115'])) {
$user_id = 'M0086';
}
// 補丁 孫仲凱 = 林瑋隆 // 補丁 孫仲凱 = 林瑋隆
if (in_array($user_id, ['M0159'])) { if (in_array($user_id, ['M0159'])) {
$user_id = 'M0113'; $user_id = 'M0113';
} }
// 補丁 林靜雯 權限 = 劉永德 新梯 北區+桃竹
if (in_array($user_id, ['M0189'])) {
$user_id = 'M0137';
}
$sql_cmd = sql_myself($user_id, "salesid"); $sql_cmd = sql_myself($user_id, "salesid");
$sql = " $sql = "
SELECT * FROM wipwholestatus $sql_cmd SELECT * FROM wipwholestatus $sql_cmd
@ -846,7 +855,7 @@ function getYewuStatus($link, $user_department_id, $role_id)
function getWarehouseStatus($link, $user_department_id, $role_id, $status) function getWarehouseStatus($link, $user_department_id, $role_id, $status)
{ {
// if (in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545, 50, 501, 311, 313, 314, 521, 315, 912])) { // if (in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545, 50, 501, 311, 313, 314, 521, 315, 912])) {
if(getSaveEstimateInstallData($user_department_id, $role_id)){ if (getSaveEstimateInstallData($user_department_id, $role_id)) {
if ($status == 1) { if ($status == 1) {
return checkNowFormGStatus($link) == 'G' ? "" : "disabled"; return checkNowFormGStatus($link) == 'G' ? "" : "disabled";
} else { } else {

20
wms/wipwhole-index.php

@ -67,7 +67,8 @@ $tableArr = array(
"B" => "B", "B" => "B",
"G" => "G", "G" => "G",
"CH" => "C,H", "CH" => "C,H",
"Z" => "Z" "Z" => "Z",
"I" => "I",
); );
if (empty($sheetNum) || $sheetNum == "All") { if (empty($sheetNum) || $sheetNum == "All") {
@ -212,6 +213,9 @@ $data = mysqli_query($link, $sql);
<li> <li>
<a href="#" onclick="showATable()">營業確認中</a> <a href="#" onclick="showATable()">營業確認中</a>
</li> </li>
<li>
<a href="#" onclick="showITable()">營業主管確認中</a>
</li>
<li> <li>
<a href="#" onclick="showBTable()">設計確認中</a> <a href="#" onclick="showBTable()">設計確認中</a>
</li> </li>
@ -433,14 +437,20 @@ mysqli_close($link);
window.location.href = "<?php echo "wipwhole-index.php?function_name=wipinstall&$token_link"; ?>" + "&sheetNum=" + sheetNum; window.location.href = "<?php echo "wipwhole-index.php?function_name=wipinstall&$token_link"; ?>" + "&sheetNum=" + sheetNum;
} }
function showITable() {
sheetNum = "I";
window.location.href = "<?php echo "wipwhole-index.php?function_name=wipinstall&$token_link"; ?>" + "&sheetNum=" + sheetNum;
}
function showTable(code) { function showTable(code) {
var tmp_arr = { var tmp_arr = {
"All": "1", "All": "1",
"A": "2", "A": "2",
"B": "3", "I": "3",
"G": "4", "B": "4",
"CH": "5", "G": "5",
"Z": "6", "CH": "6",
"Z": "7",
} }
$("nav.navbar.navbar-tabs div > ul > li").attr("class", ""); $("nav.navbar.navbar-tabs div > ul > li").attr("class", "");
$("nav.navbar.navbar-tabs div > ul > li:nth-child(" + tmp_arr[code] + ")").attr("class", "active"); $("nav.navbar.navbar-tabs div > ul > li:nth-child(" + tmp_arr[code] + ")").attr("class", "active");

44
wms/wipwhole-rec-invoice-edit.php

@ -158,8 +158,9 @@ include "wipwhole-rec-invoice-edit-submit.php";
521, 531, 220, 250, 521, 531, 220, 250,
541, 542, 543, 544, 545 541, 542, 543, 544, 545
]; ];
if (in_array($user_department_id, $show_tmp_arr)) if ($user_id !== 'M0115')
echo "<a target='_blank' href='wipwhole-change-contractdate.php?function_name=wipwholerenstatus&$token_link&id=$id'>工地地址調整</a>"; if (in_array($user_department_id, $show_tmp_arr))
echo "<a target='_blank' href='wipwhole-change-contractdate.php?function_name=wipwholerenstatus&$token_link&id=$id'>工地地址調整</a>";
?> ?>
</td> </td>
<td> <td>
@ -227,8 +228,9 @@ include "wipwhole-rec-invoice-edit-submit.php";
521, 531, 220, 250, 521, 531, 220, 250,
541, 542, 543, 544, 545 541, 542, 543, 544, 545
]; ];
if (in_array($user_department_id, $show_tmp_arr)) if ($user_id !== 'M0115')
echo "<a target='_blank' href='wipwhole-change-contractdate.php?function_name=wipwholerenstatus&$token_link&id=$id'>出貨日調整</a>"; if (in_array($user_department_id, $show_tmp_arr))
echo "<a target='_blank' href='wipwhole-change-contractdate.php?function_name=wipwholerenstatus&$token_link&id=$id'>出貨日調整</a>";
?> ?>
</td> </td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
@ -507,25 +509,29 @@ include "wipwhole-rec-invoice-edit-submit.php";
<input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>"> <input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>">
<input class="form-control " type="hidden" name="create_at" value="<?= $row["create_at"]; ?>"> <input class="form-control " type="hidden" name="create_at" value="<?= $row["create_at"]; ?>">
<?php <?php
if (checkNowFormYDStatus($link) == 'A' && in_array($user_department_id, [220, 311, 312, 313, 314, 315])) { if ($user_id !== 'M0115') {
if (checkNowFormYDStatus($link) == 'A' && in_array($user_department_id, [220, 311, 312, 313, 314, 315])) {
?> ?>
<button onclick="doMarketingAssign()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;"> <button onclick="doMarketingAssign()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;">
提交至<?php echo checkUseridIsManager($user_id) ? "設計部門" : "營業主管"; ?> 提交至<?php echo checkUseridIsManager($user_id) ? "設計部門" : "營業主管"; ?>
</button> </button>
<?php <?php
} else if (checkNowFormYDStatus($link) == 'I' && checkUseridIsManager($user_id)) { } else if (checkNowFormYDStatus($link) == 'I' && checkUseridIsManager($user_id)) {
?> ?>
<button onclick="doBackMarketingAssign()" type="button" class="btn btn-danger btn-lg pull-right" style="margin-left:3px;"> <button onclick="doBackMarketingAssign()" type="button" class="btn btn-danger btn-lg pull-right" style="margin-left:3px;">
退回營業 退回營業
</button> </button>
<button onclick="doMarketingAssign()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;"> <button onclick="doMarketingAssign()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;">
提交至設計部門 提交至設計部門
</button> </button>
<?php
}
?>
<button onclick="savedata()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>存檔</button>
<span class="text-danger pull-right">若無工勘資料請勿移交至設計階段!</span>
<?php <?php
} }
?> ?>
<button onclick="savedata()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>存檔</button>
<span class="text-danger pull-right">若無工勘資料請勿移交至設計階段!</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>

25
wms/wipwhole-renovate-index-function.php

@ -387,6 +387,12 @@ function getDataSql($department_id, $role_id, $user_id)
if (in_array($user_id, ['M0166', 'M0091'])) { if (in_array($user_id, ['M0166', 'M0091'])) {
$user_id = 'M0086'; $user_id = 'M0086';
} }
// 補丁 許馨文 權限 = 李烘銘
if (in_array($user_id, ['M0115'])) {
$user_id = 'M0086';
}
// 補丁 孫仲凱 = 林瑋隆 // 補丁 孫仲凱 = 林瑋隆
if (in_array($user_id, ['M0159'])) { if (in_array($user_id, ['M0159'])) {
$user_id = 'M0113'; $user_id = 'M0113';
@ -407,6 +413,18 @@ function getDataSql($department_id, $role_id, $user_id)
$sql .= getWipwholeSearchSql(); $sql .= getWipwholeSearchSql();
$sql .= "ORDER BY real_contract_arrival_date DESC "; $sql .= "ORDER BY real_contract_arrival_date DESC ";
// 補丁 林靜雯 權限 = 劉永德 新梯 桃竹
if($user_id == 'M0189'){
$sql_cmd = sql_myself("M0137", "salesid");
$sql = "
SELECT * FROM wipwholestatus $sql_cmd
";
$sql .= empty($sql_cmd) ? " WHERE 1=1 AND status = '1' AND contract_type = '$contract_type' " : " AND status = '1' AND contract_type = '$contract_type'";
$sql .= getWipwholeSearchSql();
$sql .= "ORDER BY real_contract_arrival_date DESC ";
return $sql;
}
if (in_array($department_id, $department_arr)) { if (in_array($department_id, $department_arr)) {
// 北區營銷部 營銷專案經理 311 1 // 北區營銷部 營銷專案經理 311 1
// 新梯營銷經理 311 3 // 新梯營銷經理 311 3
@ -414,8 +432,7 @@ function getDataSql($department_id, $role_id, $user_id)
// 中區營銷部 新梯營銷經理 313 1 // 中區營銷部 新梯營銷經理 313 1
// 南區營銷部 銷售專案經理 314 2 // 南區營銷部 銷售專案經理 314 2
// 花東區營銷部 營銷專案經理 315 1 // 花東區營銷部 營銷專案經理 315 1
if (($department_id == '311' && in_array($role_id, ['1', '3'])) || $user_id == "M0013") {
if ($department_id == '311' && (in_array($role_id, ['1', '3'])) || $user_id = "M0013") {
$sql = " $sql = "
SELECT * FROM wipwholestatus SELECT * FROM wipwholestatus
WHERE 1=1 WHERE 1=1
@ -426,6 +443,7 @@ function getDataSql($department_id, $role_id, $user_id)
"; ";
return $sql; return $sql;
} }
if ($department_id == '312' && (in_array($role_id, ['1']))) { if ($department_id == '312' && (in_array($role_id, ['1']))) {
$sql = " $sql = "
SELECT * FROM wipwholestatus SELECT * FROM wipwholestatus
@ -556,6 +574,7 @@ function getDataSql($department_id, $role_id, $user_id)
"; ";
return $sql; return $sql;
} }
return $sql; return $sql;
} }
@ -835,7 +854,7 @@ function getWarehouseStatus($link, $user_department_id, $role_id, $status)
if ($user_department_id == 220) if ($user_department_id == 220)
return ""; return "";
// if (in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545, 50, 501, 311, 313, 314, 521, 315, 912])) { // if (in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545, 50, 501, 311, 313, 314, 521, 315, 912])) {
if(getSaveEstimateInstallData($user_department_id, $role_id)){ if (getSaveEstimateInstallData($user_department_id, $role_id)) {
if ($status == 1) { if ($status == 1) {
return checkNowFormStatus($link) == 'A' ? "" : "disabled"; return checkNowFormStatus($link) == 'A' ? "" : "disabled";
} else { } else {

24
wms/wipwhole-renovate-index.php

@ -65,7 +65,8 @@ $tableArr = array(
"B" => "B", "B" => "B",
"C" => "C", "C" => "C",
"D" => "D", "D" => "D",
"Z" => "Z" "Z" => "Z",
"F" => "F",
); );
if (empty($sheetNum) || $sheetNum == "All") { if (empty($sheetNum) || $sheetNum == "All") {
@ -210,6 +211,9 @@ $data = mysqli_query($link, $sql);
<li> <li>
<a href="#" onclick="showBTable()">營業確認中</a> <a href="#" onclick="showBTable()">營業確認中</a>
</li> </li>
<li>
<a href="#" onclick="showFTable()">營業主管確認中</a>
</li>
<li> <li>
<a href="#" onclick="showCTable()">設計確認中</a> <a href="#" onclick="showCTable()">設計確認中</a>
</li> </li>
@ -296,9 +300,9 @@ $data = mysqli_query($link, $sql);
</div> </div>
<?php <?php
echo "<div id='data_detail_table_div' class='data_table_div' style='overflow-x:auto;'>"; echo "<div id='data_detail_table_div' class='data_table_div' style='overflow-x:auto;'>";
include "wipwhole-renovate-index-table-html.php"; include "wipwhole-renovate-index-table-html.php";
echo "</div>"; echo "</div>";
#結束連線 #結束連線
@ -444,6 +448,11 @@ mysqli_close($link);
window.location.href = "<?php echo "wipwhole-renovate-index.php?function_name=wipinstall&$token_link"; ?>" + "&sheetNum=" + sheetNum; window.location.href = "<?php echo "wipwhole-renovate-index.php?function_name=wipinstall&$token_link"; ?>" + "&sheetNum=" + sheetNum;
} }
function showFTable() {
sheetNum = "F";
window.location.href = "<?php echo "wipwhole-renovate-index.php?function_name=wipinstall&$token_link"; ?>" + "&sheetNum=" + sheetNum;
}
function showBTable() { function showBTable() {
sheetNum = "B"; sheetNum = "B";
window.location.href = "<?php echo "wipwhole-renovate-index.php?function_name=wipinstall&$token_link"; ?>" + "&sheetNum=" + sheetNum; window.location.href = "<?php echo "wipwhole-renovate-index.php?function_name=wipinstall&$token_link"; ?>" + "&sheetNum=" + sheetNum;
@ -469,9 +478,10 @@ mysqli_close($link);
"All": "1", "All": "1",
"A": "2", "A": "2",
"B": "3", "B": "3",
"C": "4", "F": "4",
"D": "5", "C": "5",
"Z": "6", "D": "6",
"Z": "7",
} }
$("nav.navbar.navbar-tabs div > ul > li").attr("class", ""); $("nav.navbar.navbar-tabs div > ul > li").attr("class", "");
$("nav.navbar.navbar-tabs div > ul > li:nth-child(" + tmp_arr[code] + ")").attr("class", "active"); $("nav.navbar.navbar-tabs div > ul > li:nth-child(" + tmp_arr[code] + ")").attr("class", "active");

48
wms/wipwhole-renovate-rec-invoice-edit.php

@ -154,8 +154,9 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">預計交期(到工地) <td style="vertical-align: middle">預計交期(到工地)
<br /> <br />
<?php <?php
if (getWipwholeChangeButtonStatus($user_department_id)) if ($user_id !== 'M0115')
echo "<a target='_blank' href='wipwhole-change-contractdate.php?function_name=wipwholerenstatus&$token_link&id=$id'>出貨日調整</a>"; if (getWipwholeChangeButtonStatus($user_department_id))
echo "<a target='_blank' href='wipwhole-change-contractdate.php?function_name=wipwholerenstatus&$token_link&id=$id'>出貨日調整</a>";
?> ?>
</td> </td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
@ -177,8 +178,9 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
</td> </td>
<td style="vertical-align: middle">工地地址<br /> <td style="vertical-align: middle">工地地址<br />
<?php <?php
if (getWipwholeChangeButtonStatus($user_department_id)) if ($user_id !== 'M0115')
echo "<a target='_blank' href='wipwhole-change-contractdate.php?function_name=wipwholerenstatus&$token_link&id=$id'>工地地址調整</a>"; if (getWipwholeChangeButtonStatus($user_department_id))
echo "<a target='_blank' href='wipwhole-change-contractdate.php?function_name=wipwholerenstatus&$token_link&id=$id'>工地地址調整</a>";
?> ?>
</td> </td>
<td> <td>
@ -709,24 +711,28 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>"> <input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>">
<input class="form-control " type="hidden" name="create_at" value="<?= $row["create_at"]; ?>"> <input class="form-control " type="hidden" name="create_at" value="<?= $row["create_at"]; ?>">
<?php <?php
if (checkNowFormStatus($link) == 'B' && in_array($user_department_id, [220, 311, 312, 313, 314, 315, 511, 512, 513, 514])) { if ($user_id !== 'M0115') {
if (checkNowFormStatus($link) == 'B' && in_array($user_department_id, [220, 311, 312, 313, 314, 315, 511, 512, 513, 514])) {
?> ?>
<button onclick="doMarketingAssign()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;"> <button onclick="doMarketingAssign()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;">
提交至<?php echo checkUseridIsManager($user_id) ? "設計部門" : "營業主管"; ?> 提交至<?php echo checkUseridIsManager($user_id) ? "設計部門" : "營業主管"; ?>
</button> </button>
<button onclick="doBackWarhouseAssign()" type="button" class="btn btn-danger btn-lg pull-right" style="margin-left:3px;">退回工務部門</button> <button onclick="doBackWarhouseAssign()" type="button" class="btn btn-danger btn-lg pull-right" style="margin-left:3px;">退回工務部門</button>
<?php <?php
} else if (checkNowFormStatus($link) == 'F' && checkUseridIsManager($user_id)) { } else if (checkNowFormStatus($link) == 'F' && checkUseridIsManager($user_id)) {
?> ?>
<button onclick="doBackMarketingAssign()" type="button" class="btn btn-danger btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>退回營業</button> <button onclick="doBackMarketingAssign()" type="button" class="btn btn-danger btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>退回營業</button>
<button onclick="doMarketingAssign()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;"> <button onclick="doMarketingAssign()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;">
提交至設計部門 提交至設計部門
</button> </button>
<?php
}
?>
<button onclick="savedata()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>存檔</button>
<span class="text-danger pull-right">若無工勘資料請勿移交至設計階段!</span>
<?php <?php
} }
?> ?>
<button onclick="savedata()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;" <?= $marketing2; ?>>存檔</button>
<span class="text-danger pull-right">若無工勘資料請勿移交至設計階段!</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -1154,12 +1160,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
if (checkNowFormStatus($link) == 'Z' && ($user_department_id == '220' || ($user_department_id == '321' && $role_id !== '5'))) { if (checkNowFormStatus($link) == 'Z' && ($user_department_id == '220' || ($user_department_id == '321' && $role_id !== '5'))) {
?> ?>
<button class="btn btn-primary btn-lg pull-right" type="button" style="margin-left:3px;" disabled>日程已結案</button> <button class="btn btn-primary btn-lg pull-right" type="button" style="margin-left:3px;" disabled>日程已結案</button>
<?php <?php
} else { } else {
// 生管 小雯 預計到貨日(到觀音廠日)權限 // 生管 小雯 預計到貨日(到觀音廠日)權限
// if ($user_id == 'M0168') { // if ($user_id == 'M0168') {
?> ?>
<!-- <button onclick="savedata()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;">存檔</button> --> <!-- <button onclick="savedata()" type="button" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;">存檔</button> -->
<?php <?php
// } // }

2
wms/wipwholeinstall-index-function.php

@ -92,7 +92,7 @@ function getEditFlag($department_id, $role_id, $user_id)
return 4; return 4;
// 設計 // 設計
if ($department_id == "911") if ($department_id == "911")
return 2; return 4;
// 宜蘭工務 // 宜蘭工務
if ($user_id == 'M0087') if ($user_id == 'M0087')
return 4; return 4;

2
wms/wipwholeinstall-renovate-index-function.php

@ -92,7 +92,7 @@ function getEditFlag($department_id, $role_id, $user_id)
return 4; return 4;
// 設計 // 設計
if ($department_id == "911") if ($department_id == "911")
return 2; return 4;
// 品証 // 品証
if ($department_id == "912") if ($department_id == "912")
return 4; return 4;

Loading…
Cancel
Save