From 776c9faa11535178e094c687765b7ecd7c937ce1 Mon Sep 17 00:00:00 2001 From: 10994015 Date: Tue, 23 Jan 2024 10:25:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E6=A2=AF=E5=83=B9=E5=AF=A9=E5=94=AE?= =?UTF-8?q?=E5=83=B9=E3=80=81=E5=88=A9=E6=BD=A4=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/frame/pending.php | 195 ++++++++++++++------------------- wms/mkt/assets/js/alpine.js | 56 ++++------ wms/mkt/pricereview-check.php | 20 ++-- wms/mkt/pricereview-create.php | 10 +- wms/mkt/pricereview_mi-api.php | 8 +- 5 files changed, 132 insertions(+), 157 deletions(-) diff --git a/wms/frame/pending.php b/wms/frame/pending.php index c98d40df..10a142dd 100644 --- a/wms/frame/pending.php +++ b/wms/frame/pending.php @@ -3,134 +3,107 @@ $token = $_REQUEST["token"]; ?> - - - - 待我簽核 - - - - - + + +待我簽核 + + + + + -
-
-
- -
-
-
-
- - - - 待我簽核 -
-
-
- Loading... -
-
+
+
+ +
+
+
+
+ 待我簽核
+
+
+ Loading...
-
- -
+
+ +
+ +
- + }) +} + - \ No newline at end of file diff --git a/wms/mkt/assets/js/alpine.js b/wms/mkt/assets/js/alpine.js index 1f8a2f52..d28a3f3f 100644 --- a/wms/mkt/assets/js/alpine.js +++ b/wms/mkt/assets/js/alpine.js @@ -199,8 +199,6 @@ const pricereviewOptionSelect = () => { init() { this.optionCategory = 0 this.initButtons(); - this.renderTbody(); - console.log(this.options) }, options: options, orioptions: options, @@ -254,7 +252,7 @@ const pricereviewOptionSelect = () => { }, optionSubCategory: 1, changeCategory(category, subcategory = 0) { - console.log(this.$refs.selectModalBody); + // console.log(this.$refs.selectModalBody); this.initButtons(category) this.kind = (category == 'sub') ? this.kind : category; if (subcategory != 0) { @@ -269,54 +267,48 @@ const pricereviewOptionSelect = () => { this.searchtext = "" this.reloadOptions(); + }, reloadOptions() { if (this.kind == 0) { this.options = this.orioptions - this.renderTbody(); return; } if (this.subkind == 0) { - this.options = this.orioptions.filter(option => option.kind == this.kind) - this.renderTbody(); + this.options.forEach(option =>{ + if (option.kind == this.kind) { + option.status = "Y" + }else{ + option.status = "H" + } + }) return; } - this.options = this.orioptions.filter(option => option.kind == this.kind && option.subkind == this.subkind) - this.renderTbody(); + this.options.forEach(option => { + if(option.kind == this.kind && option.subkind == this.subkind){ + option.status = "Y" + }else{ + option.status = "H" + } + }) }, searchOptions(e) { e = null; + this.options = this.orioptions this.reloadOptions(); - let val = (e== null) ? this.searchtext : e.target.value.toLowerCase() - this.options = (this.options).filter(option=>{ + let val = (e== null) ? this.searchtext.toLowerCase() : e.target.value.toLowerCase() + this.options.forEach(option=>{ if(option.group_name == null) option.group_name = '' if(option.spec == null) option.spec = '' if(option.memo == null) option.memo = '' if(option.price == null) option.price = 0 if(option.unit == null) option.unit = '' - return option.group_name.includes(val) || option.memo.toLowerCase().includes(val) || option.spec.toLowerCase().includes(val) || option.unit.includes(val) || String(option.price).includes(val) + if(option.group_name.includes(val) || option.memo.toLowerCase().includes(val) || option.spec.toLowerCase().includes(val) || option.unit.includes(val) || String(option.price).includes(val)){ + option.status = "Y" + }else{ + option.status = "N" + } }) }, - renderTbody() { - return - console.log(this.options); - this.$refs.selectModalBody; - let html = ""; - for (let i = 0; i < this.options.length; i++) { - html += "" - html += "" + this.options[i].id + "" - html += "" + this.options[i].group_name + "" - html += "" + this.options[i].spec + "" - html += "" + this.options[i].memo + "" - html += "" + this.options[i].optional + "" - html += "" + this.options[i].unit + "" - html += "" + this.options[i].price + "" - html += ""; - } - - this.$refs.selectModalBody.innerHTML = html; - - } - } } \ No newline at end of file diff --git a/wms/mkt/pricereview-check.php b/wms/mkt/pricereview-check.php index f5667028..e7f745e4 100644 --- a/wms/mkt/pricereview-check.php +++ b/wms/mkt/pricereview-check.php @@ -325,12 +325,9 @@ foreach ($res as $data) { xhr.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { data = JSON.parse(this.responseText); - console.log('123'); - + console.log(data); //console.log(data);return false; if (data.st == 'err') { - console.log('123'); - //alert(data.err); return false; } @@ -346,8 +343,6 @@ foreach ($res as $data) { let a = data.content[k][0] + data.content[k][19][1]; $("#tb1").find("input[name=mi_fix]").eq(k).val(commafy(a)); } - console.log('123'); - let a = data.content[k][0] + data.content[k][19][1]; $("#tb1").find("input[name=mi_fix]").eq(k).val(commafy(a)); var mihtml = ""; @@ -368,7 +363,7 @@ foreach ($res as $data) { console.log(data.content[k][12]); Object.keys(data.content[k][14]).forEach(function(m) { if (data.content[k][14][m][0] != '') { - mihtml += "
  • " + data.content[k][14][m][0] + ":" + commafy(data.content[k][14][m][1]) + "
  • "; + mihtml += "
  • " + data.content[k][14][m][0].replace("<br>", "").replace("&", "").replace("amp;", "").replace("()", "").replace(/\s+/g, '') + ":" + commafy(data.content[k][14][m][1]) + "
  • "; } }); Object.keys(data.content[k][16]).forEach(function(m) { @@ -382,9 +377,16 @@ foreach ($res as $data) { mihtml += "
  • " + data.content[k][19][0] + ":" + commafy(data.content[k][19][1]) + "
  • "; mihtml += "以上合計:" + commafy(data.content[k][13]) + "
    "; + total_mi += data.content[k][13]; + + + if(total_mi == ""){ + console.log("undefided!!!"); + } $("#tb1").find("tr[name=facil_templ2]").eq(k).find('td').eq(1).html(mihtml); //$("#tb1").find("input[name=mi_fix]").eq(k).closest('td').append(mihtml); document.getElementsByClassName('total_mi_fix')[k].value = commafy(total_mi) + // document.getElementsByClassName('item_price_ct')[k].value =commafy(total_mi) document.getElementsByClassName('gross_profit')[k].value = commafy(Number(document.getElementsByClassName('item_price_ct')[k].value.replace(/[,]+/g, "")) - total_mi) document.getElementsByClassName('gross_profit_rate')[k].value = Math.round((Number(document.getElementsByClassName('gross_profit')[k].value.replace(/[,]+/g, "")) / Number(document.getElementsByClassName('item_price_ct')[k].value.replace(/[,]+/g, "")) * 100) * 10) / 10 @@ -587,8 +589,8 @@ foreach ($res as $data) { "> "> - " disabled> - "> + " disabled> + "> diff --git a/wms/mkt/pricereview-create.php b/wms/mkt/pricereview-create.php index 8853257f..44711793 100644 --- a/wms/mkt/pricereview-create.php +++ b/wms/mkt/pricereview-create.php @@ -146,7 +146,7 @@ if ($last_pr_arr) { // Option Data $opt_data_arr = []; $opt_kind_arr = ["A" => "小電梯型錄選配加價報價", "B" => "客梯型錄選配加價報價", "C" => "550-1600kg選配業務報價", "D" => "其它"]; -$sql = "select * from option_price where status = 'Y' order by kind, id"; +$sql = "select * from option_price where status = 'Y' order by id"; $res = mysqli_query($link, $sql); while ($row = mysqli_fetch_assoc($res)) { $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["spec"] = $row["spec"]; @@ -753,10 +753,12 @@ $option_str .= ""; $("#optionModal").modal('show'); var jobj = $(this); // 父視窗 - $("#optionModal .modal-body td").off().click(function(){ + $("#optionModal .modal-body td").unbind().click(function(){ var pobj = $(this).closest('td').parent(); selectOptionFn(pobj, jobj) }); + + $('#tb2').unbind('focus', 'tr[name=option_templ] a[name=option_href]'); }); $("#optionFaciModal").on("hidden.bs.modal", function() { $("#optionFaciModal .modal-body").html(''); @@ -868,7 +870,7 @@ $option_str .= ""; }); $("input[name=pay_scale]").keyup(function() { - $(this).closest('td').next('td').find('input[name=pay_amount]').val(commafy(($("#price_total").val().replace(/[,]+/g, "") / 100 * $(this).val()).toFixed(0))); + $(this).closest('td').next('td').find('input[nam e=pay_amount]').val(commafy(($("#price_total").val().replace(/[,]+/g, "") / 100 * $(this).val()).toFixed(0))); var payAllScale = 0; var payAllAmt = 0; $("input[name=pay_scale]").each(function() { @@ -1275,7 +1277,7 @@ $options = $stmt->fetchAll(PDO::FETCH_ASSOC);