diff --git a/wms/cont/MICalculator.php b/wms/cont/MICalculator.php index 04bce2bb..8b087582 100644 --- a/wms/cont/MICalculator.php +++ b/wms/cont/MICalculator.php @@ -284,7 +284,7 @@ class MICalculator and maintain_kind='" . $item['maintain_kind'] . "' and is_m1_bundle='" . $item['is_m1_bundle'] . "' "; - echo $sql_get_price; + // echo $sql_get_price; list($row) = DB::result($sql_get_price); if (empty($row)) return self::error(); diff --git a/wms/cont/MSCalculator.php b/wms/cont/MSCalculator.php index a5415e76..7aabafcc 100644 --- a/wms/cont/MSCalculator.php +++ b/wms/cont/MSCalculator.php @@ -1,322 +1,322 @@ - 'fail', - 'message' => '無此項目,請聯係業務部創建標準成本' - ]; - } - public function success($price) - { - return [ - 'status' => 'ok', - 'price' => $price - ]; - } -} + 'fail', + 'message' => '無此項目,請聯係業務部創建標準成本' + ]; + } + public function success($price) + { + return [ + 'status' => 'ok', + 'price' => $price + ]; + } +} diff --git a/wms/cont/apply_form.php b/wms/cont/apply_form.php index 1046d832..a36f155f 100644 --- a/wms/cont/apply_form.php +++ b/wms/cont/apply_form.php @@ -260,6 +260,12 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' | } ?> + @@ -431,7 +437,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' | is_m1_bundle } setStandPrice(param1, element); - //console.info(param1); + // console.log(param1); }); @@ -494,16 +500,33 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' | dataType: 'json', //success: function(data) {}, success: function(data) { - // console.info(data); + console.log(data.price); if (data.status == 'ok') { $(obj).val(data.price); } else { $(obj).val(data.message); + } + if (data.message == '無此項目,請聯係業務部創建標準成本') { + console.log('1'); + // $("button[name^=btn_save]").attr('disabled', true); + // $("button[name^=btn_save]").css('cursor', 'not-allowed') + $("#submit").css('background-color', '#666') + document.querySelector('#submit').classList.add('disabled') + document.querySelector('#submit').disabled = true + } + if (data.price) { + document.querySelector('#submit').classList.remove('disabled') + document.querySelector('#submit').disabled = false + $("#submit").css('background-color', '#007bff') + // $("button[name^=btn_save]").attr('disabled', false); + // $("button[name^=btn_save]").css('cursor', 'default') + // $("button[name^=btn_save]").css('background-color', '#666') } } }); + } addNewBrand = function() { var new_brand = $("#new_brand").val(); @@ -529,6 +552,13 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' | } } + + $("input[name^='stand_price']").bind('input propertychang', function() { + if ($("input[name^='stand_price']").val() == '') { + console.log('無值'); + $("button[name^=btn_save]").attr('disabled', true); + } + }); @@ -711,7 +741,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
'; -// print_r($data); -// echo ''; -// echo '1'; + ?> @@ -92,11 +89,97 @@ if ($data) : } ?> - + + + +