From 1074ee6896ec63a7b8af5df8e037a895b9817e63 Mon Sep 17 00:00:00 2001 From: Cheng Date: Wed, 20 Dec 2023 18:07:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E9=A4=8A=E5=A5=91=E7=B4=84=E5=83=B9?= =?UTF-8?q?=E6=A0=BC=E5=AF=A9=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/cont/MICalculator.php | 2 +- wms/cont/MSCalculator.php | 644 +++++++++++++++++++------------------- wms/cont/apply_form.php | 36 ++- wms/cont/query_form.php | 4 +- wms/cont/sign_list.php | 169 +++++++--- wms/cont/t.php | 168 +++++----- 6 files changed, 573 insertions(+), 450 deletions(-) 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' |
  - +
diff --git a/wms/cont/query_form.php b/wms/cont/query_form.php index cba779c1..f3495f14 100644 --- a/wms/cont/query_form.php +++ b/wms/cont/query_form.php @@ -276,8 +276,8 @@ function base_url($url) FormHelper::select("$key", $val['options'], $fieldVal, $val['attr']) : FormHelper::tag("label", $val['attr'], $fieldVal); - //""; + // ""; if ($i != 1 && $j == 0) { echo " diff --git a/wms/cont/sign_list.php b/wms/cont/sign_list.php index 744f40cc..c4589438 100644 --- a/wms/cont/sign_list.php +++ b/wms/cont/sign_list.php @@ -72,10 +72,7 @@ f_return_content('payment_kind',payment_kind ) payment_kind FROM $table where 1=1 $where ORDER BY vol_no"; // echo $sql; $data = mysqli_query($link, $sql); -// echo '
';
-// print_r($data);
-// echo '
'; -// echo '1'; + ?> @@ -92,11 +89,97 @@ if ($data) : } ?> - + + + +
-
- + + +
+
- "; - foreach ($editableColumn as $key => $val) { - - echo ""; - } - echo ""; - // echo ""; - echo ""; - ?> + + + + + + + + + + + + + + + + + + - $val) { - if ($key == 'apply_key') { - echo ""; - } elseif ($key == 'brand') { - echo ""; - } else { - echo ""; - } - } - //list($signer)=DB::fields("); - //echo " select f_return_name(current_assigner) signer from subflow where form_key='". $row['form_key'] ."'"; ". (is_array($row['form_key'])?'': $row['form_key']) ." - list($signer) = mysqli_fetch_array(mysqli_query($link, "select max(f_return_name(current_assigner) ) signer from subflow where form_key='" . $row['form_key'] . "'")); - - echo ""; - - ?> - + + + + + + + + + + + + + + + + +
" . $val['label'] . "是否結案刪除
評審單號卷號現場地址現場名稱電梯品牌電梯台數營業員保養方式契約期限開始契約期限結束契約性質加盟公司名稱加盟公司電話是否結案合約下載
" . $row[$key] . "" . (!empty($row[$key]) ? $elevator_brand_arr[$row[$key]] : "") . "" . $row[$key] . "" . (empty($signer) ? "結案" : "N") . " + +
+
- 'A', - 'floors' => 7, - 'speed' => 1, - 'persons' => 6, - 'weight' => 1000, - 'maintain_times' => 1, - 'maintain_months' => 12, - 'maintain_kind' => 2, - 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 - 'is_m1_bundle' => 'N', -]; -*/ -/* //货梯 -$param = [ - - 'elevator_type' => 'B', - 'floors' => 7, - 'speed' => 1, - 'persons' => 6, - 'weight' => 1000, - 'maintain_times' => 1, - 'maintain_months' => 12, - 'maintain_kind' => 2, - 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 - 'is_m1_bundle' => 'N', -]; -*/ - -/*//病床梯 -$param = [ - - 'elevator_type' => 'C', - 'floors' => 28, - 'speed' => 1, - 'persons' => 6, - 'weight' => 1000, - 'maintain_times' => 2, //病床梯一月2次保养 - 'maintain_months' => 12, - 'maintain_kind' => 2, - 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 - 'is_m1_bundle' => 'N', -];*/ - -/*//无机房 -$param = [ - 'elevator_type' => 'D', - 'floors' => 3, - 'speed' => 1, - 'persons' => 6, - 'weight' => 1000, - 'maintain_times' => 1, //病床梯一月2次保养 - 'maintain_months' => 12, - 'maintain_kind' => 3, - 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 - 'is_m1_bundle' => 'N', -]; - -*/ -//家用梯 -$param = [ - 'elevator_type' => 'E', - 'floors' => 3, - 'speed' => 1, - 'persons' => 6, - 'weight' => 1000, - 'maintain_times' => 1, //病床梯一月2次保养 - 'maintain_months' => 60, - 'maintain_kind' => 2, - 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 - 'is_m1_bundle' => 'Y', -]; - -$mic = new MSCalculator(); -$price = $mic->cal($_GET); -echo json_encode($price); + 'A', + 'floors' => 7, + 'speed' => 1, + 'persons' => 6, + 'weight' => 1000, + 'maintain_times' => 1, + 'maintain_months' => 12, + 'maintain_kind' => 2, + 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 + 'is_m1_bundle' => 'N', +]; + +//货梯 +$param = [ + + 'elevator_type' => 'B', + 'floors' => 7, + 'speed' => 1, + 'persons' => 6, + 'weight' => 1000, + 'maintain_times' => 1, + 'maintain_months' => 12, + 'maintain_kind' => 2, + 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 + 'is_m1_bundle' => 'N', +]; + + +//病床梯 +$param = [ + + 'elevator_type' => 'C', + 'floors' => 28, + 'speed' => 1, + 'persons' => 6, + 'weight' => 1000, + 'maintain_times' => 2, //病床梯一月2次保养 + 'maintain_months' => 12, + 'maintain_kind' => 2, + 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 + 'is_m1_bundle' => 'N', +]; + +//无机房 +$param = [ + 'elevator_type' => 'D', + 'floors' => 3, + 'speed' => 1, + 'persons' => 6, + 'weight' => 1000, + 'maintain_times' => 1, //病床梯一月2次保养 + 'maintain_months' => 12, + 'maintain_kind' => 3, + 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 + 'is_m1_bundle' => 'N', +]; + + +//家用梯 +$param = [ + 'elevator_type' => 'E', + 'floors' => 3, + 'speed' => 1, + 'persons' => 6, + 'weight' => 1000, + 'maintain_times' => 1, //病床梯一月2次保养 + 'maintain_months' => 60, + 'maintain_kind' => 2, + 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 + 'is_m1_bundle' => 'Y', +]; + +$mic = new MSCalculator(); +$price = $mic->cal($_GET); +echo json_encode($price);