From 56218c35d20b91336319971a796f1b0db80c7502 Mon Sep 17 00:00:00 2001 From: 10994015 Date: Wed, 3 Jan 2024 11:11:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=83=B9=E5=AF=A9=E6=96=B0=E6=A2=AF=E3=80=81ap?= =?UTF-8?q?i=E4=BF=AE=E6=AD=A30103?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/contract/api/postContractNewApplyData.php | 4 +- wms/contract/contract-new-apply.php | 61 +++++++++---------- wms/contract/insertData.php | 7 ++- wms/contract/js/alpine.js | 14 +++-- wms/mkt/pricereview-check.php | 22 ++++++- wms/mkt/pricereview-create.php | 40 ++++++++++-- wms/mkt/pricereview-edit.php | 7 +-- wms/mkt/pricereview_mi-api.php | 2 +- 8 files changed, 105 insertions(+), 52 deletions(-) diff --git a/wms/contract/api/postContractNewApplyData.php b/wms/contract/api/postContractNewApplyData.php index 3d47b856..e3ec18e5 100644 --- a/wms/contract/api/postContractNewApplyData.php +++ b/wms/contract/api/postContractNewApplyData.php @@ -31,6 +31,7 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == $contact_address = $_POST['address']; $workdeadline_a = $_POST['workdeadline_a']; $workdeadline_b = $_POST['workdeadline_b']; + $workdeadline_note = $_POST['workdeadline_note']; $test_time = $_POST['regulations']; $freedeadline = $_POST['freedeadline']; $trade_address = $_POST['tradeaddress']; @@ -162,7 +163,7 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == header("HTTP/1.1 201 success!"); $conn->commit(); } else { - $sql_str = "UPDATE contract_new_apply SET status = :status, apply_date=:apply_date, apply_type=:apply_type, case_name=:case_name, customer=:customer, manager=:manager, vat=:vat, total_price=:total_price, total_items=:total_items, buy_fee=:buy_fee, install_fee=:install_fee, contact_address=:contact_address, trade_address=:trade_address, workdeadline_a=:workdeadline_a, workdeadline_b=:workdeadline_b, test_time=:test_time, freedeadline=:freedeadline, trade_address=:trade_address, trade_address=:trade_address, tradedeadline=:tradedeadline, secondPayDeadline=:secondPayDeadline, progress=:progress, person=:person, personname=:personname, submit_date=:submit_date, updated_at=:updated_at, updated_by=:updated_by, description=:description WHERE mid = :mid"; + $sql_str = "UPDATE contract_new_apply SET status = :status, apply_date=:apply_date, apply_type=:apply_type, case_name=:case_name, customer=:customer, manager=:manager, vat=:vat, total_price=:total_price, total_items=:total_items, buy_fee=:buy_fee, install_fee=:install_fee, contact_address=:contact_address, trade_address=:trade_address, workdeadline_a=:workdeadline_a, workdeadline_b=:workdeadline_b, workdeadline_note=:workdeadline_note, test_time=:test_time, freedeadline=:freedeadline, trade_address=:trade_address, trade_address=:trade_address, tradedeadline=:tradedeadline, secondPayDeadline=:secondPayDeadline, progress=:progress, person=:person, personname=:personname, submit_date=:submit_date, updated_at=:updated_at, updated_by=:updated_by, description=:description WHERE mid = :mid"; $stmt = $conn->prepare($sql_str); $stmt->bindParam(':mid', $mid); $stmt->bindParam(':status', $status); @@ -179,6 +180,7 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == $stmt->bindParam(':contact_address', $contact_address); $stmt->bindParam(':workdeadline_a', $workdeadline_a); $stmt->bindParam(':workdeadline_b', $workdeadline_b); + $stmt->bindParam(':workdeadline_note', $workdeadline_note); $stmt->bindParam(':test_time', $test_time); $stmt->bindParam(':freedeadline', $freedeadline); $stmt->bindParam(':trade_address', $trade_address); diff --git a/wms/contract/contract-new-apply.php b/wms/contract/contract-new-apply.php index 1bdeef66..a9b53fbf 100644 --- a/wms/contract/contract-new-apply.php +++ b/wms/contract/contract-new-apply.php @@ -140,7 +140,7 @@ $person = $contract['person']; - 統一編號 + 統一編號/身分證字號

未填寫

@@ -198,27 +198,20 @@ $person = $contract['person'];

未填寫

- 完工期限 + 免保期限 -
-
- 貨抵工地 -
- -
- 天內安裝完成,甲方應於貨底工地前 -
- -
- 天完成並整理完善。 +
+ +
+ 個月 +
-
- -

未填寫

+

未填寫

+ - 附則 + + 完工期限 + +
+
+ 乙方應於貨抵工地後每台
-

未填寫

+ +
+ 日內安裝完成 +
+
+
+ +

未填寫

@@ -255,7 +253,7 @@ $person = $contract['person'];
圖色確認第
- +
天出貨
@@ -288,15 +286,14 @@ $person = $contract['person'];

-

未填寫

+

未填寫

-

未填寫

-

未填寫

+

未填寫

@@ -633,11 +630,12 @@ $person = $contract['person']; const pays = [...]; const secondPayDeadline = ''; const tradeaddress = ''; - const tradedeadline = 90 + const tradedeadline = 180 const freedeadline = 18; const regulations = 10; const workdeadline_a = 60; const workdeadline_b = 7; + const workdeadline_note = ''; const total_items = ; const isFirst = ; const originfiles = []; @@ -670,6 +668,7 @@ $person = $contract['person']; const regulations = ''; const workdeadline_a = ''; const workdeadline_b = ''; + const workdeadline_note = ''; const secondPayDeadline = ; const total_items = ; const contract_new_apply_id = ; diff --git a/wms/contract/insertData.php b/wms/contract/insertData.php index 6e1ac68c..aa7e4bf6 100644 --- a/wms/contract/insertData.php +++ b/wms/contract/insertData.php @@ -46,10 +46,13 @@ foreach ($sheet->getRowIterator() as $key => $row) { $memo = $cell->getValue(); echo $memo; } elseif ($idx == 'E') { + $optional = ''; if ($cell->getValue() == "標配") { $optional = 1; - } else { + } else if($cell->getValue() == "選配") { $optional = 2; + }else if($cell->getValue() == "加價") { + $optional = 3; } echo $optional; } elseif ($idx == 'F') { @@ -137,7 +140,7 @@ foreach ($sheet->getRowIterator() as $key => $row) { $option_price_id = $last_id; $option_price = $cost; - $quotation_no = 'Q2311001'; + $quotation_no = 'Q2401001'; foreach ($open_kind_arr as $kind) { $min_weight = 1; $max_weight = 1600; diff --git a/wms/contract/js/alpine.js b/wms/contract/js/alpine.js index 8b4ff44d..5204d504 100644 --- a/wms/contract/js/alpine.js +++ b/wms/contract/js/alpine.js @@ -1202,6 +1202,7 @@ const contractNewApply = () => { address: address, workdeadline_a: workdeadline_a, //完工期限: 幾天內安裝完成,預設30 workdeadline_b: workdeadline_b, //完工期限: 幾天內整理完善,預設7 + workdeadline_note: workdeadline_note, regulations: regulations, //附則 freedeadline: freedeadline, //免保期限(月) tradeaddress: tradeaddress, //交貨地點 @@ -1270,10 +1271,7 @@ const contractNewApply = () => { alert('試車時間不能低於10天') return; } - if (this.data.workdeadline_a < 30) { - alert('安裝時間不能低於30天') - return; - } + this.isLoading = true const form = new FormData(); form.append('mid', this.data.mid); @@ -1293,6 +1291,7 @@ const contractNewApply = () => { form.append('address', this.data.address); form.append('workdeadline_a', this.data.workdeadline_a); form.append('workdeadline_b', this.data.workdeadline_b); + form.append('workdeadline_note', this.data.workdeadline_note); form.append('regulations', this.data.regulations); form.append('freedeadline', this.data.freedeadline); form.append('tradeaddress', this.data.tradeaddress); @@ -1333,8 +1332,10 @@ const contractNewApply = () => { return; } if (this.data.workdeadline_a < 30) { - alert('安裝時間不能低於30天') - return; + while(this.data.workdeadline_note=='') { + this.data.workdeadline_note = prompt('安裝時間需低於30天,請說明原因') + } + } this.isLoading = true const form = new FormData(); @@ -1355,6 +1356,7 @@ const contractNewApply = () => { form.append('address', this.data.address); form.append('workdeadline_a', this.data.workdeadline_a); form.append('workdeadline_b', this.data.workdeadline_b); + form.append('workdeadline_note', this.data.workdeadline_note); form.append('regulations', this.data.regulations); form.append('freedeadline', this.data.freedeadline); form.append('tradeaddress', this.data.tradeaddress); diff --git a/wms/mkt/pricereview-check.php b/wms/mkt/pricereview-check.php index a8ff9a1d..37d899bb 100644 --- a/wms/mkt/pricereview-check.php +++ b/wms/mkt/pricereview-check.php @@ -263,6 +263,7 @@ foreach ($res as $data) { //alert(data.err); return false; } + console.log(data.content); Object.keys(data.content).forEach(function(k) { //console.log(data.content[k][0]); // 有值表示先前已寫入MI @@ -283,11 +284,16 @@ foreach ($res as $data) { mihtml += "以上合計:" + commafy(data.content[k][12]) + "/台"; mihtml += "
"; mihtml += "
OPTION
"; + console.log(data.content[k]); Object.keys(data.content[k][14]).forEach(function(m) { - mihtml += "
  • " + data.content[k][14][m][0] + ":" + commafy(data.content[k][14][m][1]) + "
  • "; + if(data.content[k][14][m][0] != '') { + mihtml += "
  • " + data.content[k][14][m][0] + ":" + commafy(data.content[k][14][m][1]) + "
  • "; + } }); Object.keys(data.content[k][16]).forEach(function(m) { - mihtml += "
  • " + data.content[k][16][m][0] + ":" + commafy(data.content[k][16][m][1]) + "
  • "; + if(data.content[k][16][m][0] != ''){ + mihtml += "
  • " + data.content[k][16][m][0] + ":" + commafy(data.content[k][16][m][1]) + "
  • "; + } }); Object.keys(data.content[k][18]).forEach(function(m) { mihtml += "
  • " + data.content[k][18][m][0] + ":" + commafy(data.content[k][18][m][1]) + "
  • "; @@ -548,7 +554,12 @@ foreach ($res as $data) { $val) { + if($val['item_qty'] <= 0){ + continue; + } + $total_qty = $total_qty + $val['item_qty']; $item_amt_B_all += $val["item_price_bp"]; ?> @@ -564,10 +575,12 @@ foreach ($res as $data) { $idx++; } ?> + 0): ?> 小計 +
    @@ -923,8 +936,11 @@ foreach ($res as $data) { + - +
    diff --git a/wms/mkt/pricereview-create.php b/wms/mkt/pricereview-create.php index 6680345a..383aa7db 100644 --- a/wms/mkt/pricereview-create.php +++ b/wms/mkt/pricereview-create.php @@ -1,6 +1,6 @@ '; +$option_str .= '
    '; $option_str .= ' @@ -1018,6 +1019,12 @@ $(function(){ +prepare($sql_str); +$stmt->execute(); +$options = $stmt->fetchAll(PDO::FETCH_ASSOC); +?>
    名稱
    + + + + + + + + + + + + + + + + + + + + + + +
    名稱規格備註配置單位定價
    123456
    @@ -2162,8 +2192,10 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) { + +
    diff --git a/wms/mkt/pricereview-edit.php b/wms/mkt/pricereview-edit.php index dd8cba7d..d4361dbe 100644 --- a/wms/mkt/pricereview-edit.php +++ b/wms/mkt/pricereview-edit.php @@ -1732,11 +1732,10 @@ $(function(){ + - -
    $row_om["base_floor"]) ? ($v["floors"] - $row_om["base_floor"])*$row_om["base_floor_plus"] : 0; // 特例 if ($opt_elev_arr[$val]["price_id"] == "256" && ($v["floors"] < $row_om["base_floor"])) $row_om["price"] = 9815; @@ -287,7 +288,6 @@ try { $j++; } } - // 保固延長 $mnarr = []; $mn_fee = $j = 0;