diff --git a/wms/contract/insertMi.php b/wms/contract/insertMi.php
index 10166533..70c2b079 100644
--- a/wms/contract/insertMi.php
+++ b/wms/contract/insertMi.php
@@ -160,7 +160,7 @@ foreach ($sheet->getRowIterator() as $key => $row) {
if (isset($_GET['miid'])) {
try {
- $quotation_no = 'Q2401002';
+ $quotation_no = 'Q2401003';
//VALUES (:elevator_type, :model_no, :min_weight, :max_weight, :min_speed, :max_speed, :min_floors, :max_floors, :base_floor, :purchase_cost, :material_plus, :design_hour, :export_fee, :equip_profit, :customs_shipping, :unloading, :transport_site, :install_price, :install_plus, :install_coef, :trial_price, :trial_plus, :trial_coef, :free1y, :crane, :wooden_box, :consume, :consumables, :option_price, :quotation_no, :create_at)";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':elevator_type', $elevator_type);
diff --git a/wms/contract/mi/mi1.xlsx b/wms/contract/mi/mi1.xlsx
new file mode 100644
index 00000000..7e576eb8
Binary files /dev/null and b/wms/contract/mi/mi1.xlsx differ
diff --git a/wms/contract/mi/mi2.xlsx b/wms/contract/mi/mi2.xlsx
new file mode 100644
index 00000000..7e210f2c
Binary files /dev/null and b/wms/contract/mi/mi2.xlsx differ
diff --git a/wms/contract/mi/mi3.xlsx b/wms/contract/mi/mi3.xlsx
new file mode 100644
index 00000000..bcd03819
Binary files /dev/null and b/wms/contract/mi/mi3.xlsx differ
diff --git a/wms/contract/mi/mi4.xlsx b/wms/contract/mi/mi4.xlsx
new file mode 100644
index 00000000..dd8e8903
Binary files /dev/null and b/wms/contract/mi/mi4.xlsx differ
diff --git a/wms/contract/mi/mi5.xlsx b/wms/contract/mi/mi5.xlsx
new file mode 100644
index 00000000..8f20e324
Binary files /dev/null and b/wms/contract/mi/mi5.xlsx differ
diff --git a/wms/contract/mi/mi6.xlsx b/wms/contract/mi/mi6.xlsx
new file mode 100644
index 00000000..a33212b1
Binary files /dev/null and b/wms/contract/mi/mi6.xlsx differ
diff --git a/wms/contract/mi/電梯設備MI資訊需求欄位(2).xlsx b/wms/contract/mi/電梯設備MI資訊需求欄位(2).xlsx
new file mode 100644
index 00000000..69bfc9b4
Binary files /dev/null and b/wms/contract/mi/電梯設備MI資訊需求欄位(2).xlsx differ
diff --git a/wms/contract/option/f1.xlsx b/wms/contract/option/f1.xlsx
new file mode 100644
index 00000000..0189dfe9
Binary files /dev/null and b/wms/contract/option/f1.xlsx differ
diff --git a/wms/contract/option/facility.xlsx b/wms/contract/option/facility.xlsx
new file mode 100644
index 00000000..929a328d
Binary files /dev/null and b/wms/contract/option/facility.xlsx differ
diff --git a/wms/contract/restoremi.php b/wms/contract/restoremi.php
new file mode 100644
index 00000000..1ff9154c
--- /dev/null
+++ b/wms/contract/restoremi.php
@@ -0,0 +1,151 @@
+getMessage());
+ }
+ // 獲取活動工作表
+$sheet = $spreadsheet->getActiveSheet();
+
+$status = "Y";
+$create_at = date('Y-m-d H:i:s');
+$sql_str = "INSERT INTO facility_price (kind, model, seat, numberofstop, speed, price, price_mi, status, create_dt)
+ VALUES (:kind, :model, :seat, :numberofstop, :speed, :price, :price_mi, :status, :create_at)";
+// 遍歷工作表中的每一行
+$inserttotal = 0;
+foreach ($sheet->getRowIterator() as $key => $row) {
+ // 獲得單元格迭代器
+ $cellIterator = $row->getCellIterator();
+ $cellIterator->setIterateOnlyExistingCells(false); // This loops through all cells,
+ // even if a cell value is not set.
+ // By default, only cells that have a value set will be iterated.
+ foreach ($cellIterator as $idx => $cell) {
+ if ($cell !== null) {
+ // 打印單元格數據
+ // echo $cell->getValue() . '///';
+ }
+ if ($idx == 'A') {
+ $model = $cell->getValue();
+ $kind = explode("-", $model)[0];
+ $seat = explode("*", explode("-", $model)[1])[0];
+ $numberofstop = explode("*", explode("-", $model)[1])[1];
+ $spec = explode("-", $model)[2];
+ if(stripos($spec, "09")){
+ $speed = 9;
+ }elseif(stripos($spec, "24")){
+ $speed = 24;
+ $openfn = str_replace("24", "", $spec);
+ }elseif(stripos($spec, "45")){
+ $speed = 45;
+ $openfn = str_replace("45", "", $spec);
+ }elseif(stripos($spec, "60")){
+ $speed = 60;
+ $openfn = str_replace("60", "", $spec);
+ }elseif(stripos($spec, "90")){
+ $speed = 90;
+ $openfn = str_replace("90", "", $spec);
+ }elseif(stripos($spec, "105")){
+ $speed = 105;
+ $openfn = str_replace("105", "", $spec);
+ }elseif(stripos($spec, "120")){
+ $speed = 120;
+ $openfn = str_replace("120", "", $spec);
+ }elseif(stripos($spec, "150")){
+ $speed = 150;
+ $openfn = str_replace("150", "", $spec);
+ }elseif(stripos($spec, "180")){
+ $speed = 180;
+ $openfn = str_replace("180", "", $spec);
+ }
+ $speed = trim($speed);
+ $openfn = trim($openfn);
+ echo "種類:".$kind;
+ echo "規格:".$model;
+ echo "人乘:".$seat;
+ echo "停數".$numberofstop;
+ echo "速度:".$speed;
+ echo "開門方式:" . $openfn;
+ } elseif($idx == "B"){
+ $price = (float)$cell->getValue() *10000;
+ echo "價錢:".$price;
+ }elseif($idx == "C"){
+ $add = (float)$cell->getValue() *10000;
+ echo "+-1停:".$add;
+ }elseif($idx == "D"){
+ $min_stop = $cell->getValue();
+ echo "最低停數:".$min_stop;
+ }
+ }
+ echo "------->
";
+ try{
+ for($i=2;$i<$numberofstop;$i++){
+ $stop = ($i <= $min_stop) ? $min_stop : $i;
+ echo $kind . "-" . $seat . "*" . $i . "-" . $openfn . $speed;
+ $new_model = $kind . "-" . $seat . "*" . $i . "-" . $openfn . $speed;
+ $calc_price = $price + $add * ($stop-$numberofstop);
+ echo "價錢:" . $calc_price;
+ //kind, :model, :seat, :numberofstop, :speed, :price, :price_mi, :status, :create_at
+ $stmt = $conn->prepare($sql_str);
+ $stmt->bindParam(':kind', $kind);
+ $stmt->bindParam(':model', $new_model);
+ $stmt->bindParam(':seat', $seat);
+ $stmt->bindParam(':numberofstop', $i);
+ $stmt->bindParam(':speed', $speed);
+ $stmt->bindParam(':price', $calc_price);
+ $stmt->bindParam(':price_mi', $calc_price);
+ $stmt->bindParam(':status', $status);
+ $stmt->bindParam(':create_at', $create_at);
+
+ $stmt->execute();
+ $inserttotal++;
+ echo "OK";
+ echo "
";
+ }
+ for($i=$numberofstop;$i<=30;$i++){
+ $stop = ($i <= $min_stop) ? $min_stop : $i;
+ $new_model = $kind . "-" . $seat . "*" . $i . "-" . $openfn . $speed;
+ echo $new_model;
+ $calc_price = $price + $add * ($stop-$numberofstop);
+ echo "價錢:" . $calc_price;
+
+ $stmt = $conn->prepare($sql_str);
+ $stmt->bindParam(':kind', $kind);
+ $stmt->bindParam(':model', $new_model);
+ $stmt->bindParam(':seat', $seat);
+ $stmt->bindParam(':numberofstop', $i);
+ $stmt->bindParam(':speed', $speed);
+ $stmt->bindParam(':price', $calc_price);
+ $stmt->bindParam(':price_mi', $calc_price);
+ $stmt->bindParam(':status', $status);
+ $stmt->bindParam(':create_at', $create_at);
+
+ $stmt->execute();
+ $inserttotal++;
+ echo "OK";
+ echo "
";
+ }
+ }
+ catch (PDOException $e) {
+ echo $e->getMessage();
+ die('Error!:' . $e->getMessage());
+ }
+
+ echo "
"; // 換行,以分隔不同的行
+
+
+}
+echo $inserttotal;
+
+}
+
diff --git a/wms/mkt/pricereview-check.php b/wms/mkt/pricereview-check.php
index 36aac6ea..ffcef2d6 100644
--- a/wms/mkt/pricereview-check.php
+++ b/wms/mkt/pricereview-check.php
@@ -316,6 +316,7 @@ foreach ($res as $data) {
}
return num;
}
+ let total_mi = 0;
function getMI(id) {
var formdata = new FormData();
formdata.append('pa', id);
@@ -328,9 +329,8 @@ foreach ($res as $data) {
//alert(data.err);
return false;
}
-
Object.keys(data.content).forEach(function(k) {
- console.log(data.content);
+ console.log('k=>', k);
//console.log(data.content[k][0]);
// 有值表示先前已寫入MI
if ($("#tb1").find("input[name=mi_fix]").eq(k).val() == "") {
@@ -340,6 +340,7 @@ foreach ($res as $data) {
}
$("#tb1").find("input[name=mi_fix]").eq(k).keyup();
var mihtml = "";
+ total_mi = 0;
mihtml += "