diff --git a/wms/board-index.php b/wms/board-index.php index c3dd41a6..ac67b1a9 100644 --- a/wms/board-index.php +++ b/wms/board-index.php @@ -8,96 +8,189 @@ $data = array(); $sql = "select * from board where status = 'Y' order by id"; // 用mysqli_query方法執行(sql語法)將結果存在變數中 -$data = mysqli_query($link,$sql); +$data = mysqli_query($link, $sql); +$data2 = $data; ?> - -

- - - -

+ +

+ + + +

- -
- - - - - - - - - - - - - - - - - - - - - - - + } + + + /* The Modal (background) */ + .modal { + display: none; + /* Hidden by default */ + position: fixed; + /* Stay in place */ + z-index: 1; + /* Sit on top */ + padding-top: 100px; + /* Location of the box */ + left: 0; + top: 0; + width: 100%; + /* Full width */ + height: 100%; + /* Full height */ + overflow: auto; + /* Enable scroll if needed */ + + } + + .modal .back { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.4); + /* Black w/ opacity */ + } + + /* Modal Content */ + .modal-content { + z-index: 9; + background-color: #fefefe; + margin: auto; + padding: 20px; + border: 1px solid #888; + width: 80%; + } + + /* The Close Button */ + .close { + color: #aaaaaa; + float: right; + font-size: 28px; + font-weight: bold; + } + + .close:hover, + .close:focus { + color: #000; + text-decoration: none; + cursor: pointer; + } + +
+
項次主旨附件建檔人建檔時間關閉公告
-

- - - - - -

-
+ + + + + + + + + + + + + + + + + + + + + + + + +
項次主旨附件建檔人建檔時間關閉公告
+ +

+ + + + + +

+
+
+ + + + - - - + There is no record!"; endif; diff --git a/wms/css/view/wipwhole-index.php b/wms/css/view/wipwhole-index.php index 8284d7ca..c24af508 100644 --- a/wms/css/view/wipwhole-index.php +++ b/wms/css/view/wipwhole-index.php @@ -3,22 +3,27 @@ #table_index2_paginate { text-align: right; } + #table_index3_filter, #table_index3_paginate { text-align: right; } + #table_index4_filter, #table_index4_paginate { text-align: right; } + #table_index5_filter, #table_index5_paginate { text-align: right; } + #table_index6_filter, #table_index6_paginate { text-align: right; } + #table_index7_filter, #table_index7_paginate { text-align: right; @@ -66,6 +71,117 @@ text-align: center; } + #loadingOverlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(255, 255, 255, 0.7); + /* 透明度的背景颜色 */ + z-index: 9999; + /* 确保在最上层显示 */ + /* 添加加载动画的样式 */ + } + + .hidden { + display: none; + } + + #loadingOverlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(255, 255, 255, 0.7); + /* 半透明的背景 */ + z-index: 9999; + /* 确保显示在最上层 */ + display: flex; + justify-content: center; + align-items: center; + } + + .loading-text { + text-align: center; + margin-top: 10px; + /* 调整文字与图标之间的间距 */ + font-size: 16px; + color: #333; + /* 文字颜色 */ + } + + .loading-icon { + /* 这里是你加载图标的样式,可以是一个动画、GIF图或者SVG等 */ + /* 例如一个简单的加载圆圈动画 */ + border: 10px solid #f3f3f3; + /* 灰色边框 */ + border-top: 10px solid #3498db; + /* 蓝色顶部边框 */ + border-radius: 50%; + width: 80px; + height: 80px; + animation: spin 2s linear infinite; + /* 旋转动画 */ + } + +/* The Modal (background) */ +.modal { + display: none; /* Hidden by default */ + position: fixed; /* Stay in place */ + z-index: 1; /* Sit on top */ + padding-top: 100px; /* Location of the box */ + left: 0; + top: 0; + width: 100%; /* Full width */ + height: 100%; /* Full height */ + overflow: auto; /* Enable scroll if needed */ + +} +.modal .back{ + position: absolute; + top: 0; + left:0; + width: 100%; + height: 100%; + background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ +} +/* Modal Content */ +.modal-content { + z-index: 9; + background-color: #fefefe; + margin: auto; + padding: 20px; + border: 1px solid #888; + width: 80%; +} + +/* The Close Button */ +.close { + color: #aaaaaa; + float: right; + font-size: 28px; + font-weight: bold; +} + +.close:hover, +.close:focus { + color: #000; + text-decoration: none; + cursor: pointer; +} + + + @keyframes spin { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } + } @media screen and (max-width: 600px) { diff --git a/wms/css/view/wipwhole-renovate-index.php b/wms/css/view/wipwhole-renovate-index.php index 8284d7ca..9bd7eef9 100644 --- a/wms/css/view/wipwhole-renovate-index.php +++ b/wms/css/view/wipwhole-renovate-index.php @@ -3,22 +3,27 @@ #table_index2_paginate { text-align: right; } + #table_index3_filter, #table_index3_paginate { text-align: right; } + #table_index4_filter, #table_index4_paginate { text-align: right; } + #table_index5_filter, #table_index5_paginate { text-align: right; } + #table_index6_filter, #table_index6_paginate { text-align: right; } + #table_index7_filter, #table_index7_paginate { text-align: right; @@ -66,6 +71,60 @@ text-align: center; } + #loadingOverlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(255, 255, 255, 0.7); + /* 透明度的背景颜色 */ + z-index: 9999; + /* 确保在最上层显示 */ + /* 添加加载动画的样式 */ + } + + .hidden { + display: none; + } + + #loadingOverlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(255, 255, 255, 0.7); + /* 半透明的背景 */ + z-index: 9999; + /* 确保显示在最上层 */ + display: flex; + justify-content: center; + align-items: center; + } + + .loading-text { + text-align: center; + margin-top: 10px; + /* 调整文字与图标之间的间距 */ + font-size: 16px; + color: #333; + /* 文字颜色 */ + } + + .loading-icon { + /* 这里是你加载图标的样式,可以是一个动画、GIF图或者SVG等 */ + /* 例如一个简单的加载圆圈动画 */ + border: 10px solid #f3f3f3; + /* 灰色边框 */ + border-top: 10px solid #3498db; + /* 蓝色顶部边框 */ + border-radius: 50%; + width: 80px; + height: 80px; + animation: spin 2s linear infinite; + /* 旋转动画 */ + } @media screen and (max-width: 600px) { diff --git a/wms/fun_global.php b/wms/fun_global.php index 174b0e7a..f7d217a2 100644 --- a/wms/fun_global.php +++ b/wms/fun_global.php @@ -169,6 +169,8 @@ function check_user_permission($user_id, $token) { mysqli_free_result($res); if (!$do) { + echo "無權限操作,請洽管理員。"; + exit; echo ""; } else return $do; } diff --git a/wms/gary.php b/wms/gary.php index 90696e89..d18ed12d 100644 --- a/wms/gary.php +++ b/wms/gary.php @@ -3,59 +3,61 @@ ini_set('display_errors', 'on'); include "fun_global.php"; include "database.php"; +print_r(manage_class("M0117")); +echo manage_class("M0117")[0]; -// account table -$accounttype = "A"; -$accountid = ""; -$pwd = "123"; -$name = ""; -$creater = ""; -$create_at = date("Y-m-d H:i:s"); +// // account table +// $accounttype = "A"; +// $accountid = ""; +// $pwd = "123"; +// $name = ""; +// $creater = ""; +// $create_at = date("Y-m-d H:i:s"); -// 檢查 accountid 是否未重複並寫入 account 資料表 -$sql = " - SELECT DISTINCT - a.accountid, - w.contractno, - w.custom - FROM wipwholestatus AS w - LEFT JOIN ( - SELECT - accountid - FROM account - ) AS a - ON a.accountid = w.contractno - WHERE a.accountid IS NULL -"; -$data = mysqli_query($link, $sql); +// // 檢查 accountid 是否未重複並寫入 account 資料表 +// $sql = " +// SELECT DISTINCT +// a.accountid, +// w.contractno, +// w.custom +// FROM wipwholestatus AS w +// LEFT JOIN ( +// SELECT +// accountid +// FROM account +// ) AS a +// ON a.accountid = w.contractno +// WHERE a.accountid IS NULL +// "; +// $data = mysqli_query($link, $sql); -$J = 0; -foreach ($data as $key => $row) : - echo $row['accountid']."
"; - echo $J++; - if (empty($row['accountid'])) { +// $J = 0; +// foreach ($data as $key => $row) : +// echo $row['accountid']."
"; +// echo $J++; +// if (empty($row['accountid'])) { - $accountid = $row['contractno']; - $name = $row['custom']; - echo $sql2 = " - INSERT INTO account ( - accounttype, - accountid, - pwd, - name, - creater, - create_at - ) VALUES ( - '$accounttype', - '$accountid', - '$pwd', - '$name', - '$creater', - '$create_at' - ) - "; - echo "
"; - mysqli_query($link, $sql2); - } -endforeach; +// $accountid = $row['contractno']; +// $name = $row['custom']; +// echo $sql2 = " +// INSERT INTO account ( +// accounttype, +// accountid, +// pwd, +// name, +// creater, +// create_at +// ) VALUES ( +// '$accounttype', +// '$accountid', +// '$pwd', +// '$name', +// '$creater', +// '$create_at' +// ) +// "; +// echo "
"; +// mysqli_query($link, $sql2); +// } +// endforeach; diff --git a/wms/header.php b/wms/header.php index 92c40db5..2e1f8a8d 100644 --- a/wms/header.php +++ b/wms/header.php @@ -7,6 +7,18 @@ // $maintenancePage = new MaintenancePage($maintenancePeriod); // $maintenancePage->displayPage(); +function CreateToken($user_id, $user_name) { + date_default_timezone_set("Asia/Taipei"); + $start_time = date("Y-m-d H:i:s"); + $end_time = date('Y-m-d H:i:s',strtotime('+24 hour')); #设定24小时 + $info = $user_id . '.' . base64_encode(urlencode($user_name)) . '.' . $start_time . '.' . $end_time; //设置token过期时间为一天 + $encryption_code = "MASADA!^***"; + //根据以上信息信息生成签名(密钥为 SIGNATURE 自定义全局常量) + $signature = hash_hmac('md5', $info, $encryption_code); + //最后将这两部分拼接起来,得到最终的Token字符串 + return $token = $info . '.' . $signature; +} + require_once dirname(__FILE__) . "/../mkt/database.php"; include "fun_global.php"; @@ -21,7 +33,7 @@ if (isset($_REQUEST["function_name"])) { * 連線T8 MSSQL */ try { - $conn = new PDO("sqlsrv:Server=60.244.87.101;Database=T8MASADA", "masada", "@m222222"); + $conn = new PDO("sqlsrv:Server=10.10.145.2;Database=T8MASADA", "masada", "@m222222"); if ($conn) { $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } @@ -42,12 +54,20 @@ try { * $user_auth 使用權限:1,2,3 *****************************/ $token = $_REQUEST["token"]; -$token_link = "token=" . $_REQUEST["token"]; -list($user_id, $enc_user_name, $login_dt) = explode(".", $token); -$user_name = urldecode(base64_decode($enc_user_name)); -$user_id = !empty($_GET["employee_no"]) ? $_GET["employee_no"] : $user_id; -$login_dt = !empty($_GET["timestamp"]) ? $_GET["timestamp"] : $login_dt; +if (count(explode(".", $token)) > 1) { + $token_link = "token=" . $_REQUEST["token"]; + list($user_id, $enc_user_name, $login_dt) = explode(".", $token); + $user_name = urldecode(base64_decode($enc_user_name)); +} else { + $user_id = !empty($_GET["employee_no"]) ? $_GET["employee_no"] : $user_id; + $login_dt = !empty($_GET["timestamp"]) ? substr($_GET["timestamp"], 0, 10) : $login_dt; + $login_dt = date('Y-m-d H:i:s', $login_dt); + $user_name = accountid2name()[$user_id]; + $token = CreateToken($user_id,$user_name); + $token_link = "token=" . $token; +} + include 'IncludeCommon.php'; $includecommon = new IncludeCommon(); @@ -64,6 +84,8 @@ if (strlen($accounttype) != 0) { $v) { + // $$k = htmlspecialchars(stripslashes(trim($v))); + // } + if (!empty($_POST['can_read'])) { $auth_change_status = true; $link_content = explode("\r\n", $_POST['link_content']); @@ -129,10 +133,21 @@ if (isset($_POST['update'])) { } } } + $main_menu_seq = empty($_POST['main_menu_seq']) ? '' : $_POST['main_menu_seq']; + $main_menu = empty($_POST['main_menu']) ? '' : $_POST['main_menu']; + $sub_menu_seq = empty($_POST['sub_menu_seq']) ? '' : $_POST['sub_menu_seq']; + $sub_menu = empty($_POST['sub_menu']) ? '' : $_POST['sub_menu']; + $sub_menu_eng = empty($_POST['sub_menu_eng']) ? '' : $_POST['sub_menu_eng']; + $mlink = empty($_POST['mlink']) ? '' : $_POST['mlink']; + $link_content = empty($_POST['link_content']) ? '' : $_POST['link_content']; + $status = empty($_POST['status']) ? '' : $_POST['status']; + $id = empty($_POST['id']) ? '' : $_POST['id']; + $create_at = date('Y-m-d H:i:s'); //$link_content = str_replace(PHP_EOL, ',', $link_content); $db_query = "UPDATE menu set main_menu_seq = '$main_menu_seq', main_menu = '$main_menu', sub_menu_seq = '$sub_menu_seq', sub_menu = '$sub_menu', "; $db_query .= "sub_menu_eng = '$sub_menu_eng', mlink = '$mlink', link_content = '$link_content', status = '$status', create_at = '$create_at' WHERE id='$id'"; + mysqli_query($link, $db_query); $affected = mysqli_affected_rows($link); mysqli_close($link); @@ -141,7 +156,7 @@ if (isset($_POST['update'])) { echo "alert('update成功');"; echo "location.href='menu-index.php?function_name=menu&" . $token_link . "';"; echo ""; - }elseif($auth_change_status == true){ + } elseif ($auth_change_status == true) { echo " + +
+ + + + $data, @@ -272,6 +299,7 @@ mysqli_close($link); $(function() { $(".data_table_div").hide(); showTable(sheetNum); + document.getElementById('loadingOverlay').classList.add('hidden'); }) const formData = new FormData(); @@ -368,6 +396,7 @@ mysqli_close($link); } function showTable(code) { + console.log(code); var tmp_arr = { "All": "1", "A": "2", @@ -376,8 +405,8 @@ mysqli_close($link); "CH": "5", "Z": "6", } - $("body > nav.navbar.navbar-tabs > div > ul > li").attr("class", ""); - $("body > nav.navbar.navbar-tabs > div > ul > li:nth-child(" + tmp_arr[code] + ")").attr("class", "active"); + $("nav.navbar.navbar-tabs div > ul > li").attr("class", ""); + $("nav.navbar.navbar-tabs div > ul > li:nth-child(" + tmp_arr[code] + ")").attr("class", "active"); $(".data_table_div").hide(); $("#data_" + code + "_table_div").show(); } @@ -503,6 +532,22 @@ mysqli_close($link); $("#del_form").submit(); } + +
diff --git a/wms/wipwhole-rec-invoice-edit-fileupload.php b/wms/wipwhole-rec-invoice-edit-fileupload.php index 98acc091..82f3cb93 100644 --- a/wms/wipwhole-rec-invoice-edit-fileupload.php +++ b/wms/wipwhole-rec-invoice-edit-fileupload.php @@ -67,3 +67,5 @@ $completion_acceptance_file = fileIUpload("completion_acceptance_file"); $shengguanok_status_file = fileIUpload("shengguanok_status_file"); // 工務助理 $outsourcer_contract_file = fileIUploads("outsourcer_contract_file"); +// 品證 +$official_check_file = fileIUpload("official_check_file"); \ No newline at end of file diff --git a/wms/wipwhole-rec-invoice-edit-submit.php b/wms/wipwhole-rec-invoice-edit-submit.php index 0412cc22..1de98846 100644 --- a/wms/wipwhole-rec-invoice-edit-submit.php +++ b/wms/wipwhole-rec-invoice-edit-submit.php @@ -1,5 +1,5 @@ $v) { $$k = htmlspecialchars(stripslashes(trim($v))); } + $id = empty($_POST['id']) ? null : $_POST['id']; // 檢查簽核狀態 - if (checkWwsAssianStatus($link, $user_id)) { + if (checkWwsAssianStatus($link, $user_id, $id)) { echo " 退回至工務階段"); + $mail_title = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-退回至工務階段"; + $mail_content = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-退回至工務階段"; + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$data['gongwokname'], $data['gongwokmail']], + ], + "永佳捷科技" + ); do_wws_next_assign(getGongWuokNo($link), $form_key, 'A'); } } @@ -899,7 +963,22 @@ function backMarketingSssign($link, $salesid, $user_id) if (isset($_GET['id']) || isset($_GET['form_key'])) { $id = isset($_GET['id']) ? $_GET['id'] : getId($link, $_GET['form_key']); $form_key = isset($_GET['form_key']) ? $_GET['form_key'] : getForm_key($link, $id); + include "./class/Cmail.php"; + $cmail = new Cmail(); + $data = getWipwholestatusDetail($link, $id); + $data['salesname'] = accountid2name($data['salesid'])[$data['salesid']]; + $data['salesmail'] = accountid2email([$data['salesid']])[$data['salesid']]; write_note($link, $id, $user_id, "退回至營業階段"); + $mail_title = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-退回營業階段"; + $mail_content = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-退回營業階段"; + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$data['salesname'], $data['salesmail']], + ], + "永佳捷科技" + ); do_wws_next_assign($salesid, $form_key, 'B'); } } @@ -910,7 +989,22 @@ function backDesignssign($link, $user_id) if (isset($_GET['id']) || isset($_GET['form_key'])) { $id = isset($_GET['id']) ? $_GET['id'] : getId($link, $_GET['form_key']); $form_key = isset($_GET['form_key']) ? $_GET['form_key'] : getForm_key($link, $id); + include "./class/Cmail.php"; + $cmail = new Cmail(); + $data = getWipwholestatusDetail($link, $id); + $data['designname'] = accountid2name("M0173")["M0173"]; + $data['designmail'] = accountid2email(["M0173"])["M0173"]; write_note($link, $id, $user_id, "退回至設計階段"); + $mail_title = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-退回設計階段"; + $mail_content = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-退回設計階段"; + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$data['designname'], $data['designmail']], + ], + "永佳捷科技" + ); do_wws_next_assign("M0173", $form_key, 'C'); } } @@ -927,43 +1021,172 @@ function write_note($link, $id, $user_id, $content) mysqli_query($link, $updatesql); } +// 各區營銷(契約)經理判斷程式 +function checkUseridIsManager($user_id) +{ + // 北區 劉永德 + if (in_array($user_id, ['M0137'])) + return true; + // 中區 李烘銘 + if (in_array($user_id, ['M0086'])) + return true; + // 桃竹 張莉凱 + if (in_array($user_id, ['M0026'])) + return true; + // 宜花東 陳志文 + if (in_array($user_id, ['M0054'])) + return true; + // 南區 吳育宗 + if (in_array($user_id, ['M0033'])) + return true; + return false; +} + // 表單簽核狀態檢查主程式 function checkWwsAssianStatus($link, $user_id) { + if (isset($_GET['id']) || isset($_GET['form_key'])) { $id = isset($_GET['id']) ? $_GET['id'] : getId($link, $_GET['form_key']); $form_key = isset($_GET['form_key']) ? $_GET['form_key'] : getForm_key($link, $id); } + include "./class/Cmail.php"; + $cmail = new Cmail(); + $data = getWipwholestatusDetail($link, $id); + $data['salesname'] = accountid2name($data['salesid'])[$data['salesid']]; + $data['salesmail'] = accountid2email([$data['salesid']])[$data['salesid']]; + $data['salesmanagername'] = accountid2name(manage_class($data['salesid'])[0])[manage_class($data['salesid'])[0]]; + $data['salesmanagermail'] = accountid2email([manage_class($data['salesid'])[0]])[manage_class($data['salesid'])[0]]; + $data['designname'] = accountid2name("M0173")["M0173"]; + $data['designmail'] = accountid2email(["M0173"])["M0173"]; + $data['designleadername'] = accountid2name(getSheJiokLeaderNo($link))[getSheJiokLeaderNo($link)]; + $data['designleadermail'] = accountid2email([getSheJiokLeaderNo($link)])[getSheJiokLeaderNo($link)]; + $data['gongwokname'] = accountid2name(getGongWuokNo($link))[getGongWuokNo($link)]; + $data['gongwokmail'] = accountid2email([getGongWuokNo($link)])[getGongWuokNo($link)]; + $data['shengguanokname'] = accountid2name(getShengGuanokLeaderNo($link))[getShengGuanokLeaderNo($link)]; + $data['shengguanokmail'] = accountid2email([getShengGuanokLeaderNo($link)])[getShengGuanokLeaderNo($link)]; + // 確認工務階段 進入營業階段 if (checkNowFormStatus($link) == 'A' && checkGongWuok($link, $id) == '0') { write_note($link, $id, $user_id, "工務提交至營業階段"); + $mail_title = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-工務提交至營業階段"; + $mail_content = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-工務提交至營業階段"; + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$data['salesname'], $data['salesmail']], + [$data['gongwokname'], $data['gongwokmail']] + ], + "永佳捷科技" + ); do_wws_next_assign(getYingYeokNo($link), $form_key, 'B'); return; } // 確認營業階段 進入設計人員(汰改:林坤翰 M0052 改 林昭翰 M0173)階段 if (checkNowFormStatus($link) == 'B' && checkYingYeok($link, $id) == '0') { - write_note($link, $id, $user_id, "營業提交至設計階段"); - do_wws_next_assign("M0173", $form_key, 'C'); - return; + if (checkUseridIsManager($user_id)) { + write_note($link, $id, $user_id, "營業提交至設計階段"); + $mail_title = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-營業提交至設計階段"; + $mail_content = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-營業提交至設計階段"; + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$data['salesname'], $data['salesmail']], + [$data['designname'], $data['designmail']] + ], + "永佳捷科技" + ); + do_wws_next_assign("M0173", $form_key, 'C'); + return; + } else { + write_note($link, $id, $user_id, "營業提交至營業經理階段"); + $mail_title = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-營業提交至營業經理階段"; + $mail_content = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-營業提交至營業經理階段"; + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$data['salesname'], $data['salesmail']], + [$data['salesmanagername'], $data['salesmanagermail']] + ], + "永佳捷科技" + ); + do_wws_next_assign(manage_class($data['salesid'])[0], $form_key, 'F'); + } } + + // 確認營業主管階段 進入設計人員(新梯:郭承瑋 M0023)階段 + if (checkNowFormStatus($link) == 'F' && checkYingYeok($link, $id) == '0') { + if (checkUseridIsManager($user_id)) { + write_note($link, $id, $user_id, "營業經理提交至設計階段"); + $mail_title = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-營業經理提交至設計階段"; + $mail_content = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-營業經理提交至設計階段"; + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$data['salesname'], $data['salesmail']], + [$data['designname'], $data['designmail']] + ], + "永佳捷科技" + ); + do_wws_next_assign("M0173", $form_YD_key, 'C'); + return true; + } + } + // 確認設計人員(汰改:林坤翰 M0052 改 林昭翰 M0173)階段 進入設計主管階段 if (checkNowFormStatus($link) == 'C' && checkSheJiok($link, $id) == '0') { write_note($link, $id, $user_id, "設計提交至設計主管階段"); + $mail_title = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-設計提交至設計主管階段"; + $mail_content = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-設計提交至設計主管階段"; + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$data['designleadername'], $data['designleadermail']], + [$data['designname'], $data['designmail']] + ], + "永佳捷科技" + ); do_wws_next_assign(getSheJiokLeaderNo($link), $form_key, 'D'); return; } // 確認設計主管(江京鴻 M0019)階段 進入生管階段 if (checkNowFormStatus($link) == 'D' && checkSheJiokLeader($link, $id) == '0') { write_note($link, $id, $user_id, "設計主管提交至生管階段"); + $mail_title = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-設計提交至設計主管階段"; + $mail_content = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-設計提交至設計主管階段"; + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$data['designleadername'], $data['designleadermail']], + [$data['shengguanname'], $data['shengguanmail']] + ], + "永佳捷科技" + ); do_wws_next_assign(getShengGuanokLeaderNo($link), $form_key, 'E'); return; } // 確認生管階段(營業部及設計部) 結束簽核流程 if (checkNowFormStatus($link) == 'E' && checkShengGuanok($link, $id) == '0') { - write_note($link, $id, $user_id, "進入結案階段"); + write_note($link, $id, $user_id, "進入生產結案階段"); + $mail_title = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-進入生產結案階段"; + $mail_content = "作番大日程(汰改)合約號:" . $data['contractno'] . "作番號:" . $data['facilityno'] . "-進入生產結案階段"; + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$data['shengguanname'], $data['shengguanmail']] + ], + "永佳捷科技" + ); do_wws_next_assign('00000', $form_key, 'Z'); return; } diff --git a/wms/wipwhole-renovate-rec-invoice-edit.php b/wms/wipwhole-renovate-rec-invoice-edit.php index 9b9757fb..2fde966b 100644 --- a/wms/wipwhole-renovate-rec-invoice-edit.php +++ b/wms/wipwhole-renovate-rec-invoice-edit.php @@ -5,8 +5,9 @@ * 1. A:工務組長確認中 生管建立大日程 (或是系統洗入) * 工務:宜蘭=高培軒(M0087) 北=吳宗紘(M0040) 中=林瑋隆(M0113) 南=韋宗榮(M0039)改鄭存邑(M0102) * 2. B:營業員確認中 + * 3. F:營業員主管確認中 * 3. C:設計部門確認中 (郭承瑋) - * 4. D:設計部門主管確認中 (N0019江京鴻) + * 4. D:設計部門主管確認中 (M0019江京鴻) * 5. E:生管確認中 (M0024伃廷) * 6. Z:本單結案 (00000) */ @@ -232,6 +233,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; $assign_status = array( 'A' => '工務確認中', 'B' => '工務部門已確認
營業部門確認中', + 'F' => '營業部門已確認
營業主管確認中', 'C' => '營業部門已確認
設計部門確認中', 'D' => '設計部門已確認
設計部門主管確認中', 'E' => '營業部門主管已確認
生管部門確認中', @@ -377,31 +379,31 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
(意匠圖) "; - echo "申請上傳"; - } else { - if (in_array($row2['change_status'], ['A', 'B', 'D'])) { - echo "
"; - echo "客戶姓名:" . $row2['custom_name'] . "
狀態:審核中
"; - } - if ($row2['change_status'] == 'C') { - echo "
"; - echo "客戶姓名:" . $row2['custom_name'] . "
狀態:已取消
"; - } - if ($row2['change_status'] == 'Z') { - echo "
"; - echo "客戶姓名:" . $row2['custom_name'] . "
狀態:審核通過
"; - } - } + // $result2 = getWipwholeChangePlanningCustomerDetailsStatus($link, $id); + // $row2 = mysqli_fetch_assoc($result2); + // if (empty($row2['change_status'])) { + // $show_tmp_arr = [ + // '311', '312', '313', '314', '315', + // '501', '511', '512', '513', '514', + // '220', '320' + // ]; + // if (in_array($user_department_id, $show_tmp_arr)) + // echo "
"; + // echo "申請上傳"; + // } else { + // if (in_array($row2['change_status'], ['A', 'B', 'D'])) { + // echo "
"; + // echo "客戶姓名:" . $row2['custom_name'] . "
狀態:審核中
"; + // } + // if ($row2['change_status'] == 'C') { + // echo "
"; + // echo "客戶姓名:" . $row2['custom_name'] . "
狀態:已取消
"; + // } + // if ($row2['change_status'] == 'Z') { + // echo "
"; + // echo "客戶姓名:" . $row2['custom_name'] . "
狀態:審核通過
"; + // } + // } ?> @@ -414,13 +416,9 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 附件 - > + 客戶姓名:" placeholder="輸入後即可上傳附件" /> +
+ 下載附件" : ""; ?> @@ -713,12 +711,22 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; - + + + + + 若無工勘資料請勿移交至設計階段! @@ -1249,12 +1257,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; QC及官檢類型 - /> - - /> - - /> - + /> + + /> + + /> + @@ -1345,6 +1353,96 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; (工務助理項目) + + + QC及官檢類型 + + /> + + /> + + /> + + + + + 內部QC日 + +
+ > + + + +
+ + 確認人 + + + + + + QC合格日 + +
+ > + + + +
+ + 確認人 + + + + + + 官檢日 + +
+ > + > + + + +
+ + 確認人 + + + + + + 移交日 + +
+ > + + + +
+ + 確認人 + + + + + 發包類型 @@ -1518,6 +1616,84 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; + + + 實際安裝開工日 + +
+ > + + + +
+ + 確認人 + + + + + + 實際安裝完工日 + +
+ > + + + +
+ + 確認人 + + + + + + 實際試車開工日 + +
+ > + + + +
+ + 確認人 + + + + + + 實際試車完工日 + +
+ > + + + +
+ + 確認人 + + + + + 備註 @@ -1556,15 +1732,19 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
+
+
+
+
@@ -1628,7 +1808,34 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; $('#renovate_type').select2(); $("#renovate_type").val(jsonData).trigger("change"); $('#site_survey_contact_verify').select2(); + checkCustomerPlanningVerifyFileKeyinStatus(); + checkDeliveryDateKeyinStatus(); }); + + function checkCustomerPlanningVerifyFileKeyinStatus() { + checkCustomerPlanningVerifyFileDisabled(); + $("#real_custom_name").keyup(function() { + checkCustomerPlanningVerifyFileDisabled(); + }); + } + + function checkCustomerPlanningVerifyFileDisabled() { + if ($("#real_custom_name").val() !== "") { + $("#customer_planning_verify_file").prop("disabled", false); + } else { + $("#customer_planning_verify_file").prop("disabled", true); + } + } + + function checkDeliveryDateKeyinStatus() { + $("#delivery_date").prop("disabled", true); + if ($("#end_qc_date").val() !== "") { + $("#delivery_date").prop("disabled", false); + } + if ($("#official_check_date").val() !== "") { + $("#delivery_date").prop("disabled", false); + } + } $(function() { var tab = $('#tab').val(); $("#tabs").tabs({ @@ -1652,7 +1859,15 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 'qc_date', 'end_qc_date', 'official_check_date', - 'delivery_date' + 'delivery_date', + 'qc_date2', + 'end_qc_date2', + 'official_check_date2', + 'delivery_date2', + 'install_start_date2', + 'install_end_date2', + 'tryrun_start_date2', + 'tryrun_end_date2', ] for (var i = 0; i < catchTime_input_arr.length; i++) { inputChangeCatchTime(catchTime_input_arr[i]); diff --git a/wms/wipwhole-renovate-rec-invoice.php b/wms/wipwhole-renovate-rec-invoice.php index 601026c8..12f9b99a 100644 --- a/wms/wipwhole-renovate-rec-invoice.php +++ b/wms/wipwhole-renovate-rec-invoice.php @@ -41,6 +41,7 @@ if ($department_id == "321" || $department_id == "220") { COUNT(*) FROM wipwholestatus WHERE facilityno = '$facilityno' + AND status = '1' "; $result = mysqli_query($link, $sql); $row = mysqli_fetch_array($result);