From 629f228d9763d2a3d7dc20bd590b93b336dbd3ce Mon Sep 17 00:00:00 2001 From: "gary_chen\\gary_chen" Date: Fri, 5 Jan 2024 15:52:23 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/T8_APItest_from_bpm.php | 2 +- wms/frame/api_getdata.php | 6 +- wms/frame/notice.php | 1 + wms/fun_global.php | 25 + wms/ngfeedback-index.php | 2 +- wms/notice-delete-all.php | 13 + wms/notice-edit.php | 76 +-- wms/notice-index.php | 169 +++--- wms/schedule-index.php | 363 ++++++------- wms/wipwhole-index-export-excel.php | 3 +- wms/wipwhole-index-function.php | 6 +- wms/wipwhole-index-table-html.php | 8 +- wms/wipwhole-index.php | 76 +-- wms/wipwhole-rec-invoice-edit-submit.php | 77 ++- wms/wipwhole-rec-invoice-edit.php | 106 ++++ wms/wipwhole-rec-invoice.php | 251 ++------- wms/wipwhole-renovate-index-export-excel.php | 21 +- wms/wipwhole-renovate-index-function.php | 33 +- wms/wipwhole-renovate-index-table-html.php | 18 +- wms/wipwhole-renovate-index.php | 16 +- ...whole-renovate-rec-invoice-edit-submit.php | 74 ++- wms/wipwhole-renovate-rec-invoice-edit.php | 482 +++++++++++++++--- wms/wipwhole-renovate-rec-invoice.php | 270 ++-------- wms/wipwholeinstall-index-function.php | 4 +- ...ipwholeinstall-renovate-index-function.php | 4 +- 25 files changed, 1215 insertions(+), 891 deletions(-) create mode 100644 wms/notice-delete-all.php diff --git a/wms/T8_APItest_from_bpm.php b/wms/T8_APItest_from_bpm.php index db6d10a5..c0aef33d 100644 --- a/wms/T8_APItest_from_bpm.php +++ b/wms/T8_APItest_from_bpm.php @@ -23,7 +23,7 @@ if ($hashReferer == $referrer) { function send_data_to_API($validation) { // $apiurl = 'http://60.244.87.101:880//twWebAPI/V1/STKASSY/PostERPData'; - $apiurl = 'http://10.10.145.2:880//twWebAPI/V1/STKASSY/PostERPData'; + $apiurl = 'http://10.10.145.2:880/twWebAPI/V1/STKASSY/PostERPData'; // $apiurl = 'https://erp.masada.com.tw:780/twWebAPI/V1/STKASSY/PostERPData'; $headerParam = [ diff --git a/wms/frame/api_getdata.php b/wms/frame/api_getdata.php index 3c0c1af6..18651006 100644 --- a/wms/frame/api_getdata.php +++ b/wms/frame/api_getdata.php @@ -81,7 +81,11 @@ function get_notice($token) $i = 1; $data = []; $sql = "select id, kind, related_id, title from notice "; - $sql .= "where (permission like '%" . $user_id . "%' or permission = 'ALL' or creater = '$user_id') "; + $sql .= "where ( + permission like '%" . $user_id . "%' + or permission = 'ALL' + -- or creater = '$user_id') + "; $sql .= "and (haveread != '1' or haveread is null) "; $sql .= "order by id desc limit 0, 6"; $res = mysqli_query($link, $sql); diff --git a/wms/frame/notice.php b/wms/frame/notice.php index c96356d0..1b8c2e41 100644 --- a/wms/frame/notice.php +++ b/wms/frame/notice.php @@ -61,6 +61,7 @@ h5 a {
系統通知
+ 全部已讀
Loading... diff --git a/wms/fun_global.php b/wms/fun_global.php index 5e735cd9..48efb4e5 100644 --- a/wms/fun_global.php +++ b/wms/fun_global.php @@ -157,6 +157,8 @@ function check_user_permission($user_id, $token) '/wms/index.php', '/wms/notice-index.php', '/wms/notice-edit.php', + '/wms/notice-delete.php', + '/wms/notice-delete-all.php', '/wms/change-password.php', '/wms/wipwhole-change-contractdate.php', '/wms/wipwhole-change-planning-customer-name.php', @@ -599,3 +601,26 @@ function getAccounttype($link, $user_id) $row = mysqli_fetch_array($data, MYSQLI_ASSOC); return $row['accounttype']; } + +/** + * 算催收月份 + * @param int $contractday + * @return int $month + */ +function collect_month($contractday) +{ + $today_date = new DateTime(date('Y-m-d', strtotime('-1 month', strtotime(date('Y-m-d'))))); + $latest_timestamp = $contractday; + $latest_date = new DateTime(); + $latest_date->setTimestamp($latest_timestamp); + if ($latest_timestamp < $today_date->getTimestamp()) { + $interval = $latest_date->diff($today_date); + $interval2 = $latest_date->diff($today_date); + $year = $interval2->format('%y'); + $month = $interval->format('%m'); + $total_month = $year * 12 + $month; + return $total_month; + } else { + return 0; + } +} diff --git a/wms/ngfeedback-index.php b/wms/ngfeedback-index.php index d3348692..2e1769e1 100644 --- a/wms/ngfeedback-index.php +++ b/wms/ngfeedback-index.php @@ -191,7 +191,7 @@ $sql = " f_return_department_name(responsibledepartment) as responsibledepartment_name from ngfeedback "; -if(accountidToDepartId($user_id !== '912')){ +if(accountidToDepartId($user_id) !== '912'){ $sql .= sql_myself($user_id); } diff --git a/wms/notice-delete-all.php b/wms/notice-delete-all.php new file mode 100644 index 00000000..eee49bc4 --- /dev/null +++ b/wms/notice-delete-all.php @@ -0,0 +1,13 @@ + + diff --git a/wms/notice-edit.php b/wms/notice-edit.php index 20c30215..d6606c76 100644 --- a/wms/notice-edit.php +++ b/wms/notice-edit.php @@ -1,45 +1,53 @@ - - -
-
-
- - -
-
-
-
- -
-
-
-
- -
- -
-
+ + +
+
+
+ + +
+
+
+
+ +
+
+
+
+ +
+ +
+
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
項次類別標題內容確認建檔人建檔時間
- -
-
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
項次類別標題內容確認已讀建檔人建檔時間
+ + + +
+
+ There is no record!"; endif; @@ -102,4 +127,4 @@ endif; mysqli_close($link); include "footer.php"; -?> +?> \ No newline at end of file diff --git a/wms/schedule-index.php b/wms/schedule-index.php index 09b3660a..2d7ffff1 100644 --- a/wms/schedule-index.php +++ b/wms/schedule-index.php @@ -1,7 +1,7 @@ - -

- - - -

+ +

+ + + +

Please fill up the required field!

"; } else { header("Location:schedule-index.php"); @@ -72,77 +72,82 @@ if($data): ?> - - + #status { + /* 這是中間loading的gif坐標css,我們盡量讓他畫面置中 */ + position: fixed; + width: 218px; + height: 419px; + margin-left: -140px; + margin-top: -160px; + left: 50%; + top: 50%; + } + +
-
+ @@ -161,116 +166,118 @@ $(function(){
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
項次合約號作番號保養套餐編號保養人員工號保養人員姓名應保養日期實際保養日期保養項目編號保養項目內容保養結果上傳照片說明客戶評價登入帳號客戶姓名評價/保養品質評價/服務態度內容簽名檔建檔人建檔時間修改刪除
瀏覽"; } ?> - - - - -

- - - -

-
-

- - - -

-
項次合約號作番號保養套餐編號保養人員工號保養人員姓名應保養日期實際保養日期保養項目編號保養項目內容保養結果上傳照片說明客戶評價登入帳號客戶姓名評價/保養品質評價/服務態度內容簽名檔建檔人建檔時間修改刪除
瀏覽"; + } ?> + + + + +

+ + + +

+
+

+ + + +

+
- + There is no record!"; endif; @@ -279,4 +286,4 @@ mysqli_close($link); include "footer.php"; -?> +?> \ No newline at end of file diff --git a/wms/wipwhole-index-export-excel.php b/wms/wipwhole-index-export-excel.php index 18995853..ae01fa9d 100644 --- a/wms/wipwhole-index-export-excel.php +++ b/wms/wipwhole-index-export-excel.php @@ -328,7 +328,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { substr($row['desin_style_verify_at'], 0, 10), $desin_leader_verify_status, substr($row['desin_leader_verify_at'], 0, 10), - getGunwuName($row['address']) . $gongwuok . "/2", + // getGunwuName($row['address']) . $gongwuok . "/2", + accountidToName($row['warehouseid']) . $gongwuok . "/2", $dbuilding_heigh_verify_status, substr($row['building_heigh_verify_at'], 0, 10), $site_survey_contact_verify_status, diff --git a/wms/wipwhole-index-function.php b/wms/wipwhole-index-function.php index 66117b58..8f888c75 100644 --- a/wms/wipwhole-index-function.php +++ b/wms/wipwhole-index-function.php @@ -1091,10 +1091,10 @@ function getTabNo($user_department_id) // 由地址取得工務負責人 function getGunwuName($address) { - $north_arr = array('台北', '基隆', '新北', '桃園', '新竹', '台東', '花蓮'); + $north_arr = array('台北', '基隆', '新北', '桃園', '新竹', '花蓮'); $north_arr2 = array('宜蘭'); $center_arr = array('南投', '彰化', '雲林', '台中', '苗栗'); - $south_arr = array('台南', '嘉義', '屏東', '高雄'); + $south_arr = array('台南', '嘉義', '屏東', '高雄', '台東'); foreach ($north_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) return "張潘榮"; @@ -1103,7 +1103,7 @@ function getGunwuName($address) return "高培軒"; foreach ($center_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) - return "林瑋隆"; + return "劉子睿"; foreach ($south_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) return "鄭存邑"; diff --git a/wms/wipwhole-index-table-html.php b/wms/wipwhole-index-table-html.php index 4572b2cc..29c310d6 100644 --- a/wms/wipwhole-index-table-html.php +++ b/wms/wipwhole-index-table-html.php @@ -12,6 +12,7 @@ if (in_array($user_id, ['M0175', 'M0079'])) { 刪除" : ""; ?> + 序號 合約號 電梯編號 客戶姓名 @@ -104,6 +105,7 @@ if (in_array($user_id, ['M0175', 'M0079'])) { ?> " : ""; ?> +

diff --git a/wms/wipwhole-index.php b/wms/wipwhole-index.php index 29de7c05..eca84741 100644 --- a/wms/wipwhole-index.php +++ b/wms/wipwhole-index.php @@ -35,7 +35,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $form_name = empty($_REQUEST['form_name']) ? null : $_REQUEST['form_name']; $del_seq = empty($_REQUEST['del_seq']) ? null : $_REQUEST['del_seq']; if ($form_name == 'del_form') { - $sql = "UPDATE wipwholestatus SET status = '0' WHERE id = '$del_seq' "; + $sql = "UPDATE wipwholestatus SET status = '0' WHERE id = '$del_seq' "; + mysqli_query($link, $sql); + $sql = "UPDATE flow set flow_code = 'Z' where form_id = '$del_seq' and flow_id = 'wws01' "; mysqli_query($link, $sql); } } @@ -461,39 +463,40 @@ mysqli_close($link); } $('#table_index2').DataTable({ - scrollX: true, - fixedHeader: true, - scrollY: 500, - "language": { - "emptyTable": "無資料...", - "processing": "處理中...", - "loadingRecords": "載入中...", - "lengthMenu": "顯示_MENU_ 筆", - "zeroRecords": "沒有符合的結果", - "info": "第 _START_ 至 _END_ 項,共 _TOTAL_ 項", - "infoEmpty": "第 0 至 0 項,共 0 項", - "infoFiltered": "(從 _MAX_ 項結果中過濾)", - "infoPostFix": "", - "search": "", - "paginate": { - "first": "第一頁", - "previous": "上一頁", - "next": "下一頁", - "last": "最後一頁" - }, - "aria": { - "sortAscending": ": 升冪排列", - "sortDescending": ": 降冪排列" - } + fixedColumns: { + leftColumns: 4 + }, + scrollX: true, + fixedHeader: true, + scrollY: 500, + "language": { + "emptyTable": "無資料...", + "processing": "處理中...", + "loadingRecords": "載入中...", + "lengthMenu": "顯示_MENU_ 筆", + "zeroRecords": "沒有符合的結果", + "info": "第 _START_ 至 _END_ 項,共 _TOTAL_ 項", + "infoEmpty": "第 0 至 0 項,共 0 項", + "infoFiltered": "(從 _MAX_ 項結果中過濾)", + "infoPostFix": "", + "search": "", + "paginate": { + "first": "第一頁", + "previous": "上一頁", + "next": "下一頁", + "last": "最後一頁" + }, + "aria": { + "sortAscending": ": 升冪排列", + "sortDescending": ": 降冪排列" } - }, { - "order": [ - [4, "desc"], - [8, "asc"] - ] } - - ); + }, { + "order": [ + [4, "desc"], + [8, "asc"] + ] + }); document.querySelector("#table_index2_filter > label > input").placeholder = "快速搜尋"; // datatable 畫面重整後保留資料 @@ -582,4 +585,11 @@ mysqli_close($link);
-
\ No newline at end of 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 7fa7d17b..69a9eaa0 100644 --- a/wms/wipwhole-rec-invoice-edit-submit.php +++ b/wms/wipwhole-rec-invoice-edit-submit.php @@ -107,6 +107,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $old_official_check_date = $_POST['old_official_check_date'] ?: $row['old_official_check_date']; $official_check_date_owner = $_POST['official_check_date_owner'] ?: $row['official_check_date_owner']; $delivery_date = $_POST['delivery_date'] ?: $row['delivery_date']; + $old_delivery_date = $_POST['old_delivery_date'] ?: $row['old_delivery_date']; $delivery_date_owner = $_POST['delivery_date_owner'] ?: $row['delivery_date_owner']; $qc_official_type = $_POST['qc_official_type'] ?: $row['qc_official_type']; $outsourcer_type = $_POST['outsourcer_type']; @@ -128,6 +129,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner']; $warehouse_assistant_remark = $_POST['warehouse_assistant_remark']; + $warehouseid = $_POST['warehouseid'] ?: $row['warehouseid']; + $old_warehouseid = $_POST['old_warehouseid'] ?: $row['warehouseid']; + // $creater = $_POST['creater']; $creater = $user_id; $create_at = date("Y-m-d H:i:s"); @@ -135,6 +139,33 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { // 上傳附件 include "wipwhole-rec-invoice-edit-fileupload.php"; + // 指派工勘人員 + if ($warehouseid !== $old_warehouseid) { + if (checkNowFormGStatus($link) == 'G') { + $sql = "SELECT form_key FROM flow + WHERE form_id = '$id' + AND flow_id = 'wws01' + AND flow_code = 'G' + "; + $result = mysqli_query($link, $sql); + $form_key = $result->fetch_row()[0]; + if (!empty($form_key)) { + $sql = "UPDATE wipwholestatus + SET warehouseid = '$warehouseid' + WHERE id = '$id'; + "; + mysqli_query($link, $sql); + $sql = "UPDATE subflow + SET current_assigner = '$warehouseid' + WHERE 1 = 1 + AND seq = '1' + AND form_key = '$form_key'; + "; + mysqli_query($link, $sql); + } + } + } + // 工勘變更通知繪圖人員 if (!empty($official_check_date)) { if ($official_check_date !== $old_official_check_date) { @@ -234,6 +265,48 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $cn->sendx($data); } + + // 官檢日及移交日通知生管人員 + if (!empty($official_check_date)) { + if ($official_check_date !== $old_official_check_date) { + $permission = "M0168"; + $title = "官檢日變更 客戶:$custom 作番:$facilityno"; + $content = "客戶:$custom + 作番:$facilityno + 官檢日 $old_official_check_date => $official_check_date"; + $data = array( + 'kind' => 1, + 'related_id' => $id, + 'title' => $title, + 'content' => $content, + 'permission' => $permission, + 'creater' => $creater, + 'create_at' => date("Y-m-d H:i:s") + ); + $cn->sendx($data); + } + } + if (!empty($delivery_date)) { + if ($delivery_date !== $old_delivery_date) { + $permission = "M0168"; + $title = "移交日變更 客戶:$custom 作番:$facilityno"; + $content = "客戶:$custom + 作番:$facilityno + 移交日 $old_delivery_date => $delivery_date"; + $data = array( + 'kind' => 1, + 'related_id' => $id, + 'title' => $title, + 'content' => $content, + 'permission' => $permission, + 'creater' => $creater, + 'create_at' => date("Y-m-d H:i:s") + ); + $cn->sendx($data); + } + } + + $updatesql = " UPDATE wipwholestatus SET @@ -262,7 +335,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $updatesql .= "building_heigh_verify_file = '$building_heigh_verify_file', "; if (!empty($site_survey_contact_verify_file)) $updatesql .= "site_survey_contact_verify_file = '$site_survey_contact_verify_file', "; - } else if (in_array($user_department_id, [311, 312, 313, 314, 315])) { + } + + if (in_array($user_department_id, [311, 312, 313, 314, 315])) { // 營業更新; $updatesql .= " sales_spec_verify = '$sales_spec_verify', diff --git a/wms/wipwhole-rec-invoice-edit.php b/wms/wipwhole-rec-invoice-edit.php index 26238879..a8346328 100644 --- a/wms/wipwhole-rec-invoice-edit.php +++ b/wms/wipwhole-rec-invoice-edit.php @@ -505,6 +505,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; +
確認人 @@ -514,6 +515,9 @@ include "wipwhole-rec-invoice-edit-submit.php"; + + 有官檢日或QC合格日後才可填寫 + @@ -793,6 +797,78 @@ include "wipwhole-rec-invoice-edit-submit.php";
+ + + + + + + + + + + + + + + +
工勘人員 + "> + + + + + + + + + + + + + + + +
樓高通報 @@ -1280,6 +1356,36 @@ include "wipwhole-rec-invoice-edit-submit.php";
官檢日 +
+ +
+
確認人 + +
移交日 +
+ +
+
確認人 + +
diff --git a/wms/wipwhole-rec-invoice.php b/wms/wipwhole-rec-invoice.php index c96890f0..d9372d11 100644 --- a/wms/wipwhole-rec-invoice.php +++ b/wms/wipwhole-rec-invoice.php @@ -1,4 +1,5 @@ diff --git a/wms/wipwhole-renovate-index-export-excel.php b/wms/wipwhole-renovate-index-export-excel.php index dd4ec05d..f651773f 100644 --- a/wms/wipwhole-renovate-index-export-excel.php +++ b/wms/wipwhole-renovate-index-export-excel.php @@ -87,11 +87,11 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { '樓高通報日期', '工勘確認', '工勘確認日期', - '客戶計劃圖(意匠圖)', - '客戶計劃圖(意匠圖)日期', '營業/契約確認', '營業/契約規格', '營業/契約規格日期', + '客戶計劃圖(意匠圖)', + '客戶計劃圖(意匠圖)日期', '客戶顏色', '客戶顏色日期', '客戶樣式', @@ -158,8 +158,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $gongwuok += 1; if (!in_array($row['site_survey_contact_verify'], ['1', 'A'])) $gongwuok += 1; - if ($row['customer_planning_verify'] == 0) - $gongwuok += 1; // 營業統計已確認 if ($row['sales_spec_verify'] == 0) @@ -170,6 +168,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $yingyeok += 1; if ($row['site_survey_contact_form_verify'] == 0) $yingyeok += 1; + if ($row['customer_planning_verify'] == 0) + $yingyeok += 1; // 設計統計已確認 if ($row['desin_spec_verify'] == 0) @@ -305,16 +305,17 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { substr($row['estimated_shipping_schedule_date'], 0, 10), substr($row['actual_tofactory_date'], 0, 10), substr($row['real_contract_arrival_date'], 0, 10), - getGunwuName($row['address']) . $gongwuok . "/3", + // getGunwuName($row['address']) . $gongwuok . "/2", + accountidToName($row['warehouseid']) . $gongwuok . "/2", $dbuilding_heigh_verify_status, substr($row['building_heigh_verify_at'], 0, 10), $site_survey_contact_verify_status, substr($row['site_survey_contact_verify_at'], 0, 10), - $customer_planning_verify_status, - substr($row['customer_planning_verify_at'], 0, 10), - accountidToName($row['salesid']) . " " . $yingyeok . "/4", + accountidToName($row['salesid']) . " " . $yingyeok . "/5", $sales_spec_verify_status, substr($row['sales_spec_verify_at'], 0, 10), + $customer_planning_verify_status, + substr($row['customer_planning_verify_at'], 0, 10), $customer_color_verify_status, substr($row['customer_color_verify_at'], 0, 10), $customer_style_verify_status, @@ -364,13 +365,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { ->getStartColor()->setRGB('8EA9DB'); // 背景顏色為橘色 - $styleA1toC1 = $sheet->getStyle('O1:U1'); + $styleA1toC1 = $sheet->getStyle('O1:S1'); $fillA1toC1 = $styleA1toC1->getFill(); $fillA1toC1->setFillType(Fill::FILL_SOLID) ->getStartColor()->setRGB('FFBB66'); // 背景顏色為綠色 - $styleA1toC1 = $sheet->getStyle('V1:AD1'); + $styleA1toC1 = $sheet->getStyle('T1:AD1'); $fillA1toC1 = $styleA1toC1->getFill(); $fillA1toC1->setFillType(Fill::FILL_SOLID) ->getStartColor()->setRGB('DDFF77'); diff --git a/wms/wipwhole-renovate-index-function.php b/wms/wipwhole-renovate-index-function.php index 18eebc0d..7f6c4d0c 100644 --- a/wms/wipwhole-renovate-index-function.php +++ b/wms/wipwhole-renovate-index-function.php @@ -85,7 +85,8 @@ function checkYingYeok($link, $id) CAST(IF(sales_spec_verify != '2',sales_spec_verify,'0') AS SIGNED) + CAST(IF(customer_color_verify != '2',customer_color_verify,'0') AS SIGNED) + CAST(IF(customer_style_verify != '2',customer_style_verify,'0') AS SIGNED) + - CAST(IF(site_survey_contact_form_verify != '2',site_survey_contact_form_verify,'0') AS SIGNED) + CAST(IF(site_survey_contact_form_verify != '2',site_survey_contact_form_verify,'0') AS SIGNED) + + CAST(IF(customer_planning_verify != '2',customer_planning_verify,'0') AS SIGNED) ) AS sum_num FROM wipwholestatus WHERE 1=1 @@ -139,8 +140,7 @@ function checkGongWuok($link, $id) $sql = " SELECT SUM( - CAST(IF(building_heigh_verify != '2',building_heigh_verify,'0') AS SIGNED) + - CAST(IF(customer_planning_verify != '2',customer_planning_verify,'0') AS SIGNED) + CAST(IF(building_heigh_verify != '2',building_heigh_verify,'0') AS SIGNED) ) AS sum_num FROM wipwholestatus WHERE 1=1 @@ -915,10 +915,10 @@ function getDataSqlByflowCode($department_id, $role_id, $user_id, $flow_code) function getGunwuName($address) { - $north_arr = array('台北', '基隆', '新北', '桃園', '新竹', '台東'); + $north_arr = array('台北', '基隆', '新北', '桃園', '新竹'); $north_arr2 = array('宜蘭'); $center_arr = array('南投', '彰化', '雲林', '台中', '苗栗'); - $south_arr = array('台南', '嘉義', '屏東', '高雄'); + $south_arr = array('台南', '嘉義', '屏東', '高雄', '台東'); foreach ($north_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) return "吳宗紘"; @@ -927,7 +927,7 @@ function getGunwuName($address) return "高培軒"; foreach ($center_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) - return "林瑋隆"; + return "劉子睿"; foreach ($south_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) return "鄭存邑"; @@ -1269,3 +1269,24 @@ function getAllCustomerPlanningVerify($link, $id) "; return mysqli_query($link, $sql); } + +// 各區營銷(契約)經理判斷程式 +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; +} \ No newline at end of file diff --git a/wms/wipwhole-renovate-index-table-html.php b/wms/wipwhole-renovate-index-table-html.php index 78f863bc..c861d01f 100644 --- a/wms/wipwhole-renovate-index-table-html.php +++ b/wms/wipwhole-renovate-index-table-html.php @@ -6,12 +6,13 @@ if (in_array($user_id, ['M0175', 'M0079'])) { } ?> - +
刪除" : ""; ?> + @@ -61,8 +62,6 @@ if (in_array($user_id, ['M0175', 'M0079'])) { $data['gongwuok'] += 1; if (!in_array($data['site_survey_contact_verify'], ['1', 'A'])) $data['gongwuok'] += 1; - if ($data['customer_planning_verify'] == 0 || $data['customer_planning_verify'] == 2) - $data['gongwuok'] += 1; // 營業統計已確認 if ($data['sales_spec_verify'] == 0 || $data['sales_spec_verify'] == 2) @@ -73,6 +72,8 @@ if (in_array($user_id, ['M0175', 'M0079'])) { $data['yingyeok'] += 1; if ($data['site_survey_contact_form_verify'] == 0 || $data['site_survey_contact_form_verify'] == 2) $data['yingyeok'] += 1; + if ($data['customer_planning_verify'] == 0 || $data['customer_planning_verify'] == 2) + $data['yingyeok'] += 1; // 設計統計已確認 if ($data['desin_spec_verify'] == 0 || $data['desin_spec_verify'] == 2) @@ -105,6 +106,7 @@ if (in_array($user_id, ['M0175', 'M0079'])) { ?> " : ""; ?> + @@ -1363,6 +1470,96 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; (工務助理項目) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wms/wipwholeinstall-index-function.php b/wms/wipwholeinstall-index-function.php index cd3500c0..292217f3 100644 --- a/wms/wipwholeinstall-index-function.php +++ b/wms/wipwholeinstall-index-function.php @@ -957,7 +957,7 @@ function getGunwuName($address) $north_arr = array('台北', '基隆', '新北', '桃園', '新竹'); $north_arr2 = array('宜蘭'); $center_arr = array('南投', '彰化', '雲林', '台中', '苗栗'); - $south_arr = array('台南', '嘉義', '屏東', '高雄'); + $south_arr = array('台南', '嘉義', '屏東', '高雄', '台東'); foreach ($north_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) return "張潘榮"; @@ -966,7 +966,7 @@ function getGunwuName($address) return "高培軒"; foreach ($center_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) - return "林瑋隆"; + return "劉子睿"; foreach ($south_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) return "鄭存邑"; diff --git a/wms/wipwholeinstall-renovate-index-function.php b/wms/wipwholeinstall-renovate-index-function.php index bf00e7bd..6dc25da3 100644 --- a/wms/wipwholeinstall-renovate-index-function.php +++ b/wms/wipwholeinstall-renovate-index-function.php @@ -978,7 +978,7 @@ function getGunwuName($address) $north_arr = array('台北', '基隆', '新北', '桃園', '新竹'); $north_arr2 = array('宜蘭'); $center_arr = array('南投', '彰化', '雲林', '台中', '苗栗'); - $south_arr = array('台南', '嘉義', '屏東', '高雄'); + $south_arr = array('台南', '嘉義', '屏東', '高雄', '台東'); foreach ($north_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) return "吳宗紘"; @@ -987,7 +987,7 @@ function getGunwuName($address) return "高培軒"; foreach ($center_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) - return "林瑋隆"; + return "劉子睿"; foreach ($south_arr as $key => $value) if (mb_strpos($address, $value, 0, "UTF-8") !== false) return "鄭存邑"; From 0ed07f3d289f350221a61f439f0d64970305d713 Mon Sep 17 00:00:00 2001 From: "gary_chen\\gary_chen" Date: Tue, 9 Jan 2024 08:43:11 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=AC=E5=91=8A?= =?UTF-8?q?=E6=99=82=20=E6=8E=A8=E6=92=AD=E9=80=9A=E7=9F=A5=E7=B5=A6?= =?UTF-8?q?=E5=85=AC=E5=8F=B8=E6=89=80=E6=9C=89=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/board-record-submit.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/wms/board-record-submit.php b/wms/board-record-submit.php index 3a137e14..1127e4dc 100644 --- a/wms/board-record-submit.php +++ b/wms/board-record-submit.php @@ -36,6 +36,30 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $db_query .= "'$title', '$content', '$target_file1', '1', '" . $user_id . "', NOW())"; $result = mysqli_query($link, $db_query); if (mysqli_affected_rows($link) > 0) { + + include "class/Cnotice.php"; + $cn = new Cnotice(); + $sql = " + SELECT accountid + FROM account + WHERE accounttype IN ('B','C','D','E','M','W') + "; + $result = mysqli_query($link, $sql); + foreach ($result as $row) { + $permission = $row["accountid"]; + $data = array( + 'kind' => 1, + 'related_id' => $id, + 'title' => $title, + 'content' => $content, + 'permission' => $permission, + 'creater' => $creater, + 'create_at' => date("Y-m-d H:i:s") + ); + $cn->sendx($data); + } + + echo " \ No newline at end of file diff --git a/wms/wipwholeinstall-index-function.php b/wms/wipwholeinstall-index-function.php index 292217f3..a2b99b11 100644 --- a/wms/wipwholeinstall-index-function.php +++ b/wms/wipwholeinstall-index-function.php @@ -899,11 +899,10 @@ function getMarketingStatus($link, $user_department_id, $role_id) { if ($user_department_id == 220) return ""; - if ($user_department_id == 311 || $user_department_id == 312 || $user_department_id == 313 || $user_department_id == 314 || $user_department_id == 315) + if (in_array($user_department_id, [311, 312, 313, 314, 315])) return checkNowFormYDStatus($link) == 'A' ? "" : "disabled"; - if ($user_department_id == 501 || $user_department_id == 511 || $user_department_id == 512 || $user_department_id == 513 || $user_department_id == 514) + if (in_array($user_department_id, [501, 511, 512, 513, 514, 515])) return checkNowFormYDStatus($link) == 'A' ? "" : "disabled"; - return "disabled"; } diff --git a/wms/wipwholeinstall-renovate-index-function.php b/wms/wipwholeinstall-renovate-index-function.php index 6dc25da3..c8aa2898 100644 --- a/wms/wipwholeinstall-renovate-index-function.php +++ b/wms/wipwholeinstall-renovate-index-function.php @@ -920,11 +920,10 @@ function getMarketingStatus($link, $user_department_id, $role_id) { if ($user_department_id == 220) return ""; - if ($user_department_id == 311 || $user_department_id == 312 || $user_department_id == 313 || $user_department_id == 314 || $user_department_id == 315) + if (in_array($user_department_id, [311, 312, 313, 314, 315])) return checkNowFormYDStatus($link) == 'A' ? "" : "disabled"; - if ($user_department_id == 501 || $user_department_id == 511 || $user_department_id == 512 || $user_department_id == 513 || $user_department_id == 514) + if (in_array($user_department_id, [501, 511, 512, 513, 514, 515])) return checkNowFormYDStatus($link) == 'A' ? "" : "disabled"; - return "disabled"; } From c22e9185470cc1b57694858e6348519bb3531a65 Mon Sep 17 00:00:00 2001 From: "gary_chen\\gary_chen" Date: Tue, 9 Jan 2024 14:36:03 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=98=87=E5=AD=9D=E5=80=AB:=20=E6=B1=9F?= =?UTF-8?q?=E5=8D=94=E7=90=86=E5=A5=BD=EF=BC=9A=E9=BA=BB=E7=85=A9=E8=AB=8B?= =?UTF-8?q?=E9=96=8B=E5=90=84=E5=8D=80=E5=B7=A5=E4=BA=8B=E7=B6=93=E7=90=86?= =?UTF-8?q?=E8=83=BD=E8=BC=B8=E5=85=A5=EF=BC=82=E7=A7=BB=E4=BA=A4=E6=97=A5?= =?UTF-8?q?=EF=BC=82=E7=9A=84=E6=AC=8A=E9=99=90=EF=BC=8C=E9=BA=BB=E7=85=A9?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=BC=B8=E5=85=A5=E5=84=B2=E5=AD=98=E5=BE=8C?= =?UTF-8?q?=E6=9C=89MAIL=E9=80=9A=E7=9F=A5=E7=87=9F=E6=A5=AD=E4=BA=BA?= =?UTF-8?q?=E5=93=A1=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/wipwhole-rec-invoice-edit-submit.php | 84 ++++++++++++++----- wms/wipwhole-rec-invoice-edit.php | 45 ++++++++-- ...whole-renovate-rec-invoice-edit-submit.php | 42 +++++++++- wms/wipwhole-renovate-rec-invoice-edit.php | 45 ++++++++-- 4 files changed, 181 insertions(+), 35 deletions(-) diff --git a/wms/wipwhole-rec-invoice-edit-submit.php b/wms/wipwhole-rec-invoice-edit-submit.php index 14803ce7..e3e07ea5 100644 --- a/wms/wipwhole-rec-invoice-edit-submit.php +++ b/wms/wipwhole-rec-invoice-edit-submit.php @@ -543,25 +543,25 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { // $tryrun_end_date = $_POST['tryrun_end_date2'] ?: $row['tryrun_end_date']; // $tryrun_end_date_owner = $_POST['tryrun_end_date2_owner'] ?: $row['tryrun_end_date_owner']; - $outsourcer_type = isset($_POST['outsourcer_type'])? $_POST['outsourcer_type'] : $row['outsourcer_type']; - $qc_official_type = isset($_POST['qc_official_type2'])? $_POST['qc_official_type2'] : $row['qc_official_type']; - $qc_date = isset($_POST['qc_date2'])? $_POST['qc_date2'] : $row['qc_date']; - $qc_date_owner = isset($_POST['qc_date2_owner'])? $_POST['qc_date2_owner'] : $row['qc_date_owner']; - $end_qc_date = isset($_POST['end_qc_date2'])? $_POST['end_qc_date2'] : $row['end_qc_date']; - $end_qc_date_owner = isset($_POST['end_qc_date2_owner'])? $_POST['end_qc_date2_owner'] : $row['end_qc_date_owner']; - $official_check_date = isset($_POST['official_check_date2'])? $_POST['official_check_date2'] : $row['official_check_date']; - $old_official_check_date = isset($_POST['old_official_check_date2'])? $_POST['old_official_check_date2'] : $row['old_official_check_date']; - $official_check_date_owner = isset($_POST['official_check_date2_owner'])? $_POST['official_check_date2_owner'] : $row['official_check_date_owner']; - $delivery_date = isset($_POST['delivery_date2'])? $_POST['delivery_date2'] : $row['delivery_date']; - $delivery_date_owner = isset($_POST['delivery_date2_owner'])? $_POST['delivery_date2_owner'] : $row['delivery_date_owner']; - $install_start_date = isset($_POST['install_start_date2'])? $_POST['install_start_date2'] : $row['install_start_date']; - $install_start_date_owner = isset($_POST['install_start_date2_owner'])? $_POST['install_start_date2_owner'] : $row['install_start_date_owner']; - $install_end_date = isset($_POST['install_end_date2'])? $_POST['install_end_date2'] : $row['install_end_date']; - $install_end_date_owner = isset($_POST['install_end_date2_owner'])? $_POST['install_end_date2_owner'] : $row['install_end_date_owner']; - $tryrun_start_date = isset($_POST['tryrun_start_date2'])? $_POST['tryrun_start_date2'] : $row['tryrun_start_date']; - $tryrun_start_date_owner = isset($_POST['tryrun_start_date2_owner'])? $_POST['tryrun_start_date2_owner'] : $row['tryrun_start_date_owner']; - $tryrun_end_date = isset($_POST['tryrun_end_date2'])? $_POST['tryrun_end_date2'] : $row['tryrun_end_date']; - $tryrun_end_date_owner = isset($_POST['tryrun_end_date2_owner'])? $_POST['tryrun_end_date2_owner'] : $row['tryrun_end_date_owner']; + $outsourcer_type = isset($_POST['outsourcer_type']) ? $_POST['outsourcer_type'] : $row['outsourcer_type']; + $qc_official_type = isset($_POST['qc_official_type2']) ? $_POST['qc_official_type2'] : $row['qc_official_type']; + $qc_date = isset($_POST['qc_date2']) ? $_POST['qc_date2'] : $row['qc_date']; + $qc_date_owner = isset($_POST['qc_date2_owner']) ? $_POST['qc_date2_owner'] : $row['qc_date_owner']; + $end_qc_date = isset($_POST['end_qc_date2']) ? $_POST['end_qc_date2'] : $row['end_qc_date']; + $end_qc_date_owner = isset($_POST['end_qc_date2_owner']) ? $_POST['end_qc_date2_owner'] : $row['end_qc_date_owner']; + $official_check_date = isset($_POST['official_check_date2']) ? $_POST['official_check_date2'] : $row['official_check_date']; + $old_official_check_date = isset($_POST['old_official_check_date2']) ? $_POST['old_official_check_date2'] : $row['old_official_check_date']; + $official_check_date_owner = isset($_POST['official_check_date2_owner']) ? $_POST['official_check_date2_owner'] : $row['official_check_date_owner']; + $delivery_date = isset($_POST['delivery_date2']) ? $_POST['delivery_date2'] : $row['delivery_date']; + $delivery_date_owner = isset($_POST['delivery_date2_owner']) ? $_POST['delivery_date2_owner'] : $row['delivery_date_owner']; + $install_start_date = isset($_POST['install_start_date2']) ? $_POST['install_start_date2'] : $row['install_start_date']; + $install_start_date_owner = isset($_POST['install_start_date2_owner']) ? $_POST['install_start_date2_owner'] : $row['install_start_date_owner']; + $install_end_date = isset($_POST['install_end_date2']) ? $_POST['install_end_date2'] : $row['install_end_date']; + $install_end_date_owner = isset($_POST['install_end_date2_owner']) ? $_POST['install_end_date2_owner'] : $row['install_end_date_owner']; + $tryrun_start_date = isset($_POST['tryrun_start_date2']) ? $_POST['tryrun_start_date2'] : $row['tryrun_start_date']; + $tryrun_start_date_owner = isset($_POST['tryrun_start_date2_owner']) ? $_POST['tryrun_start_date2_owner'] : $row['tryrun_start_date_owner']; + $tryrun_end_date = isset($_POST['tryrun_end_date2']) ? $_POST['tryrun_end_date2'] : $row['tryrun_end_date']; + $tryrun_end_date_owner = isset($_POST['tryrun_end_date2_owner']) ? $_POST['tryrun_end_date2_owner'] : $row['tryrun_end_date_owner']; $updatesql .= " @@ -873,11 +873,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_POST['form_name'] == 'update_install_date_form') { + include "./class/Cmail.php"; + $cmail = new Cmail(); foreach ($_POST as $k => $v) $$k = htmlspecialchars(stripslashes(trim($v))); $change_all_contractno = $_POST['change_all_contractno']; - $contractno = $_POST['contractno2']; + $contractno2 = $_POST['contractno2']; $install_start_date = $_POST['install_start_date']; $install_start_date_owner = $_POST['install_start_date_owner']; $install_end_date = $_POST['install_end_date']; @@ -886,6 +888,42 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $tryrun_start_date_owner = $_POST['tryrun_start_date_owner']; $tryrun_end_date = $_POST['tryrun_end_date']; $tryrun_end_date_owner = $_POST['tryrun_end_date_owner']; + $old_delivery_date = $_POST['old_delivery_date']; + $delivery_date = $_POST['delivery_date']; + $delivery_date_owner = $_POST['delivery_date_owner']; + $contractno = $_POST['contractno']; + $facilityno = $_POST['facilityno']; + $salesid = $_POST['salesid']; + + $salesname = accountid2name($salesid)[$salesid]; + $salesmail = accountid2email([$salesid])[$salesid]; + + if ($old_delivery_date !== $delivery_date) { + + if (empty($change_all_contractno)) { + $mail_title = "作番大日程(新梯)合約號:" . $contractno . "-移交日變更通知"; + $mail_content = "作番大日程(新梯) + 合約號:" . $contractno + . " + 移交日:" . $old_delivery_date . " => " . $delivery_date; + } else { + $mail_title = "作番大日程(新梯)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知"; + $mail_content = "作番大日程(新梯) + 合約號:" . $contractno + . " + 作番號:" . $facilityno + . " + 移交日:" . $old_delivery_date . " => " . $delivery_date; + } + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$salesname, $salesmail] + ], + "永佳捷科技" + ); + } $updatesql = " UPDATE wipwholestatus @@ -897,12 +935,14 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { tryrun_start_date = '$tryrun_start_date', tryrun_start_date_owner = '$tryrun_start_date_owner', tryrun_end_date = '$tryrun_end_date', - tryrun_end_date_owner = '$tryrun_end_date_owner' + tryrun_end_date_owner = '$tryrun_end_date_owner', + delivery_date = '$delivery_date', + delivery_date_owner = '$delivery_date_owner' "; if (empty($change_all_contractno)) { $updatesql .= "WHERE id = '$id' "; } else { - $updatesql .= "WHERE contractno = '$contractno' "; + $updatesql .= "WHERE contractno = '$contractno2' "; } // echo $updatesql; // exit; diff --git a/wms/wipwhole-rec-invoice-edit.php b/wms/wipwhole-rec-invoice-edit.php index a8346328..e458cb2d 100644 --- a/wms/wipwhole-rec-invoice-edit.php +++ b/wms/wipwhole-rec-invoice-edit.php @@ -497,7 +497,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; - + + + + + + + + + + + + + + + - +
序號 合約號 汰改種類 電梯編號

diff --git a/wms/wipwhole-renovate-index.php b/wms/wipwhole-renovate-index.php index acc8c186..754adc79 100644 --- a/wms/wipwhole-renovate-index.php +++ b/wms/wipwhole-renovate-index.php @@ -33,6 +33,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($form_name == 'del_form') { $sql = "UPDATE wipwholestatus SET status = '0' WHERE id = '$del_seq' "; mysqli_query($link, $sql); + $sql = "UPDATE flow set flow_code = 'Z' where form_id = '$del_seq' and flow_id = 'wws02' "; + mysqli_query($link, $sql); } } @@ -404,7 +406,10 @@ mysqli_close($link); window.location.href = ''; } - $('#table_index2,#table_index3,#table_index4,#table_index5,#table_index6,#table_index7').DataTable({ + $('#table_index2').DataTable({ + fixedColumns: { + leftColumns: 4 + }, scrollX: true, fixedHeader: true, scrollY: 500, @@ -585,4 +590,11 @@ mysqli_close($link);

-
\ No newline at end of file + + \ No newline at end of file diff --git a/wms/wipwhole-renovate-rec-invoice-edit-submit.php b/wms/wipwhole-renovate-rec-invoice-edit-submit.php index d1d792cd..5f05e3a1 100644 --- a/wms/wipwhole-renovate-rec-invoice-edit-submit.php +++ b/wms/wipwhole-renovate-rec-invoice-edit-submit.php @@ -115,6 +115,37 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner']; $warehouse_assistant_remark = $_POST['warehouse_assistant_remark']; + $warehouseid = $_POST['warehouseid'] ?: $row['warehouseid']; + $old_warehouseid = $_POST['old_warehouseid'] ?: $row['warehouseid']; + + + // 指派工勘人員 + if ($warehouseid !== $old_warehouseid) { + if (checkNowFormStatus($link) == 'A') { + $sql = "SELECT form_key FROM flow + WHERE form_id = '$id' + AND flow_id = 'wws02' + AND flow_code = 'A' + "; + $result = mysqli_query($link, $sql); + $form_key = $result->fetch_row()[0]; + if (!empty($form_key)) { + $sql = "UPDATE wipwholestatus + SET warehouseid = '$warehouseid' + WHERE id = '$id'; + "; + mysqli_query($link, $sql); + $sql = "UPDATE subflow + SET current_assigner = '$warehouseid' + WHERE 1 = 1 + AND seq = '1' + AND form_key = '$form_key'; + "; + mysqli_query($link, $sql); + } + } + } + // 工勘變更通知繪圖人員 if ($site_survey_contact_verify !== $old_site_survey_contact_verify) { $site_survey_status = array( @@ -233,6 +264,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $old_official_check_date = $_POST['old_official_check_date'] ?: $row['old_official_check_date']; $official_check_date_owner = $_POST['official_check_date_owner'] ?: $row['official_check_date_owner']; $delivery_date = $_POST['delivery_date'] ?: $row['delivery_date']; + $old_delivery_date = $_POST['old_delivery_date'] ?: $row['old_delivery_date']; $delivery_date_owner = $_POST['delivery_date_owner'] ?: $row['delivery_date_owner']; $creater = $_POST['creater']; @@ -241,6 +273,33 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { // 上傳附件 include "wipwhole-rec-invoice-edit-fileupload.php"; + // 指派工勘人員 + if ($warehouseid !== $old_warehouseid) { + if (checkNowFormStatus($link) == 'G') { + $sql = "SELECT form_key FROM flow + WHERE form_id = '$id' + AND flow_id = 'wws01' + AND flow_code = 'G' + "; + $result = mysqli_query($link, $sql); + $form_key = $result->fetch_row()[0]; + if (!empty($form_key)) { + $sql = "UPDATE wipwholestatus + SET warehouseid = '$warehouseid' + WHERE id = '$id'; + "; + mysqli_query($link, $sql); + $sql = "UPDATE subflow + SET current_assigner = '$warehouseid' + WHERE 1 = 1 + AND seq = '1' + AND form_key = '$form_key'; + "; + mysqli_query($link, $sql); + } + } + } + // 工勘變更通知繪圖人員 if ($official_check_date !== $old_official_check_date) { $sql = " @@ -293,9 +352,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { site_survey_contact_verify = '$site_survey_contact_verify', site_survey_contact_verify_at = '$site_survey_contact_verify_at', site_survey_contact_verify_owner = '$site_survey_contact_verify_owner', - customer_planning_verify = '$customer_planning_verify', - customer_planning_verify_at = '$customer_planning_verify_at', - customer_planning_verify_owner = '$customer_planning_verify_owner', "; $updatesql .= "warehouse_remark = '', "; if (!empty(trim($warehouse_remark))) { @@ -305,8 +361,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { } $updatesql .= empty($building_heigh_verify_file) ? "" : "building_heigh_verify_file = '$building_heigh_verify_file',"; $updatesql .= empty($site_survey_contact_verify_file) ? "" : "site_survey_contact_verify_file = '$site_survey_contact_verify_file',"; - $updatesql .= empty($customer_planning_verify_file) ? "" : "customer_planning_verify_file = '$customer_planning_verify_file',"; - } else if (in_array($user_department_id, [311, 312, 313, 314, 315, 511, 512, 513, 514])) { + + } + + if (in_array($user_department_id, [311, 312, 313, 314, 315, 511, 512, 513, 514, 515])) { // 契約更新; $updatesql .= " sales_spec_verify = '$sales_spec_verify', @@ -323,6 +381,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { site_survey_contact_form_verify_owner = '$site_survey_contact_form_verify_owner', delivery_date = '$delivery_date', delivery_date_owner = '$delivery_date_owner', + customer_planning_verify = '$customer_planning_verify', + customer_planning_verify_at = '$customer_planning_verify_at', + customer_planning_verify_owner = '$customer_planning_verify_owner', marketing_remark = '', "; if (!empty(trim($marketing_remark))) { @@ -330,6 +391,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "
" . $marketing_remark . "

',IF(all_remark IS NULL,'',all_remark)), "; } + $updatesql .= empty($customer_planning_verify_file) ? "" : "customer_planning_verify_file = '$customer_planning_verify_file',"; $updatesql .= empty($sales_spec_verify_file) ? "" : "sales_spec_verify_file = '$sales_spec_verify_file',"; $updatesql .= empty($customer_color_verify_file) ? "" : "customer_color_verify_file = '$customer_color_verify_file',"; $updatesql .= empty($customer_style_verify_file) ? "" : "customer_style_verify_file = '$customer_style_verify_file',"; @@ -1010,7 +1072,7 @@ function checkWwsAssianStatus($link, $user_id) ], "永佳捷科技" ); - do_wws_next_assign("M0173", $form_YD_key, 'C'); + do_wws_next_assign("M0173", $form_key, 'C'); return true; } } diff --git a/wms/wipwhole-renovate-rec-invoice-edit.php b/wms/wipwhole-renovate-rec-invoice-edit.php index ddf9f81a..cd8377f5 100644 --- a/wms/wipwhole-renovate-rec-invoice-edit.php +++ b/wms/wipwhole-renovate-rec-invoice-edit.php @@ -1,12 +1,13 @@ '工務確認中', 'B' => '工務部門已確認
營業部門確認中', + 'F' => '營業部門已確認
營業主管確認中', 'C' => '營業部門已確認
設計部門確認中', 'D' => '設計部門已確認
設計部門主管確認中', 'E' => '營業部門主管已確認
生管部門確認中', 'Z' => '此作番大日程已結案', ); - if (checkNowFormStatus($link) == '') { echo "此作番大日程已結案"; } else { @@ -283,6 +284,78 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
+ + + + - - - - - - - - - - + + + + + + + + + + + + + + @@ -707,6 +781,9 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; + + + + + + + + + + + + +
工勘人員 + "> + + + + + + + + + + + + + + + +
樓高通報 @@ -373,78 +446,6 @@ 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'] . "
狀態:審核通過
"; - } - } - ?> -
- - 附件 - > - 下載附件" : ""; - ?> -
- 下載附件_" . $row2['custom_name'] . "_" . $row2['create_at'] . "
"; - endforeach; - ?> -
確認時間確認人 - -
如有複數檔案請放置同個壓縮檔後再上傳 @@ -597,6 +598,78 @@ 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'] . "
狀態:審核通過
"; + // } + // } + ?> +
+ + 附件 + 客戶姓名:" placeholder="輸入後即可上傳附件" /> +
+ + 下載附件" : ""; + ?> +
+ 下載附件_" . $row2['custom_name'] . "_" . $row2['create_at'] . "
"; + endforeach; + ?> +
確認時間確認人 + +
客戶顏色 @@ -698,6 +771,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; + 確認人 + 有官檢日或QC合格日後才可填寫 +
@@ -1258,6 +1335,36 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
官檢日 +
+ +
+
確認人 + +
移交日 +
+ +
+
確認人 + +
@@ -1267,12 +1374,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
QC及官檢類型 - /> - - /> - - /> - + /> + + /> + + /> +
QC及官檢類型 + /> + + /> + + /> + +
內部QC日 +
+ > + + + +
+
確認人 + +
QC合格日 +
+ > + + + +
+
確認人 + +
官檢日 +
+ > + > + + + +
+
確認人 + +
移交日 +
+ > + + + +
+
確認人 + +
發包類型 @@ -1536,6 +1733,84 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
實際安裝開工日 +
+ > + + + +
+
確認人 + +
實際安裝完工日 +
+ > + + + +
+
確認人 + +
實際試車開工日 +
+ > + + + +
+
確認人 + +
實際試車完工日 +
+ > + + + +
+
確認人 + +
備註 @@ -1574,15 +1849,19 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
+
+
+
+
@@ -1646,7 +1925,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({ @@ -1670,7 +1976,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]); @@ -1772,6 +2086,8 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; } function getDoMarketingAssignStatus() { + if ($("#customer_planning_verify").val() == '1') + return 2; if ($("#sales_spec_verify").val() == '1') return 2; if ($("#customer_style_verify").val() == '1') @@ -1847,8 +2163,6 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; return 2; if ($("#site_survey_contact_verify").val() == '1') return 2; - if ($("#customer_planning_verify").val() == '1') - return 2; if ($("#building_heigh_verify").val() == '0' && !$('#building_heigh_verify_file_a').length) return 3; if ($("#site_survey_contact_verify").val() == '0' && !$('#site_survey_contact_verify_file_a').length) diff --git a/wms/wipwhole-renovate-rec-invoice.php b/wms/wipwhole-renovate-rec-invoice.php index 827ff746..af560c7a 100644 --- a/wms/wipwhole-renovate-rec-invoice.php +++ b/wms/wipwhole-renovate-rec-invoice.php @@ -1,15 +1,5 @@ 0 ? true : false; } - // 預設汰改代碼 A $contract_type = 'B'; - // 汰改方案 $renovate_type = ''; - // 合約號 $contractno = ''; - // 營業員ID $salesid = ''; - // 工務人員ID $warehouseid = ''; - // 客戶姓名 $custom = ''; - // 工地負責人 $site_manager = ''; - // 客戶id $accountid = ''; - // 作番號 $facilityno = ''; - // 號機 $facility_temp_no = ''; - // 緯度 $latitude = ''; - // 經度 $longitude = ''; - // 載重 $weight = ''; - // 人乘 $numberofpassenger = ''; - // 樓停 $numberofstop = ''; - // 樓層 $numberoffloor = ''; - // 開門方式 $opentype = ''; - // 速度 $speed = ''; - // 機型 $facility_kind = ''; - // 地址 $address = ''; - // 合約到貨日 $contract_arrival_date = ''; - // 實際到貨日 $real_contract_arrival_date = ''; - - // 營業規格確認 $sales_spec_verify = ''; - // 營業規格附件 $sales_spec_verify_file = ''; - // 營業規格確認時間 $sales_spec_verify_at = ''; - // 營業規格確認人 $sales_spec_verify_owner = ''; - - // 客戶計劃圖確認 $customer_planning_verify = ''; - // 客戶計劃圖附件 $customer_planning_verify_file = ''; - // 客戶計劃圖確認時間 $customer_planning_verify_at = ''; - // 客戶計劃圖確認人 $customer_planning_verify_owner = ''; - - // 客戶顏色確認 $customer_color_verify = ''; - // 客戶顏色附件 $customer_color_verify_file = ''; - // 客戶顏色確認時間 $customer_color_verify_at = ''; - // 客戶顏色確認人 $customer_color_verify_owner = ''; - - // 工勘聯絡表 $site_survey_contact_form_verify = ''; - // 工勘聯絡表附件 $site_survey_contact_form_verify_file = ''; - // 工勘聯絡表確認時間 $site_survey_contact_form_verify_at = ''; - // 工勘聯絡表確認人 $site_survey_contact_form_verify_owner = ''; - - // 設計規格確認 $desin_spec_verify = ''; - // 設計規格確認附件 $desin_spec_verify_file = ''; - // 設計規格確認時間 $desin_spec_verify_at = ''; - // 設計規格確認確認人 $desin_spec_verify_owner = ''; - - // 設計計劃圖確認 $desin_planning_verify = ''; - // 設計計劃圖確認附件 $desin_planning_verify_file = ''; - // 設計計劃圖確認時間 $desin_planning_verify_at = ''; - // 設計計劃圖確認人 $desin_planning_verify_owner = ''; - - // 設計顏色確認 $desin_color_verify = ''; - // 設計顏色確認附件 $desin_color_verify_file = ''; - // 設計顏色確認時間 $desin_color_verify_at = ''; - // 設計顏色確認人 $desin_color_verify_owner = ''; - - // 設計仕樣確認 $desin_style_verify = ''; - // 設計仕樣確認附件 $desin_style_verify_file = ''; - // 設計仕樣確認時間 $desin_style_verify_at = ''; - // 設計仕樣確認人 $desin_style_verify_owner = ''; - - // 設計主管確認 $desin_leader_verify = ''; - // 設計主管確認附件 $desin_leader_verify_file = ''; - // 設計主管確認時間 $desin_leader_verify_at = ''; - // 設計主管確認人 $desin_leader_verify_owner = ''; - - // 樓高通報 $building_heigh_verify = ''; - // 樓高通報附件 $building_heigh_verify_file = ''; - // 樓高通報時間 $building_heigh_verify_at = ''; - // 樓高通報確認人 $building_heigh_verify_owner = ''; - - // 電氣發貨明細 $electrical_design_publish = ''; - // 電氣資料發行時間 $electrical_design_publish_at = ''; - // 電氣資料發行人 $electrical_design_publish_owner = ''; - - // 機械資料發行 $mechanical_design_publish = ''; - // 機械資料發行時間 $mechanical_design_publish_at = ''; - // 機械資料發行人 $mechanical_design_publish_owner = ''; - - // 電氣發貨明細 $electrical_shipping_date_publish = ''; - // 電氣發貨明細時間 $electrical_shipping_date_publish_at = ''; - // 電氣發貨明細發行人 $electrical_shipping_date_publish_owner = ''; - - // 機械發貨明細 $mechanical_shipping_date_publish = ''; - // 機械發貨明細時間 $mechanical_shipping_date_publish_at = ''; - // 機械發貨明細發行人 $mechanical_shipping_date_publish_owner = ''; - - // 下單日(普來特富) $prattford_order_date = ''; - // 預計發貨日(到港日) $estimated_shipping_date = ''; - // 發貨類別(A.全級發貨、G.欠件發貨) $goods_type = ''; - // 實際到貨日(到觀音廠日) $actual_tofactory_date = ''; - // 發貨確認人 $shipping_date_owner = ''; - // 預計船期 $estimated_shipping_schedule_date = ''; - // 實際到貨日(到港日) $actual_arrival_date = ''; - // 到貨確認人 $arrival_date_owner = ''; - - // 是否齊備 $shengguanok_status = ''; - // 生管確認附件 $shengguanok_status_file = ''; - // 已備齊時間 $shengguanok_status_at = ''; - // 已備齊檢查人 $shengguanok_status_owner = ''; - - // 建立人 $creater = ''; - // 建立時間 $create_at = ''; if ($_SERVER["REQUEST_METHOD"] == "POST") { - // 預設新梯代碼 A $contract_type = postCheck('contract_type', 'B'); - // 汰改方案 B $renovate_type = json_encode($_POST['renovate_type'], JSON_UNESCAPED_UNICODE); - // 合約號 $contractno = postCheck('contractno'); - // 營業員ID $salesid = postCheck('salesid'); - // 工務人員ID $warehouseid = postCheck('warehouseid'); - // 客戶姓名 $custom = postCheck('custom'); - // 工地負責人 $site_manager = postCheck('site_manager'); - // 客戶id $accountid = postCheck('accountid'); - // 作番號 $facilityno = postCheck('facilityno'); - // 作番號 $facility_temp_no = postCheck('facility_temp_no'); - // 緯度 $latitude = postCheck('latitude'); - // 經度 $longitude = postCheck('longitude'); - // 載重 $weight = postCheck('weight'); - // 人乘 $numberofpassenger = postCheck('numberofpassenger'); - // 樓停 $numberofstop = postCheck('numberofstop'); - // 樓層 $numberoffloor = postCheck('numberoffloor'); - // 開門方式 $opentype = postCheck('opentype'); - // 速度 $speed = postCheck('speed'); - // 機型 $facility_kind = postCheck('facility_kind'); - // 地址 $address = postCheck('address'); - // 合約到貨日 $contract_arrival_date = postCheck('contract_arrival_date'); - // 實際到貨日 $real_contract_arrival_date = postCheck('real_contract_arrival_date'); - - // 營業規格確認 $sales_spec_verify = postCheck('sales_spec_verify'); - // 營業規格附件 $sales_spec_verify_file = postCheck('sales_spec_verify_file'); - // 營業規格確認時間 $sales_spec_verify_at = postCheck('sales_spec_verify_at'); - // 營業規格確認人 $sales_spec_verify_owner = postCheck('sales_spec_verify_owner'); - - // 客戶計劃圖確認 $customer_planning_verify = postCheck('customer_planning_verify'); - // 客戶計劃圖附件 $customer_planning_verify_file = postCheck('customer_planning_verify_file'); - // 客戶計劃圖確認時間 $customer_planning_verify_at = postCheck('customer_planning_verify_at'); - // 客戶計劃圖確認人 $customer_planning_verify_owner = postCheck('customer_planning_verify_owner'); - - // 客戶顏色確認 $customer_color_verify = postCheck('customer_color_verify'); - // 客戶顏色附件 $customer_color_verify_file = postCheck('customer_color_verify_file'); - // 客戶顏色確認時間 $customer_color_verify_at = postCheck('customer_color_verify_at'); - // 客戶顏色確認人 $customer_color_verify_owner = postCheck('customer_color_verify_owner'); - - // 工勘聯絡表 $site_survey_contact_form_verify = postCheck('site_survey_contact_form_verify'); - // 工勘聯絡表附件 $site_survey_contact_form_verify_file = postCheck('site_survey_contact_form_verify_file'); - // 工勘聯絡表確認時間 $site_survey_contact_form_verify_at = postCheck('site_survey_contact_form_verify_at'); - // 工勘聯絡表確認人 $site_survey_contact_form_verify_owner = postCheck('site_survey_contact_form_verify_owner'); - - // 設計規格確認 $desin_spec_verify = postCheck('desin_spec_verify'); - // 設計規格確認附件 $desin_spec_verify_file = postCheck('desin_spec_verify_file'); - // 設計規格確認時間 $desin_spec_verify_at = postCheck('desin_spec_verify_at'); - // 設計規格確認確認人 $desin_spec_verify_owner = postCheck('desin_spec_verify_owner'); - - // 設計計劃圖確認 $desin_planning_verify = postCheck('desin_planning_verify'); - // 設計計劃圖確認附件 $desin_planning_verify_file = postCheck('desin_planning_verify_file'); - // 設計計劃圖確認時間 $desin_planning_verify_at = postCheck('desin_planning_verify_at'); - // 設計計劃圖確認人 $desin_planning_verify_owner = postCheck('desin_planning_verify_owner'); - - // 設計顏色確認 $desin_color_verify = postCheck('desin_color_verify'); - // 設計顏色確認附件 $desin_color_verify_file = postCheck('desin_color_verify_file'); - // 設計顏色確認時間 $desin_color_verify_at = postCheck('desin_color_verify_at'); - // 設計顏色確認人 $desin_color_verify_owner = postCheck('desin_color_verify_owner'); - - // 設計仕樣確認 $desin_style_verify = postCheck('desin_style_verify'); - // 設計仕樣確認附件 $desin_style_verify_file = postCheck('desin_style_verify_file'); - // 設計仕樣確認時間 $desin_style_verify_at = postCheck('desin_style_verify_at'); - // 設計仕樣確認人 $desin_style_verify_owner = postCheck('desin_style_verify_owner'); - - // 設計主管確認 $desin_leader_verify = postCheck('desin_leader_verify'); - // 設計主管確認附件 $desin_leader_verify_file = postCheck('desin_leader_verify_file'); - // 設計主管確認時間 $desin_leader_verify_at = postCheck('desin_leader_verify_at'); - // 設計主管確認人 $desin_leader_verify_owner = postCheck('desin_leader_verify_owner'); - - // 樓高通報 $building_heigh_verify = postCheck('building_heigh_verify'); - // 樓高通報附件 $building_heigh_verify_file = postCheck('building_heigh_verify_file'); - // 樓高通報時間 $building_heigh_verify_at = postCheck('building_heigh_verify_at'); - // 樓高通報確認人 $building_heigh_verify_owner = postCheck('building_heigh_verify_owner'); - - // 電氣發貨明細 $electrical_design_publish = postCheck('electrical_design_publish'); - // 電氣資料發行時間 $electrical_design_publish_at = postCheck('electrical_design_publish_at'); - // 電氣資料發行人 $electrical_design_publish_owner = postCheck('electrical_design_publish_owner'); - - // 機械資料發行 $mechanical_design_publish = postCheck('mechanical_design_publish'); - // 機械資料發行時間 $mechanical_design_publish_at = postCheck('mechanical_design_publish_at'); - // 機械資料發行人 $mechanical_design_publish_owner = postCheck('mechanical_design_publish_owner'); - - // 電氣發貨明細 $electrical_shipping_date_publish = postCheck('electrical_shipping_date_publish'); - // 電氣發貨明細時間 $electrical_shipping_date_publish_at = postCheck('electrical_shipping_date_publish_at'); - // 電氣發貨明細發行人 $electrical_shipping_date_publish_owner = postCheck('electrical_shipping_date_publish_owner'); - - // 機械發貨明細 $mechanical_shipping_date_publish = postCheck('mechanical_shipping_date_publish'); - // 機械發貨明細時間 $mechanical_shipping_date_publish_at = postCheck('mechanical_shipping_date_publish_at'); - // 機械發貨明細發行人 $mechanical_shipping_date_publish_owner = postCheck('mechanical_shipping_date_publish_owner'); - - // 普來特富(下單日) $prattford_order_date = postCheck('prattford_order_date'); - // 預計發貨日(到港日) $estimated_shipping_date = postCheck('estimated_shipping_date'); - // 發貨類別(A.全級發貨、G.欠件發貨) $goods_type = postCheck('goods_type'); - // 實際到貨日(到觀音廠日) $actual_tofactory_date = postCheck('actual_tofactory_date'); - // 發貨確認人 $shipping_date_owner = postCheck('shipping_date_owner'); - // 預計船期 $estimated_shipping_schedule_date = postCheck('estimated_shipping_schedule_date'); - // 實際到貨日(到港日) $actual_arrival_date = postCheck('actual_arrival_date'); - // 到貨確認人 $arrival_date_owner = postCheck('arrival_date_owner'); - - // 是否齊備 $shengguanok_status = postCheck('shengguanok_status'); - // 生管確認附件 $shengguanok_status_file = postCheck('shengguanok_status_file'); - // 已備齊時間 $shengguanok_status_at = postCheck('shengguanok_status_at'); - // 已備齊檢查人 $shengguanok_status_owner = postCheck('shengguanok_status_owner'); - - // QC與官檢種類 $qc_official_type = postCheck('qc_official_type'); - - // 建立人 $creater = postCheck('creater'); - // 建立時間 $create_at = date("Y-m-d H:i:s"); //插入數據庫數據 gary_version @@ -449,6 +227,7 @@ if ($department_id == "321" || $department_id == "220") { renovate_type, contractno, salesid, + warehouseid, custom, site_manager, accountid, @@ -538,6 +317,7 @@ if ($department_id == "321" || $department_id == "220") { '$renovate_type', '$contractno', '$salesid', + '$warehouseid', '$custom', '$site_manager', '$accountid', @@ -668,6 +448,15 @@ if ($department_id == "321" || $department_id == "220") { // 所有工務人員 select => options $sql = " + SELECT + accountid AS val , + name AS label + FROM account + WHERE 1=1 + -- AND department_id IN ('521','531','541','542','543','544','545') + AND accountid IN ('M0040','M0198','M0078','M0087','M0161') + ORDER BY label ASC + /* SELECT accountid AS val , name AS label @@ -688,6 +477,7 @@ if ($department_id == "321" || $department_id == "220") { FROM account WHERE department_id IN ('521','531','541','542','543','544','545') ORDER BY label ASC + */ "; $warehouse_options = mysqli_query($link, $sql); @@ -845,14 +635,36 @@ if ($department_id == "321" || $department_id == "220") {
@@ -1058,6 +1058,28 @@ include "wipwhole-rec-invoice-edit-submit.php";
移交日 +
+ > + + + + +
+
確認人 + + + 有官檢日或QC合格日後才可填寫 +
" /> + + + + + +
@@ -1960,12 +1988,12 @@ include "wipwhole-rec-invoice-edit-submit.php"; } function checkDeliveryDateKeyinStatus() { - $("#delivery_date").prop("disabled", true); + $("#delivery_date,#delivery_date_tmp").prop("disabled", true); if ($("#end_qc_date").val() !== "") { - $("#delivery_date").prop("disabled", false); + $("#delivery_date,#delivery_date_tmp").prop("disabled", false); } if ($("#official_check_date").val() !== "") { - $("#delivery_date").prop("disabled", false); + $("#delivery_date,#delivery_date_tmp").prop("disabled", false); } } $(function() { @@ -1995,7 +2023,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 'qc_date2', 'end_qc_date2', 'official_check_date2', - 'delivery_date', + // 'delivery_date', 'delivery_date2', 'install_start_date2', 'install_end_date2', @@ -2030,6 +2058,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 'install_end_date', 'tryrun_start_date', 'tryrun_end_date', + 'delivery_date' ] for (var i = 0; i < oursourcer_input_arr.length; i++) { inputChangeOutsourcer(oursourcer_input_arr[i]); @@ -2304,6 +2333,8 @@ include "wipwhole-rec-invoice-edit-submit.php"; $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); + $("#delivery_date").val($("#delivery_date_tmp").val()); + $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val()); $('#update_install_date_form').submit(); } } else { @@ -2315,6 +2346,8 @@ include "wipwhole-rec-invoice-edit-submit.php"; $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); + $("#delivery_date").val($("#delivery_date_tmp").val()); + $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val()); $('#update_install_date_form').submit(); } } diff --git a/wms/wipwhole-renovate-rec-invoice-edit-submit.php b/wms/wipwhole-renovate-rec-invoice-edit-submit.php index 6e87a316..98579974 100644 --- a/wms/wipwhole-renovate-rec-invoice-edit-submit.php +++ b/wms/wipwhole-renovate-rec-invoice-edit-submit.php @@ -894,6 +894,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_POST['form_name'] == 'update_install_date_form') { + include "./class/Cmail.php"; + $cmail = new Cmail(); foreach ($_POST as $k => $v) $$k = htmlspecialchars(stripslashes(trim($v))); @@ -907,6 +909,42 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $tryrun_start_date_owner = $_POST['tryrun_start_date_owner']; $tryrun_end_date = $_POST['tryrun_end_date']; $tryrun_end_date_owner = $_POST['tryrun_end_date_owner']; + $old_delivery_date = $_POST['old_delivery_date']; + $delivery_date = $_POST['delivery_date']; + $delivery_date_owner = $_POST['delivery_date_owner']; + $contractno = $_POST['contractno']; + $facilityno = $_POST['facilityno']; + $salesid = $_POST['salesid']; + + $salesname = accountid2name($salesid)[$salesid]; + $salesmail = accountid2email([$salesid])[$salesid]; + + if ($old_delivery_date !== $delivery_date) { + + if (empty($change_all_contractno)) { + $mail_title = "作番大日程(汰改)合約號:" . $contractno . "-移交日變更通知"; + $mail_content = "作番大日程(汰改)$salesname$salesmail + 合約號:" . $contractno + . " + 移交日:" . $old_delivery_date . " => " . $delivery_date; + } else { + $mail_title = "作番大日程(汰改)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知"; + $mail_content = "作番大日程(汰改) + 合約號:" . $contractno + . " + 作番號:" . $facilityno + . " + 移交日:" . $old_delivery_date . " => " . $delivery_date; + } + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$salesname, $salesmail] + ], + "永佳捷科技" + ); + } $updatesql = " UPDATE wipwholestatus @@ -918,7 +956,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { tryrun_start_date = '$tryrun_start_date', tryrun_start_date_owner = '$tryrun_start_date_owner', tryrun_end_date = '$tryrun_end_date', - tryrun_end_date_owner = '$tryrun_end_date_owner' + tryrun_end_date_owner = '$tryrun_end_date_owner', + delivery_date = '$delivery_date', + delivery_date_owner = '$delivery_date_owner' "; if (empty($change_all_contractno)) { $updatesql .= "WHERE id = '$id' "; diff --git a/wms/wipwhole-renovate-rec-invoice-edit.php b/wms/wipwhole-renovate-rec-invoice-edit.php index 57fbd03f..f458ab65 100644 --- a/wms/wipwhole-renovate-rec-invoice-edit.php +++ b/wms/wipwhole-renovate-rec-invoice-edit.php @@ -550,6 +550,28 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
移交日 +
+ > + + + + +
+
確認人 + + + 有官檢日或QC合格日後才可填寫 +
@@ -1907,6 +1929,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; + + + + + +
@@ -1959,12 +1987,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; } function checkDeliveryDateKeyinStatus() { - $("#delivery_date").prop("disabled", true); + $("#delivery_date,#delivery_date_tmp").prop("disabled", true); if ($("#end_qc_date").val() !== "") { - $("#delivery_date").prop("disabled", false); + $("#delivery_date,#delivery_date_tmp").prop("disabled", false); } if ($("#official_check_date").val() !== "") { - $("#delivery_date").prop("disabled", false); + $("#delivery_date,#delivery_date_tmp").prop("disabled", false); } } $(function() { @@ -1990,7 +2018,7 @@ 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', @@ -2028,6 +2056,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 'install_end_date', 'tryrun_start_date', 'tryrun_end_date', + 'delivery_date' ] for (var i = 0; i < oursourcer_input_arr.length; i++) { inputChangeOutsourcer(oursourcer_input_arr[i]); @@ -2329,6 +2358,8 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); + $("#delivery_date").val($("#delivery_date_tmp").val()); + $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val()); $('#update_install_date_form').submit(); } } else { @@ -2340,6 +2371,8 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); + $("#delivery_date").val($("#delivery_date_tmp").val()); + $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val()); $('#update_install_date_form').submit(); } }