Browse Source

大日程新增 外包合約上傳系統 完工驗收單上傳系統

gary
gary_chen\gary_chen 1 year ago
parent
commit
cca05cbc8a
  1. 13
      .env
  2. 24
      wms/wipwhole-rec-invoice-edit-fileupload.php
  3. 15
      wms/wipwhole-rec-invoice-edit-submit.php
  4. 55
      wms/wipwhole-rec-invoice-edit.php
  5. 13
      wms/wipwhole-rec-invoice.php
  6. 15
      wms/wipwhole-renovate-rec-invoice-edit-submit.php
  7. 53
      wms/wipwhole-renovate-rec-invoice-edit.php
  8. 14
      wms/wipwhole-renovate-rec-invoice.php

13
.env

@ -1,13 +0,0 @@
# DB_CONNECTION=mysql
# DB_HOST=db-104.coowo.com:3306
# DB_PORT=3306
# DB_DATABASE=appwms
# DB_USERNAME=masadaroot
# DB_PASSWORD=x6h5E5p#u8y
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=appwms1113
DB_USERNAME=root
DB_PASSWORD=

24
wms/wipwhole-rec-invoice-edit-fileupload.php

@ -21,6 +21,27 @@ function fileIUpload($post_name)
} }
} }
function fileIUploads($post_name)
{
$file_arr = [];
if (isset($_FILES[$post_name])) {
foreach ($_FILES[$post_name]['tmp_name'] as $key => $tmp_name) {
$file_name = $_FILES[$post_name]['name'][$key];
$temp_file_name = $_FILES[$post_name]['tmp_name'][$key];
$target_dir = empty($file_name) ? "" : "public-wipwhole/";
$datetime = date("YmdHis");
$sales_spec_verify_file = strtolower($target_dir . basename($datetime . $file_name));
if (file_exists($sales_spec_verify_file))
unlink($sales_spec_verify_file);
move_uploaded_file($temp_file_name, $sales_spec_verify_file);
if (!empty($file_name)) {
array_push($file_arr, strtolower($target_dir . basename($datetime . $file_name)));
}
}
}
return json_encode($file_arr, JSON_UNESCAPED_UNICODE);
}
// 營業 // 營業
$sales_spec_verify_file = fileIUpload("sales_spec_verify_file"); $sales_spec_verify_file = fileIUpload("sales_spec_verify_file");
$customer_planning_verify_file = fileIUpload("customer_planning_verify_file"); $customer_planning_verify_file = fileIUpload("customer_planning_verify_file");
@ -39,5 +60,8 @@ $desin_leader_verify_file = fileIUpload("desin_leader_verify_file");
$building_heigh_verify_file = fileIUpload("building_heigh_verify_file"); $building_heigh_verify_file = fileIUpload("building_heigh_verify_file");
$site_survey_contact_verify_file = fileIUpload("site_survey_contact_verify_file"); $site_survey_contact_verify_file = fileIUpload("site_survey_contact_verify_file");
$plan_diagram_file = fileIUpload("plan_diagram_file"); $plan_diagram_file = fileIUpload("plan_diagram_file");
$completion_acceptance_file = fileIUpload("completion_acceptance_file");
// 生管 // 生管
$shengguanok_status_file = fileIUpload("shengguanok_status_file"); $shengguanok_status_file = fileIUpload("shengguanok_status_file");
// 工務助理
$outsourcer_contract_file = fileIUploads("outsourcer_contract_file");

15
wms/wipwhole-rec-invoice-edit-submit.php

@ -510,7 +510,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
} }
// 工務助理 // 工務助理
if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188'])) { if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188','M0117'])) {
$updatesql .= " $updatesql .= "
outsourcer_type = '$outsourcer_type', outsourcer_type = '$outsourcer_type',
install_outsourcer = '$install_outsourcer', install_outsourcer = '$install_outsourcer',
@ -535,8 +535,17 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!empty($plan_diagram_file)) { if (!empty($plan_diagram_file)) {
$updatesql .= "plan_diagram_file = '$plan_diagram_file', "; $updatesql .= "plan_diagram_file = '$plan_diagram_file', ";
$updatesql .= " $updatesql .= "
all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "<br/>上傳了安裝圖附件<br/><br/>',IF(all_remark IS NULL,'',all_remark)), all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "<br/>上傳了安裝圖附件<br/><br/>',IF(all_remark IS NULL,'',all_remark)),
"; ";
}
if (!empty($completion_acceptance_file)) {
$updatesql .= "completion_acceptance_file = '$completion_acceptance_file', ";
$updatesql .= "
all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "<br/>上傳了完工驗收單附件<br/><br/>',IF(all_remark IS NULL,'',all_remark)),
";
}
if (!empty($outsourcer_contract_file)) {
echo $updatesql .= "outsourcer_contract_file = '$outsourcer_contract_file', ";
} }
} }

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

@ -1,5 +1,5 @@
<?php <?php
ini_set('display_errors', 'on'); // ini_set('display_errors', 'on');
/** /**
* (新梯)流程規則: * (新梯)流程規則:
* 1. A:營業員確認中 生管建立大日程 (或是系統洗入) * 1. A:營業員確認中 生管建立大日程 (或是系統洗入)
@ -53,7 +53,7 @@ $pinzheng = getPinzhengStatus($link, $user_department_id, $role_id);
$tab = getTabNo($user_department_id); $tab = getTabNo($user_department_id);
// 工務助理 // 工務助理
if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188'])) { if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188', 'M0117'])) {
$warehouse2 = ""; $warehouse2 = "";
$tab = 5; $tab = 5;
} }
@ -1252,6 +1252,17 @@ include "wipwhole-rec-invoice-edit-submit.php";
<div id="tabs-5"> <div id="tabs-5">
<table class="table table-bordered" style="width:100%"> <table class="table table-bordered" style="width:100%">
<tbody style="font-weight: bolder;margin-bottom: 20px"> <tbody style="font-weight: bolder;margin-bottom: 20px">
<tr>
<td style="vertical-align: middle">QC及官檢類型</td>
<td>
<input type='radio' disabled <?php echo $row['qc_official_type'] == 'Q' ? "checked" : ""; ?> />
<label for='outsourcer_type_I'>只需QC</label>
<input type='radio' disabled <?php echo $row['qc_official_type'] == 'O' ? "checked" : ""; ?> />
<label for='outsourcer_type_T'>只需官檢</label>
<input type='radio' disabled <?php echo $row['qc_official_type'] == 'QO' ? "checked" : ""; ?> />
<label for='outsourcer_type_IT'>QC+官檢</label>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: middle">內部QC日</td> <td style="vertical-align: middle">內部QC日</td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
@ -1360,6 +1371,23 @@ include "wipwhole-rec-invoice-edit-submit.php";
?> ?>
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: middle;">合約上傳</td>
<td id="ocfi_td" style="vertical-align: middle;">
<button type="button" onclick="addOutsourcerContractFileItem()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;">+</button>
<input style="width:70%;display:inline;" type="file" id="outsourcer_contract_file_0" name="outsourcer_contract_file[]" multiple>
<button type="button" class="btn btn-danger" id="outsourcer_contract_file_del_0" onclick="delOutsourcerContractFileItem(0)">x</button>
<?php
if (!empty($row['outsourcer_contract_file'])) {
$outsourcer_contract_file_tmp = json_decode($row['outsourcer_contract_file']);
foreach ($outsourcer_contract_file_tmp as $val) {
echo "<br/><a style='color:#00F;' target='_blank' href='" . $val . "'>" . str_replace("public-wipwhole/", "", $val) . "</a>";
}
echo "</br>";
}
?>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: middle">安裝發包廠商</td> <td style="vertical-align: middle">安裝發包廠商</td>
<td> <td>
@ -1509,6 +1537,15 @@ include "wipwhole-rec-invoice-edit-submit.php";
?> ?>
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: middle;">完工驗收單附件</td>
<td colspan="5" style="vertical-align: middle;">
<input style="width:70%;display:inline;" type="file" name="completion_acceptance_file" <?= $warehouse2; ?>>
<?php
echo !empty($row['completion_acceptance_file']) ? "<a id='plan_diagram_file_a' style='color:#00F;' href='" . $row['completion_acceptance_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
</tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<?php <?php
@ -2057,4 +2094,18 @@ include "wipwhole-rec-invoice-edit-submit.php";
return resultDateString; return resultDateString;
} }
var ocfi_id = 0;
function addOutsourcerContractFileItem() {
ocfi_id++;
let html = "<input style='width:70%;display:inline;' type='file' id='outsourcer_contract_file_" + ocfi_id + "' name='outsourcer_contract_file[]' multiple>";
html += "<button type='button' class='btn btn-danger' id='outsourcer_contract_file_del_" + ocfi_id + "' onclick='delOutsourcerContractFileItem(" + ocfi_id + ")'>x</button>";
$("#ocfi_td").append(html);
}
function delOutsourcerContractFileItem(id) {
$("#outsourcer_contract_file_del_" + id).remove();
$("#outsourcer_contract_file_" + id).remove();
}
</script> </script>

13
wms/wipwhole-rec-invoice.php

@ -427,6 +427,9 @@ if ($department_id == "321" || $department_id == "220") {
// 已備齊檢查人 // 已備齊檢查人
$shengguanok_status_owner = postCheck('shengguanok_status_owner'); $shengguanok_status_owner = postCheck('shengguanok_status_owner');
// QC與官檢種類
$qc_official_type = postCheck('qc_official_type');
// 建立人 // 建立人
$creater = postCheck('creater'); $creater = postCheck('creater');
// 建立時間 // 建立時間
@ -520,6 +523,7 @@ if ($department_id == "321" || $department_id == "220") {
shengguanok_status_file, shengguanok_status_file,
shengguanok_status_at, shengguanok_status_at,
shengguanok_status_owner, shengguanok_status_owner,
qc_official_type,
creater, creater,
create_at create_at
) VALUES ( ) VALUES (
@ -607,6 +611,7 @@ if ($department_id == "321" || $department_id == "220") {
'$shengguanok_status_file', '$shengguanok_status_file',
'$shengguanok_status_at', '$shengguanok_status_at',
'$shengguanok_status_owner', '$shengguanok_status_owner',
'$qc_official_type',
'$creater', '$creater',
'$create_at' '$create_at'
) )
@ -776,6 +781,14 @@ if ($department_id == "321" || $department_id == "220") {
<td> <td>
<input class="form-control " type="date" include_once="real_contract_arrival_date" name="real_contract_arrival_date" value="<?php echo $real_contract_arrival_date; ?>"> <input class="form-control " type="date" include_once="real_contract_arrival_date" name="real_contract_arrival_date" value="<?php echo $real_contract_arrival_date; ?>">
</td> --> </td> -->
<td>
<input type="radio" name="qc_official_type" id='qc_official_type_QO' value='QO' checked/>
<label for="qc_official_type_QO">QC + 官檢</label>
<input type="radio" name="qc_official_type" id='qc_official_type_Q' value='Q' />
<label for="qc_official_type_Q">只需QC</label>
<input type="radio" name="qc_official_type" id='qc_official_type_O' value='O' ?>
<label for="qc_official_type_O">只需官檢</label>
</td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: middle">工地負責人</td> <td style="vertical-align: middle">工地負責人</td>

15
wms/wipwhole-renovate-rec-invoice-edit-submit.php

@ -490,7 +490,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
} }
// 工務助理 // 工務助理
if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188'])) { if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188', 'M0117'])) {
$updatesql .= " $updatesql .= "
outsourcer_type = '$outsourcer_type', outsourcer_type = '$outsourcer_type',
install_outsourcer = '$install_outsourcer', install_outsourcer = '$install_outsourcer',
@ -514,8 +514,17 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!empty($plan_diagram_file)) { if (!empty($plan_diagram_file)) {
$updatesql .= "plan_diagram_file = '$plan_diagram_file', "; $updatesql .= "plan_diagram_file = '$plan_diagram_file', ";
$updatesql .= " $updatesql .= "
all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "<br/>上傳了安裝圖附件<br/><br/>',IF(all_remark IS NULL,'',all_remark)), all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "<br/>上傳了安裝圖附件<br/><br/>',IF(all_remark IS NULL,'',all_remark)),
"; ";
}
if (!empty($completion_acceptance_file)) {
$updatesql .= "completion_acceptance_file = '$completion_acceptance_file', ";
$updatesql .= "
all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "<br/>上傳了完工驗收單附件<br/><br/>',IF(all_remark IS NULL,'',all_remark)),
";
}
if (!empty($outsourcer_contract_file)) {
$updatesql .= "outsourcer_contract_file = '$outsourcer_contract_file', ";
} }
} }

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

@ -50,7 +50,7 @@ $pinzheng = getPinzhengStatus($link, $user_department_id, $role_id);
$tab = getTabNo($user_department_id); $tab = getTabNo($user_department_id);
// 工務助理 // 工務助理
if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188'])) { if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188', 'M0117'])) {
$warehouse2 = ""; $warehouse2 = "";
$tab = 5; $tab = 5;
} }
@ -1246,6 +1246,17 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<div id="tabs-5"> <div id="tabs-5">
<table class="table table-bordered" style="width:100%"> <table class="table table-bordered" style="width:100%">
<tbody style="font-weight: bolder;margin-bottom: 20px"> <tbody style="font-weight: bolder;margin-bottom: 20px">
<tr>
<td style="vertical-align: middle">QC及官檢類型</td>
<td>
<input type='radio' disabled <?php echo $row['qc_official_type'] == 'Q' ? "checked" : ""; ?> />
<label for='outsourcer_type_I'>只需QC</label>
<input type='radio' disabled <?php echo $row['qc_official_type'] == 'O' ? "checked" : ""; ?> />
<label for='outsourcer_type_T'>只需官檢</label>
<input type='radio' disabled <?php echo $row['qc_official_type'] == 'QO' ? "checked" : ""; ?> />
<label for='outsourcer_type_IT'>QC+官檢</label>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: middle">內部QC日</td> <td style="vertical-align: middle">內部QC日</td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
@ -1356,6 +1367,23 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
?> ?>
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: middle;">合約上傳</td>
<td id="ocfi_td" style="vertical-align: middle;">
<button type="button" onclick="addOutsourcerContractFileItem()" class="btn btn-primary btn-lg pull-right" style="margin-left:3px;">+</button>
<input style="width:70%;display:inline;" type="file" id="outsourcer_contract_file_0" name="outsourcer_contract_file[]" multiple>
<button type="button" class="btn btn-danger" id="outsourcer_contract_file_del_0" onclick="delOutsourcerContractFileItem(0)">x</button>
<?php
if (!empty($row['outsourcer_contract_file'])) {
$outsourcer_contract_file_tmp = json_decode($row['outsourcer_contract_file']);
foreach ($outsourcer_contract_file_tmp as $val) {
echo "<br/><a style='color:#00F;' target='_blank' href='" . $val . "'>" . str_replace("public-wipwhole/", "", $val) . "</a>";
}
echo "</br>";
}
?>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: middle">安裝發包廠商</td> <td style="vertical-align: middle">安裝發包廠商</td>
<td> <td>
@ -1505,6 +1533,15 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
?> ?>
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: middle;">完工驗收單附件</td>
<td colspan="5" style="vertical-align: middle;">
<input style="width:70%;display:inline;" type="file" name="completion_acceptance_file" <?= $warehouse2; ?>>
<?php
echo !empty($row['completion_acceptance_file']) ? "<a id='plan_diagram_file_a' style='color:#00F;' href='" . $row['completion_acceptance_file'] . "' target='_blank'>下載附件</a>" : "";
?>
</td>
</tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<?php <?php
@ -2084,4 +2121,18 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
return resultDateString; return resultDateString;
} }
var ocfi_id = 0;
function addOutsourcerContractFileItem() {
ocfi_id++;
let html = "<input style='width:70%;display:inline;' type='file' id='outsourcer_contract_file_" + ocfi_id + "' name='outsourcer_contract_file[]' multiple>";
html += "<button type='button' class='btn btn-danger' id='outsourcer_contract_file_del_" + ocfi_id + "' onclick='delOutsourcerContractFileItem(" + ocfi_id + ")'>x</button>";
$("#ocfi_td").append(html);
}
function delOutsourcerContractFileItem(id) {
$("#outsourcer_contract_file_del_" + id).remove();
$("#outsourcer_contract_file_" + id).remove();
}
</script> </script>

14
wms/wipwhole-renovate-rec-invoice.php

@ -433,6 +433,9 @@ if ($department_id == "321" || $department_id == "220") {
// 已備齊檢查人 // 已備齊檢查人
$shengguanok_status_owner = postCheck('shengguanok_status_owner'); $shengguanok_status_owner = postCheck('shengguanok_status_owner');
// QC與官檢種類
$qc_official_type = postCheck('qc_official_type');
// 建立人 // 建立人
$creater = postCheck('creater'); $creater = postCheck('creater');
// 建立時間 // 建立時間
@ -526,6 +529,7 @@ if ($department_id == "321" || $department_id == "220") {
shengguanok_status_file, shengguanok_status_file,
shengguanok_status_at, shengguanok_status_at,
shengguanok_status_owner, shengguanok_status_owner,
qc_official_type,
creater, creater,
create_at create_at
) VALUES ( ) VALUES (
@ -614,6 +618,7 @@ if ($department_id == "321" || $department_id == "220") {
'$shengguanok_status_file', '$shengguanok_status_file',
'$shengguanok_status_at', '$shengguanok_status_at',
'$shengguanok_status_owner', '$shengguanok_status_owner',
'$qc_official_type',
'$creater', '$creater',
'$create_at' '$create_at'
) )
@ -850,7 +855,14 @@ if ($department_id == "321" || $department_id == "220") {
?> ?>
</select> </select>
</td> </td>
<td></td> <td>
<input type="radio" name="qc_official_type" id='qc_official_type_QO' value='QO' checked/>
<label for="qc_official_type_QO">QC + 官檢</label>
<input type="radio" name="qc_official_type" id='qc_official_type_Q' value='Q' />
<label for="qc_official_type_Q">只需QC</label>
<input type="radio" name="qc_official_type" id='qc_official_type_O' value='O' ?>
<label for="qc_official_type_O">只需官檢</label>
</td>
<td></td> <td></td>
</tr> </tr>
</thead> </thead>

Loading…
Cancel
Save