diff --git a/.gitignore b/.gitignore index 7a04d2b0..74665935 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ wms/loginapi.php wms/excel/gary_test.xlsx wms/excel/wipwholeintall.xlsx wms/excel/estimated_shipping_date_report.xlsx +*.docx diff --git a/wms/wipwhole-change-planning-customer-name-function.php b/wms/wipwhole-change-planning-customer-name-function.php index bd77a993..14f6fae6 100644 --- a/wms/wipwhole-change-planning-customer-name-function.php +++ b/wms/wipwhole-change-planning-customer-name-function.php @@ -1,5 +1,26 @@ $tds, 'form_key' => getFomkeySeq($link), 'user_id' => $user_id, + 'customer_planning_verify_file' => $customer_planning_verify_file, 'change_status' => $_POST['assign_status'] ); // 寫入表單主檔 @@ -40,6 +42,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { // 批次申請 if (($_POST['assign_status'] == 'A' || $_POST['assign_status'] == 'B') && !empty($all_contractno_change)) { $wipwholestatus_id_arr = getWipwholestatusIdByConstractNo($link, $contractno); + $customer_planning_verify_file = fileIUpload("customer_planning_verify_file"); foreach ($wipwholestatus_id_arr as $wipwholestatus_id) { $data_arr = array( 'id' => $wipwholestatus_id[0], @@ -48,6 +51,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { 'contractno' => $contractno, 'tds' => $tds, 'form_key' => getFomkeySeq($link), + 'customer_planning_verify_file' => $customer_planning_verify_file, 'user_id' => $user_id ); // 寫入表單主檔 @@ -216,58 +220,58 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { "; mysqli_query($link, $sql); -// // 發送系統通知 -// $contractno = $_POST['contractno']; -// $facilityno = $_POST['facilityno']; -// $real_contract_arrival_date = $_POST['real_contract_arrival_date']; -// $salesid = $_POST['salesid']; -// $gongWuokid = $_POST['gongWuokid']; -// $old_real_address = $_POST['old_real_address']; -// $real_address = $_POST['real_address']; -// $content = "合約號 : $contractno -// 作番號 : $facilityno -// 出貨日期微調: " . substr($real_contract_arrival_date, 0, 10) . " => " . substr($contract_arrival_date_tmp, 0, 10) . " -// 工地地址微調: " . $old_real_address . " => " . $real_address_tmp; + // // 發送系統通知 + // $contractno = $_POST['contractno']; + // $facilityno = $_POST['facilityno']; + // $real_contract_arrival_date = $_POST['real_contract_arrival_date']; + // $salesid = $_POST['salesid']; + // $gongWuokid = $_POST['gongWuokid']; + // $old_real_address = $_POST['old_real_address']; + // $real_address = $_POST['real_address']; + // $content = "合約號 : $contractno + // 作番號 : $facilityno + // 出貨日期微調: " . substr($real_contract_arrival_date, 0, 10) . " => " . substr($contract_arrival_date_tmp, 0, 10) . " + // 工地地址微調: " . $old_real_address . " => " . $real_address_tmp; -// // 大日程出貨日調整 通知營業人員 -// $noticeData = array( -// 'related_id' => $cid, -// 'title' => '作番大日程(新梯)出貨日調整通知 > ' . $facilityno, -// 'content' => $content, -// 'permission' => $salesid, -// ); -// addNotice($link, $noticeData); -// // 大日程出貨日調整 通知工務人員 -// $noticeData = array( -// 'related_id' => $cid, -// 'title' => '作番大日程(新梯)出貨日調整通知 > ' . $facilityno, -// 'content' => $content, -// 'permission' => $gongWuokid, -// ); -// addNotice($link, $noticeData); + // // 大日程出貨日調整 通知營業人員 + // $noticeData = array( + // 'related_id' => $cid, + // 'title' => '作番大日程(新梯)出貨日調整通知 > ' . $facilityno, + // 'content' => $content, + // 'permission' => $salesid, + // ); + // addNotice($link, $noticeData); + // // 大日程出貨日調整 通知工務人員 + // $noticeData = array( + // 'related_id' => $cid, + // 'title' => '作番大日程(新梯)出貨日調整通知 > ' . $facilityno, + // 'content' => $content, + // 'permission' => $gongWuokid, + // ); + // addNotice($link, $noticeData); -// $shengguano_arr = getShengguanokOptions($link); -// foreach ($shengguano_arr as $row) : -// $contractno = $_POST['contractno']; -// $facilityno = $_POST['facilityno']; -// $real_contract_arrival_date = $_POST['real_contract_arrival_date']; -// $gongWuokid = $_POST['gongWuokid']; -// $old_real_address = $_POST['old_real_address']; -// $real_address = $_POST['real_address']; -// $content = "合約號 : $contractno -// 作番號 : $facilityno -// 出貨日期微調: " . substr($real_contract_arrival_date, 0, 10) . " => " . substr($contract_arrival_date_tmp, 0, 10) . " -// 工地地址微調: " . $old_real_address . " => " . $real_address_tmp; + // $shengguano_arr = getShengguanokOptions($link); + // foreach ($shengguano_arr as $row) : + // $contractno = $_POST['contractno']; + // $facilityno = $_POST['facilityno']; + // $real_contract_arrival_date = $_POST['real_contract_arrival_date']; + // $gongWuokid = $_POST['gongWuokid']; + // $old_real_address = $_POST['old_real_address']; + // $real_address = $_POST['real_address']; + // $content = "合約號 : $contractno + // 作番號 : $facilityno + // 出貨日期微調: " . substr($real_contract_arrival_date, 0, 10) . " => " . substr($contract_arrival_date_tmp, 0, 10) . " + // 工地地址微調: " . $old_real_address . " => " . $real_address_tmp; -// // 大日程出貨日調整 通知營業人員 -// $noticeData = array( -// 'related_id' => $cid, -// 'title' => '作番大日程(新梯)出貨日調整通知 > ' . $facilityno, -// 'content' => $content, -// 'permission' => $row['val'], -// ); -// addNotice($link, $noticeData); -// endforeach; + // // 大日程出貨日調整 通知營業人員 + // $noticeData = array( + // 'related_id' => $cid, + // 'title' => '作番大日程(新梯)出貨日調整通知 > ' . $facilityno, + // 'content' => $content, + // 'permission' => $row['val'], + // ); + // addNotice($link, $noticeData); + // endforeach; } } } diff --git a/wms/wipwhole-change-planning-customer-name.php b/wms/wipwhole-change-planning-customer-name.php index 0742c977..c2bc904e 100644 --- a/wms/wipwhole-change-planning-customer-name.php +++ b/wms/wipwhole-change-planning-customer-name.php @@ -1,9 +1,10 @@ menu_v3($user_id, $accounttype); + $jsonres['menu'] = $includecommon->menu_v3($user_id, $accounttype); $login_json = json_encode($jsonres, JSON_UNESCAPED_UNICODE); } ?>
-
+
@@ -268,7 +269,7 @@ if (!empty(checkNowFormStatus($link))) 填寫客戶姓名 - + "; @@ -277,7 +278,13 @@ if (!empty(checkNowFormStatus($link))) echo ""; } ?> - + + 上傳計劃圖 + + + 下載附件" : ""; + ?> diff --git a/wms/wipwhole-index-function.php b/wms/wipwhole-index-function.php index a8aeed7f..6fe832da 100644 --- a/wms/wipwhole-index-function.php +++ b/wms/wipwhole-index-function.php @@ -1120,3 +1120,26 @@ function getWipwholeChangePlanningCustomerDetailsStatus($link, $id) "; return mysqli_query($link, $sql); } + + +function getAllCustomerPlanningVerify($link, $id) +{ + $sql = " + SELECT + customer_planning_verify_file, + create_at + FROM wipwholestatus + WHERE id = $id + AND customer_planning_verify_file != '' + AND customer_planning_verify_file IS NOT NULL + UNION + SELECT + customer_planning_verify_file, + create_at + FROM wipwhole_change_planning_customer_details + WHERE wipwholestatus_id = $id + AND customer_planning_verify_file != '' + AND customer_planning_verify_file IS NOT NULL + "; + return mysqli_query($link, $sql); +} \ 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 6b4713a3..4735d395 100644 --- a/wms/wipwhole-rec-invoice-edit-submit.php +++ b/wms/wipwhole-rec-invoice-edit-submit.php @@ -286,7 +286,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { } } - + $updatesql = " UPDATE wipwholestatus SET @@ -483,8 +483,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { "; if (!empty($official_check_file)) $updatesql .= "official_check_file = '$official_check_file', "; - } else if (in_array($user_id, ['M0175', 'M0079', 'M0060'])) { - // 暫時可編輯及刪除權限 + } + + // 暫時可編輯及刪除權限 + if (in_array($user_id, ['M0175', 'M0079', 'M0060'])) { $updatesql .= " contractno = '$contractno', facility_temp_no = '$facility_temp_no', @@ -504,9 +506,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { contract_arrival_date = '$contract_arrival_date', facility_kind = '$facility_kind', "; - }else{ - echo "暫無權限"; - exit(); } // 工務助理 @@ -535,6 +534,32 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "
上傳了安裝圖附件

',IF(all_remark IS NULL,'',all_remark)), "; } + + // 許協更新業務確認項目權限 + if ($user_id == 'M0060') { + $updatesql .= " + prattford_order_date_verify = '$prattford_order_date_verify' , + prattford_order_date = '$prattford_order_date', + prattford_order_date_owner = '$prattford_order_date_owner', + estimated_shipping_date_verify = '$estimated_shipping_date_verify', + estimated_shipping_date = '$estimated_shipping_date', + estimated_shipping_date_owner = '$estimated_shipping_date_owner', + estimated_shipping_schedule_date_verify = '$estimated_shipping_schedule_date_verify', + estimated_shipping_schedule_date = '$estimated_shipping_schedule_date', + estimated_shipping_schedule_date_owner = '$estimated_shipping_schedule_date_owner', + goods_type = '$goods_type', + goods_type_date = '$goods_type_date', + goods_type_owner = '$goods_type_owner', + taiwan_goods_type = '$taiwan_goods_type', + taiwan_goods_type_date = '$taiwan_goods_type_date', + taiwan_goods_type_owner = '$taiwan_goods_type_owner', + shengguanok_status = '$shengguanok_status', + shengguanok_status_at = '$shengguanok_status_at', + shengguanok_status_owner = '$shengguanok_status_owner', + yewu_remark = '', + "; + } + $updatesql .= " creater = '$creater', create_at = '$create_at' diff --git a/wms/wipwhole-rec-invoice-edit.php b/wms/wipwhole-rec-invoice-edit.php index f0588313..9809feae 100644 --- a/wms/wipwhole-rec-invoice-edit.php +++ b/wms/wipwhole-rec-invoice-edit.php @@ -63,6 +63,11 @@ if (in_array($user_id, ['M0175', 'M0079', 'M0060'])) { $update_delete_status = ""; } +// 許協業務項編輯權限 +if (in_array($user_id, ['M0060'])) { + $yewu = ""; +} + // select => options 開門方式 $opendoor_options = getOpendoorOptions($link); // select => options 確認人 @@ -359,15 +364,22 @@ include "wipwhole-rec-invoice-edit-submit.php"; 附件 - > + + 下載附件_" . $row2['create_at'] . "
"; + endforeach; ?> 確認時間 @@ -548,7 +560,11 @@ include "wipwhole-rec-invoice-edit-submit.php"; 附件 下載附件" : ""; + // echo !empty($row['customer_planning_verify_file']) ? "下載附件" : ""; + foreach ($customer_planning_verify_files as $row2) : + echo "下載附件_" . $row2['create_at'] . "
"; + endforeach; ?> 確認時間 @@ -1125,7 +1141,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; + 安裝發包廠商 @@ -1866,4 +1900,29 @@ include "wipwhole-rec-invoice-edit-submit.php"; $('#update_install_date_form').submit(); } } + + // function setOutSourcerDate() { + + // // 發包類型 + // let outsourcer_type = $("input[name^='outsourcer_type']").val(); + // // 預計出貨日(到工地) + // let real_contract_arrival_date = $("#real_contract_arrival_date").val(); + // // 樓停 + // let numberofstop = $("#numberofstop").val(); + + // if (outsourcer_type === 'I') { + // // 預計安裝開工日 + // Date.prototype.addDays = function(days) { + // this.setDate(this.getDate() + days); + // return this; + // } + + // } + // if (outsourcer_type === 'T') { + + // } + // if (outsourcer_type === 'IT') { + + // } + // } \ No newline at end of file diff --git a/wms/wipwhole-renovate-index-function.php b/wms/wipwhole-renovate-index-function.php index b59a85c3..72a58afd 100644 --- a/wms/wipwhole-renovate-index-function.php +++ b/wms/wipwhole-renovate-index-function.php @@ -1100,3 +1100,25 @@ function getWipwholeChangePlanningCustomerDetailsStatus($link, $id) "; return mysqli_query($link, $sql); } + +function getAllCustomerPlanningVerify($link, $id) +{ + $sql = " + SELECT + customer_planning_verify_file, + create_at + FROM wipwholestatus + WHERE id = $id + AND customer_planning_verify_file != '' + AND customer_planning_verify_file IS NOT NULL + UNION + SELECT + customer_planning_verify_file, + create_at + FROM wipwhole_change_planning_customer_details + WHERE wipwholestatus_id = $id + AND customer_planning_verify_file != '' + AND customer_planning_verify_file IS NOT NULL + "; + return mysqli_query($link, $sql); +} \ 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 5bf4080a..9bca3642 100644 --- a/wms/wipwhole-renovate-rec-invoice-edit-submit.php +++ b/wms/wipwhole-renovate-rec-invoice-edit-submit.php @@ -463,7 +463,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { "; if (!empty($official_check_file)) $updatesql .= "official_check_file = '$official_check_file', "; - } else if (in_array($user_id, ['M0175', 'M0079', 'M0060'])) { + } + + if (in_array($user_id, ['M0175', 'M0079', 'M0060'])) { // 暫時可編輯及刪除權限 $updatesql .= " contractno = '$contractno', @@ -484,9 +486,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { contract_arrival_date = '$contract_arrival_date', facility_kind = '$facility_kind', "; - } else { - echo "暫無權限"; - exit(); } // 工務助理 @@ -515,6 +514,32 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "
上傳了安裝圖附件

',IF(all_remark IS NULL,'',all_remark)), "; } + + // 許協更新業務確認項目權限 + if ($user_id == 'M0060') { + $updatesql .= " + prattford_order_date_verify = '$prattford_order_date_verify' , + prattford_order_date = '$prattford_order_date', + prattford_order_date_owner = '$prattford_order_date_owner', + estimated_shipping_date_verify = '$estimated_shipping_date_verify', + estimated_shipping_date = '$estimated_shipping_date', + estimated_shipping_date_owner = '$estimated_shipping_date_owner', + estimated_shipping_schedule_date_verify = '$estimated_shipping_schedule_date_verify', + estimated_shipping_schedule_date = '$estimated_shipping_schedule_date', + estimated_shipping_schedule_date_owner = '$estimated_shipping_schedule_date_owner', + goods_type = '$goods_type', + goods_type_date = '$goods_type_date', + goods_type_owner = '$goods_type_owner', + taiwan_goods_type = '$taiwan_goods_type', + taiwan_goods_type_date = '$taiwan_goods_type_date', + taiwan_goods_type_owner = '$taiwan_goods_type_owner', + shengguanok_status = '$shengguanok_status', + shengguanok_status_at = '$shengguanok_status_at', + shengguanok_status_owner = '$shengguanok_status_owner', + yewu_remark = '', + "; + } + $updatesql .= " creater = '$creater', create_at = '$create_at' diff --git a/wms/wipwhole-renovate-rec-invoice-edit.php b/wms/wipwhole-renovate-rec-invoice-edit.php index 02a76d06..24d8b8a6 100644 --- a/wms/wipwhole-renovate-rec-invoice-edit.php +++ b/wms/wipwhole-renovate-rec-invoice-edit.php @@ -61,6 +61,11 @@ if (in_array($user_id, ['M0175', 'M0079', 'M0060'])) { $update_delete_status = ""; } +// 許協業務項編輯權限 +if (in_array($user_id, ['M0060'])) { + $yewu = ""; +} + // select => options 開門方式 $opendoor_options = getOpendoorOptions($link); @@ -409,15 +414,22 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 附件 - > + + 下載附件_" . $row2['create_at'] . ""; + endforeach; ?> 確認時間 @@ -753,7 +765,11 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 附件 下載附件" : ""; + // echo !empty($row['customer_planning_verify_file']) ? "下載附件" : ""; + foreach ($customer_planning_verify_files as $row2) : + echo "下載附件_" . $row2['create_at'] . ""; + endforeach; ?> 確認時間 @@ -1128,7 +1144,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";