diff --git a/wms/excel-upload.php b/wms/excel-upload.php index 222c585b..f9f1bece 100644 --- a/wms/excel-upload.php +++ b/wms/excel-upload.php @@ -3,6 +3,7 @@ include "header.php"; require_once 'PHPExcel/PHPExcel.php'; require_once 'PHPExcel/IOFactory.php'; + $file_name = $_FILES["fileToUpload"]["name"]; $temp_file_name = $_FILES["fileToUpload"]["tmp_name"]; $target_dir = "excel-uploads/"; diff --git a/wms/mkt/assets/js/alpine.js b/wms/mkt/assets/js/alpine.js index adbed315..1f8a2f52 100644 --- a/wms/mkt/assets/js/alpine.js +++ b/wms/mkt/assets/js/alpine.js @@ -199,6 +199,7 @@ const pricereviewOptionSelect = () => { init() { this.optionCategory = 0 this.initButtons(); + this.renderTbody(); console.log(this.options) }, options: options, @@ -253,35 +254,40 @@ const pricereviewOptionSelect = () => { }, optionSubCategory: 1, changeCategory(category, subcategory = 0) { + console.log(this.$refs.selectModalBody); + this.initButtons(category) this.kind = (category == 'sub') ? this.kind : category; - if (subcategory != 0) { this.subkind = subcategory } else { this.subkind = 0 } - if (category == 0) { this.kind = 0; this.subkind = 0; } - this.initButtons(category) + 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(); return; } this.options = this.orioptions.filter(option => option.kind == this.kind && option.subkind == this.subkind) + this.renderTbody(); }, searchOptions(e) { + e = null; this.reloadOptions(); - let val = e.target.value.toLowerCase() + let val = (e== null) ? this.searchtext : e.target.value.toLowerCase() this.options = (this.options).filter(option=>{ if(option.group_name == null) option.group_name = '' if(option.spec == null) option.spec = '' @@ -290,6 +296,26 @@ const pricereviewOptionSelect = () => { 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) }) + }, + renderTbody() { + return + console.log(this.options); + this.$refs.selectModalBody; + let html = ""; + for (let i = 0; i < this.options.length; i++) { + html += "
diff --git a/wms/mkt/pricereview-create.php b/wms/mkt/pricereview-create.php index 001144b2..8853257f 100644 --- a/wms/mkt/pricereview-create.php +++ b/wms/mkt/pricereview-create.php @@ -753,17 +753,9 @@ $option_str .= " |