Browse Source

蘇孝倫:

江協理好:麻煩請開各區工事經理能輸入"移交日"的權限,麻煩新增輸入儲存後有MAIL通知營業人員!
gary
gary_chen\gary_chen 1 year ago
parent
commit
c22e918547
  1. 84
      wms/wipwhole-rec-invoice-edit-submit.php
  2. 45
      wms/wipwhole-rec-invoice-edit.php
  3. 42
      wms/wipwhole-renovate-rec-invoice-edit-submit.php
  4. 45
      wms/wipwhole-renovate-rec-invoice-edit.php

84
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;

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

@ -497,7 +497,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<textarea class="form-control disabled_select" name="marketing_remark" <?= $marketing; ?>><?php echo $row['marketing_remark']; ?></textarea>
</td>
</tr>
<tr>
<!-- <tr>
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
@ -518,7 +518,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
</td>
</tr>
</tr> -->
<tr>
<td colspan="8">
<input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>">
@ -1058,6 +1058,28 @@ include "wipwhole-rec-invoice-edit-submit.php";
</select>
</td>
</tr>
<tr>
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control disabled_select" type="date" id="delivery_date_tmp" value="<?= $row['delivery_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
</span>
<input type="hidden" id="old_delivery_date_tmp" value="<?= $row['delivery_date']; ?>">
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="delivery_date_owner_tmp" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?>
</select>
</td>
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
</td>
</tr>
<tr>
<td colspan="4">
<?php
@ -1912,6 +1934,12 @@ include "wipwhole-rec-invoice-edit-submit.php";
<input type="hidden" id="tryrun_start_date_owner" name='tryrun_start_date_owner' value="<?php echo $row['tryrun_start_date_owner']; ?>" />
<input type="hidden" id="tryrun_end_date" name='tryrun_end_date' value="<?php echo $row['tryrun_end_date']; ?>" />
<input type="hidden" id="tryrun_end_date_owner" name='tryrun_end_date_owner' value="<?php echo $row['tryrun_end_date_owner']; ?>" />
<input type="hidden" id="delivery_date" name='delivery_date' value="<?php echo $row['delivery_date']; ?>" />
<input type="hidden" id="old_delivery_date" name='old_delivery_date' value="<?php echo $row['delivery_date']; ?>" />
<input type="hidden" id="delivery_date_owner" name='delivery_date_owner' value="<?php echo $row['delivery_date_owner']; ?>" />
<input type="hidden" id="facilityno" name='facilityno' value="<?php echo $row['facilityno']; ?>" />
<input type="hidden" id="contractno" name='contractno' value="<?php echo $row['contractno']; ?>" />
<input type="hidden" name='salesid' value="<?php echo $row['salesid']; ?>" />
<input type="hidden" name='form_name' value="update_install_date_form" />
</form>
<form method="post" id="update_shengguan_form" enctype="multipart/form-data">
@ -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();
}
}

42
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' ";

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

@ -550,6 +550,28 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
</select>
</td>
</tr>
<tr>
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
<input class="form-control disabled_select" type="date" id="delivery_date_tmp" value="<?= $row['delivery_date']; ?>" <?= $warehouse2; ?>>
<span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#delivery_date_tmp").val("");' <?= $warehouse2; ?>>清除</button>
</span>
<input type="hidden" id="old_delivery_date_tmp" value="<?= $row['delivery_date']; ?>">
</div>
</td>
<td style="vertical-align: middle">確認人</td>
<td>
<select class="disabled_select" id="delivery_date_owner_tmp" disabled>
<option value="">請選擇</option>
<?php echo getSelectOptionHtml($all_users_options, $row['delivery_date_owner']); ?>
</select>
</td>
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
</td>
</tr>
<tr>
<td colspan="4">
<?php
@ -777,7 +799,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td colspan="7">
<textarea class="form-control " name="marketing_remark" <?= $marketing; ?>><?php echo $row['marketing_remark']; ?></textarea>
</tr>
<tr>
<!-- <tr>
<td style="vertical-align: middle">移交日</td>
<td style="vertical-align: middle">
<div class="input-group">
@ -798,7 +820,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td colspan='4'>
<span class="text-danger">有官檢日或QC合格日後才可填寫</span>
</td>
</tr>
</tr> -->
<tr>
<td colspan="8">
<input class="form-control " type="hidden" name="creater" value="<?= $user_id; ?>">
@ -1907,6 +1929,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<input type="hidden" id="tryrun_start_date_owner" name='tryrun_start_date_owner' value="<?php echo $row['tryrun_start_date_owner']; ?>" />
<input type="hidden" id="tryrun_end_date" name='tryrun_end_date' value="<?php echo $row['tryrun_end_date']; ?>" />
<input type="hidden" id="tryrun_end_date_owner" name='tryrun_end_date_owner' value="<?php echo $row['tryrun_end_date_owner']; ?>" />
<input type="hidden" id="delivery_date" name='delivery_date' value="<?php echo $row['delivery_date']; ?>" />
<input type="hidden" id="old_delivery_date" name='old_delivery_date' value="<?php echo $row['delivery_date']; ?>" />
<input type="hidden" id="delivery_date_owner" name='delivery_date_owner' value="<?php echo $row['delivery_date_owner']; ?>" />
<input type="hidden" id="facilityno" name='facilityno' value="<?php echo $row['facilityno']; ?>" />
<input type="hidden" id="contractno" name='contractno' value="<?php echo $row['contractno']; ?>" />
<input type="hidden" name='salesid' value="<?php echo $row['salesid']; ?>" />
<input type="hidden" name='form_name' value="update_install_date_form" />
</form>
<form method="post" id="update_shengguan_form" enctype="multipart/form-data">
@ -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();
}
}

Loading…
Cancel
Save