diff --git a/mkt/contractapply-index.php b/mkt/contractapply-index.php index 226d875c..c15c05d8 100644 --- a/mkt/contractapply-index.php +++ b/mkt/contractapply-index.php @@ -1,140 +1,143 @@ - "制式新合約", "B" => "非制式新合約"]; -$status_arr = ["I" => "申請中", "P" => "在途中", "Y" => "已完成", "X" => "作廢"]; -?> -

- - - -

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
項次申請號卷號營業員合約書號申請日期立約人申請類別合約狀態合約狀態時間案件名稱含稅貨款含稅按裝款含稅給約總價二次款建檔人建檔時間
- -

- - - -

-
-
-There is no record!"; -endif; - -#代表結束連線 -mysqli_close($link); - -include "footer.php"; + "制式新合約", "B" => "非制式新合約"]; +$status_arr = ["I" => "申請中", "P" => "在途中", "Y" => "已完成", "X" => "作廢"]; +?> +

+ + + +

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
項次申請號卷號營業員合約書號申請日期立約人申請類別合約狀態合約狀態時間案件名稱含稅貨款含稅按裝款含稅給約總價二次款建檔人建檔時間
+ +

+ + + +

+
+
+There is no record!"; +endif; + +#代表結束連線 +mysqli_close($link); + +include "footer.php"; ?> \ No newline at end of file diff --git a/wms/cont/MICalculator.php b/wms/cont/MICalculator.php index 73283ee9..8b087582 100644 --- a/wms/cont/MICalculator.php +++ b/wms/cont/MICalculator.php @@ -1,322 +1,324 @@ - 'fail', - 'message' => '無此項目,請聯係業務部創建MI' - ]; - } - public function success($price) - { - return [ - 'status' => 'ok', - 'price' => $price - ]; - } -} + 'fail', + 'message' => '無此項目,請聯係業務部創建MI' + ]; + } + public function success($price) + { + return [ + 'status' => 'ok', + 'price' => $price + ]; + } +} 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 da57a1fa..e64a3027 100644 --- a/wms/cont/apply_form.php +++ b/wms/cont/apply_form.php @@ -2,6 +2,8 @@ require_once '../header_nomenu.php'; require_once './FormHelper.php'; require_once './wf_common.php'; +// require_once('./conn.php'); + $vol_no = empty($_GET['vol_no']) ? "" : $_GET['vol_no']; @@ -25,19 +27,27 @@ $flow_id = 'con01'; $form_id = ""; #價審單狀態 $apply_st = ""; -list($apply_key, $form_key) = DB::fields("SELECT apply_key, form_key from con_maintance_examine_apply where vol_no='$vol_no' order by apply_key desc limit 0, 1"); +list($apply_key, $form_key, $salesman) = DB::fields("SELECT apply_key, form_key,salesman FROM con_maintance_examine_apply WHERE vol_no='$vol_no' ORDER BY apply_key desc limit 0, 1"); +// echo '
';
+// print_r($apply_key);
+// echo '
'; +// exit; +// if ($salesman != $user_id) { +// echo ''; +// exit; +// } if (empty($apply_key)) $apply_st = 1; // 準備新增 else { //list($flow_code)=DB::fields("select flow_code from flow where form_key = '$form_key' and system_id = '$system_id' and flow_id = '$flow_id'"); - list($current_assigner) = DB::fields("select current_assigner from subflow where form_key = '$form_key' order by seq desc limit 0, 1"); + list($current_assigner) = DB::fields("SELECT current_assigner FROM subflow WHERE form_key = '$form_key' ORDER BY seq desc limit 0, 1"); if ($current_assigner == $user_id) $apply_st = 2; // 修改中,還未提交 else $apply_st = 9; // 已到下一關,無法䖺改 } -if ($apply_st > 2) { - echo ""; - exit; -} +// if ($apply_st > 2) { +// echo ""; +// exit; +// } if ($apply_st == 1) { $wf = new WorkFlow($system_id, $flow_id, $form_id); @@ -250,6 +260,12 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' | } ?> + @@ -421,7 +437,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' | is_m1_bundle } setStandPrice(param1, element); - //console.info(param1); + // console.log(param1); }); @@ -484,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(); @@ -519,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); + } + }); @@ -701,7 +741,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
  - +
diff --git a/wms/cont/apply_form1.php b/wms/cont/apply_form1.php index b965ba72..2e035859 100644 --- a/wms/cont/apply_form1.php +++ b/wms/cont/apply_form1.php @@ -27,13 +27,13 @@ $form_id = ""; $apply_st = ""; list($apply_key, $form_key, $salesman) = DB::fields("SELECT apply_key, form_key,salesman FROM con_maintance_examine_apply WHERE vol_no='$vol_no' ORDER BY apply_key desc limit 0, 1"); // echo '
';
-// print_r($apply_key);
+// print_r($salesman);
 // echo '
'; // exit; -// if ($salesman != $user_id) { -// echo ''; -// exit; -// } +if ($salesman != $user_id) { + echo ''; + exit; +} if (empty($apply_key)) $apply_st = 1; // 準備新增 else { //list($flow_code)=DB::fields("select flow_code from flow where form_key = '$form_key' and system_id = '$system_id' and flow_id = '$flow_id'"); diff --git a/wms/cont/conn.php b/wms/cont/conn.php new file mode 100644 index 00000000..1476902e --- /dev/null +++ b/wms/cont/conn.php @@ -0,0 +1,42 @@ +errorInfo()的形式獲取錯誤資訊 + //PDO::ERRMODE_WARNING: 引發 E_WARNING 錯誤,主動報錯 + //PDO::ERRMODE_EXCEPTION: 主動抛出 exceptions 異常,需要以try{}cath(){}輸出錯誤資訊。 + //設定主動以警告的形式報錯 + $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + //如果連接錯誤,將抛出一個PDOException異常對象 +} catch (PDOException $e) { + //如果連結資料庫失敗則顯示錯誤訊並停止本頁的工作 + die("ERROR!!!: " . $e->getMessage()); +} + +//$conn = null; //關閉資料庫的連線 \ No newline at end of file diff --git a/wms/cont/query_form.php b/wms/cont/query_form.php index 2c9a47b6..f3495f14 100644 --- a/wms/cont/query_form.php +++ b/wms/cont/query_form.php @@ -1,510 +1,511 @@ -vol_no; -require_once './MICalculator.php'; -require_once './FormHelper.php'; -require_once './wf_common.php'; -list($form_key) = DB::fields("select form_key from con_maintance_examine_apply where apply_key='$apply_key'"); -//echo $form_key; -$flow = new Flow($form_key); -// 當前節點簽核開始 -//var_dump($flow); -$wf = new WorkFlow($flow->system_id, $flow->flow_id, $flow->form_id, $form_key); -#獲取簽核意見 -$assign_opinions = Assign::get_records($form_key); -$flowName = $wf->getFlowName(); -$assigner = $wf->getAssignerList(); -$assign_status = $wf->getAssignStatus($assigner); -//表單數據 -#客戶表 -#客戶表 -#1.電梯品牌選項 -$sql = "select code_name value ,content label from code where field_name='elevator_brand'"; -$elevator_brand_opt = DB::result($sql); -#2.保養方式 -$sql = "select code_name value ,content label from code where field_name='maintain_kind'"; -$maintain_kind_opt = DB::result($sql); -#3.電梯類型 -$sql = "select code_name value ,content label from code where field_name='elevator_kind'"; -$elevator_kind_opt = DB::result($sql); -#4.付款方式 -$sql = "select code_name value ,content label from code where field_name='payment_kind'"; -$payment_kind_opt = DB::result($sql); -#5.契約性質 -$sql = "select code_name value ,content label from code where field_name='contract_kind'"; -$contract_kind_opt = DB::result($sql); -#6.是否贈送M1 -$is_m1_bundle_opt = [ - ['label' => '是', 'value' => 'Y'], - ['label' => '否', 'value' => 'N'] -]; -#7.機種 -$sql = "select code_name value ,content label from code where field_name='fp_kind'"; -$fp_kind_opt = DB::result($sql); -$table = 'con_maintance_examine_apply'; -#可編輯的列 -$editableColumn = [ - 'apply_key' => [ - 'label' => "評審單號", "value" => "$apply_key", "tag" => 'text', - 'attr' => [ - 'readonly=true ', - 'class' => 'form-control form-control-sm' - ] - ], - 'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']], - 'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'num' => ['label' => "數量", "value" => "", "tag" => 'number', 'attr' => ['required', 'min=1', 'class' => 'form-control form-control-sm']], - 'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $maintain_kind_opt], - 'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $contract_kind_opt], - 'introducer' => ['label' => "介紹人", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - - // 'platform_company' => ['label' => "加盟公司名稱", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - // 'platforom_company_tel' => ['label' => "加盟公司電話", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt], - -]; -$where = " and apply_key='$apply_key'"; - -$sql = "SELECT * FROM $table where 1=1 $where ORDER BY apply_key"; -$data = []; -list($data) = DB::result($sql); - -#電梯詳細資料 -$con_maintance_examine_clear_columm = [ - 'register_code' => ['label' => "電梯許可證代碼", "value" => "", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', 'class' => 'form-control form-control-sm']], - //'elevator_brand' => ['label' => "品牌", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'elevator_brand[]', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'elevator_kind' => ['label' => "電梯類型", "value" => "", "tag" => 'select', 'attr' => ['name' => 'elevator_kind[]', 'required', 'colspan' => 2, 'class' => 'form-control form-control-sm'], 'options' => $elevator_kind_opt], - 'spec' => ['label' => "規格型號", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'spec[]', 'class' => 'form-control form-control-sm'], 'options' => $fp_kind_opt], - 'weight' => ['label' => "載重(KG)", "value" => "", "tag" => 'number', 'attr' => ['name' => 'weight[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'speed' => ['label' => "速度(m/min)", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed[]', 'min=0', 'required', 'class' => 'form-control form-control-sm']], - //'stop' => ['label' => "停數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'stop[]', 'class' => 'form-control form-control-sm']], - 'floors' => ['label' => "層數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'floors[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'persons' => ['label' => "人乘", "value" => "", "tag" => 'number', 'attr' => ['name' => 'persons[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - - 'maintain_times' => ['label' => "保養次數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_times[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_months' => ['label' => "保養月數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_months[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_period' => ['label' => "保養周期", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt], - - - // 'elevator_num' => ['label' => "臺數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'brand_num[]', 'class' => 'form-control form-control-sm']], - 'useful_years' => ['label' => "竣工檢查年度", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'required', 'name' => 'useful_years[]', 'class' => 'form-control form-control-sm']], - 'last_check_date' => ['label' => "上次年檢日期", "value" => "", "tag" => 'date', 'attr' => ['required', 'name' => 'last_check_date[]', 'colspan' => 2, 'type' => 'date', 'class' => 'form-control form-control-sm']], - //'speed_governors_check_expense' => ['label' => "限速器校驗費", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed_governors_check_expense[]', 'class' => 'form-control form-control-sm']], - // 'service_expense' => ['label' => "服務費", "value" => "", "tag" => 'text', 'attr' => ['required', 'name' => 'service_expense[]', 'class' => ' form-control form-control-sm ']], - // 'commission_expense' => ['label' => "分成費(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'commission_expense[]', 'class' => 'form-control form-control-sm']], - // 'management_expense' => ['label' => "管理費(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'management_expense[]', 'class' => 'form-control form-control-sm']], - 'annual_survey_expense' => ['label' => "年檢費用(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'annual_survey_expense[]', 'colspan' => 2, 'class' => 'date form-control form-control-sm ']], - //'service_expense' => ['label' => "服務費", "value" => "", "tag" => 'text', 'attr' => ['required', 'name' => 'service_expense[]', 'class' => ' form-control form-control-sm ']], - 'maintain_times' => ['label' => "保養次數", "tag" => 'number', 'attr' => ['name' => 'maintain_times[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_months' => ['label' => "保養月數", "tag" => 'number', 'attr' => ['name' => 'maintain_months[]', "value" => "12", 'min=12', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_period' => ['label' => "保養周期", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt], - 'stand_price' => ['label' => "標準價格A(元/月)", "value" => "", "tag" => 'text', 'attr' => ['required', "readonly", 'colspan' => 2, 'name' => 'stand_price[]', 'class' => 'form-control form-control-sm']], - 'contract_price' => ['label' => "契約報價B(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'contract_price[]', 'class' => 'form-control form-control-sm']], - 'sold_price' => ['label' => "契約成交價C(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'sold_price[]', 'class' => 'form-control form-control-sm']], - - - 'mi_cost' => ['label' => "標準成本D(元/月)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true','disabled', 'colspan' => 2, 'name' => 'mi_cost[]', 'class' => 'form-control form-control-sm']], - 'discount' => ['label' => "折扣率E(%)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true','disabled', 'colspan' => 2, 'name' => 'mi_cost_rate[]', 'class' => 'form-control form-control-sm']], - 'gross_profit' => ['label' => "毛利率F(%)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true','disabled', 'colspan' => 2, 'name' => 'gross_profit[]', 'class' => 'form-control form-control-sm']], - -]; -$con_maintance_examine_clear = DB::result("SELECT register_code, - f_return_content('elevator_brand',elevator_brand) elevator_brand, - f_return_content('maintain_elevator_kind',elevator_kind) elevator_kind, - elevator_kind con_elevator_kind, - spec, - weight, - speed, - floors, - persons, - maintain_times, - maintain_months, - maintain_period, - is_m1_bundle, - - useful_years, - last_check_date, - speed_governors_check_expense, - service_expense, - commission_expense, - management_expense, - annual_survey_expense, - stand_price, - contract_price, - sold_price, - 0 mi_cost , - 0 discount, - 0 gross_profit - FROM - con_maintance_examine_clear - WHERE - 1 = 1 - AND apply_key='" . $apply_key . "' and cmstatus = 'Y'"); - -function base_url($url) -{ - return "https://www.masada.com.tw/static/" . $url; -} - - -?> - - - - - - - <?php echo $flowName; ?> - - - - - - - - - - - - - - - - - - - -
- -
-
- - - - -
-
-
-

保養契約價格審核單

-
-
- -
-
- 契約信息 -
-
- - "; - foreach ($editableColumn as $key => $val) { - $j = (($i++) % 4); - $fieldVal = empty($data) ? "" : $data[$key]; - $fieldVal = empty($data) ? "" : $data[$key]; - - $_input = $val['tag'] == 'select' ? - FormHelper::select("$key", $val['options'], $fieldVal, $val['attr']) : - FormHelper::tag("label", $val['attr'], $fieldVal); - - //""; - if ($i != 1 && $j == 0) { - echo " -
-
- "; - } - echo "
- " . $val['label'] . " -
-
- $_input -
- "; - } - echo "
"; - - ?> - -
-
- 洽商進度 -
-
- - -
-
- -
-
- 電梯詳細資料 -
- - - - - - empty($val['attr']['colspan']) - ? 1 : $val['attr']['colspan']], $val['label']); - - if ((++$j % 14) == 0) { - // if ($j == 12) echo ""; - - - echo ""; - } - } - - ?> - - - - - $val) { - $j = 0; - - $cmecRow = " "; - - foreach ($con_maintance_examine_clear_columm as $col => $col_def) { - $fieldVal = empty($val) ? "" : $val[$col]; - if ($col == 'mi_cost') { - $param = [ - 'elevator_type' => $val['con_elevator_kind'], - 'floors' => $val['floors'], - 'speed' => $val['speed'], - 'persons' => $val['persons'], - 'weight' => $val['weight'], - 'maintain_times' => $val['maintain_times'], - 'maintain_months' => $val['maintain_months'], - 'maintain_kind' => $data['maintain_kind'], - 'maintain_period' => $val['maintain_period'], - 'is_m1_bundle' => $val['is_m1_bundle'], - ]; - $mic = new MICalculator(); - $res = $mic->cal($param); - #MI報價 - $con_maintance_examine_clear[$key]['mi_cost'] = $fieldVal = $res['status'] == 'ok' ? $res['price'] : $res['message']; - $con_maintance_examine_clear[$key]['gross_profit'] = $val['gross_profit'] = "/"; //$fieldVal==0?0: (round(($val['sold_price'] - $val['mi_cost']) / $fieldVal, 2) * 100) . "%" - #扣率 - $val['discount'] = (100 * round($val['sold_price'] / $val['stand_price'], 4)) . "%"; - } - - $_input = FormHelper::tag("label", ['colspan' => empty($col_def['attr']['colspan']) ? 1 - : $col_def['attr']['colspan']], $fieldVal); - $cmecRow .= ""; - - $cmecRow = (++$j % 14 == 0) ? $cmecRow . "" : $cmecRow; - } - $tr_class = $tr_class == 'odd' ? "even" : "odd"; - echo $cmecRow . ""; - } - ?> - - - - - - - -
操作
$_input
-
- - - - - -
-
- -
- - - -
-
- -
-
-
- - -
- -
- - - - ' . $wf->getNodeDescriptions($as['flow_code']) . ' -
'; - $tmp_code = $as['flow_code']; - ?> -
"> -
- - - - -   - " . $as['position_name'] . " "; ?> - - - - - - -   - 申請人 "; ?> - 退回"; ?> - 會簽"; ?> - - - - 簽核於: - - - -
-
- -
- -
- -
- - - -
-
- -
-
-
- - - - - - - - +vol_no; +require_once './MICalculator.php'; +require_once './FormHelper.php'; +require_once './wf_common.php'; +list($form_key) = DB::fields("select form_key from con_maintance_examine_apply where apply_key='$apply_key'"); +//echo $form_key; +$flow = new Flow($form_key); +// 當前節點簽核開始 +//var_dump($flow); +$wf = new WorkFlow($flow->system_id, $flow->flow_id, $flow->form_id, $form_key); +#獲取簽核意見 +$assign_opinions = Assign::get_records($form_key); +$flowName = $wf->getFlowName(); +$assigner = $wf->getAssignerList(); +$assign_status = $wf->getAssignStatus($assigner); +//表單數據 +#客戶表 +#客戶表 +#1.電梯品牌選項 +$sql = "select code_name value ,content label from code where field_name='elevator_brand'"; +$elevator_brand_opt = DB::result($sql); +#2.保養方式 +$sql = "select code_name value ,content label from code where field_name='maintain_kind'"; +$maintain_kind_opt = DB::result($sql); +#3.電梯類型 +$sql = "select code_name value ,content label from code where field_name='elevator_kind'"; +$elevator_kind_opt = DB::result($sql); +#4.付款方式 +$sql = "select code_name value ,content label from code where field_name='payment_kind'"; +$payment_kind_opt = DB::result($sql); +#5.契約性質 +$sql = "select code_name value ,content label from code where field_name='contract_kind'"; +$contract_kind_opt = DB::result($sql); +#6.是否贈送M1 +$is_m1_bundle_opt = [ + ['label' => '是', 'value' => 'Y'], + ['label' => '否', 'value' => 'N'] +]; +#7.機種 +$sql = "select code_name value ,content label from code where field_name='fp_kind'"; +$fp_kind_opt = DB::result($sql); +$table = 'con_maintance_examine_apply'; +#可編輯的列 +$editableColumn = [ + 'apply_key' => [ + 'label' => "評審單號", "value" => "$apply_key", "tag" => 'text', + 'attr' => [ + 'readonly=true ', + 'class' => 'form-control form-control-sm' + ] + ], + 'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']], + 'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], + 'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], + 'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], + 'num' => ['label' => "數量", "value" => "", "tag" => 'number', 'attr' => ['required', 'min=1', 'class' => 'form-control form-control-sm']], + 'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], + 'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $maintain_kind_opt], + 'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], + 'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], + 'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $contract_kind_opt], + 'introducer' => ['label' => "介紹人", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], + + // 'platform_company' => ['label' => "加盟公司名稱", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], + // 'platforom_company_tel' => ['label' => "加盟公司電話", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], + 'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt], + +]; +$where = " and apply_key='$apply_key'"; + +$sql = "SELECT * FROM $table where 1=1 $where ORDER BY apply_key"; +$data = []; +list($data) = DB::result($sql); + +#電梯詳細資料 +$con_maintance_examine_clear_columm = [ + 'register_code' => ['label' => "電梯許可證代碼", "value" => "", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', 'class' => 'form-control form-control-sm']], + //'elevator_brand' => ['label' => "品牌", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'elevator_brand[]', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], + 'elevator_kind' => ['label' => "電梯類型", "value" => "", "tag" => 'select', 'attr' => ['name' => 'elevator_kind[]', 'required', 'colspan' => 2, 'class' => 'form-control form-control-sm'], 'options' => $elevator_kind_opt], + 'spec' => ['label' => "規格型號", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'spec[]', 'class' => 'form-control form-control-sm'], 'options' => $fp_kind_opt], + 'weight' => ['label' => "載重(KG)", "value" => "", "tag" => 'number', 'attr' => ['name' => 'weight[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], + 'speed' => ['label' => "速度(m/min)", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed[]', 'min=0', 'required', 'class' => 'form-control form-control-sm']], + //'stop' => ['label' => "停數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'stop[]', 'class' => 'form-control form-control-sm']], + 'floors' => ['label' => "層數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'floors[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], + 'persons' => ['label' => "人乘", "value" => "", "tag" => 'number', 'attr' => ['name' => 'persons[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], + + 'maintain_times' => ['label' => "保養次數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_times[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], + 'maintain_months' => ['label' => "保養月數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_months[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], + 'maintain_period' => ['label' => "保養周期", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], + 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt], + + + // 'elevator_num' => ['label' => "臺數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'brand_num[]', 'class' => 'form-control form-control-sm']], + 'useful_years' => ['label' => "竣工檢查年度", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'required', 'name' => 'useful_years[]', 'class' => 'form-control form-control-sm']], + 'last_check_date' => ['label' => "上次年檢日期", "value" => "", "tag" => 'date', 'attr' => ['required', 'name' => 'last_check_date[]', 'colspan' => 2, 'type' => 'date', 'class' => 'form-control form-control-sm']], + //'speed_governors_check_expense' => ['label' => "限速器校驗費", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed_governors_check_expense[]', 'class' => 'form-control form-control-sm']], + // 'service_expense' => ['label' => "服務費", "value" => "", "tag" => 'text', 'attr' => ['required', 'name' => 'service_expense[]', 'class' => ' form-control form-control-sm ']], + // 'commission_expense' => ['label' => "分成費(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'commission_expense[]', 'class' => 'form-control form-control-sm']], + // 'management_expense' => ['label' => "管理費(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'management_expense[]', 'class' => 'form-control form-control-sm']], + 'annual_survey_expense' => ['label' => "年檢費用(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'annual_survey_expense[]', 'colspan' => 2, 'class' => 'date form-control form-control-sm ']], + //'service_expense' => ['label' => "服務費", "value" => "", "tag" => 'text', 'attr' => ['required', 'name' => 'service_expense[]', 'class' => ' form-control form-control-sm ']], + 'maintain_times' => ['label' => "保養次數", "tag" => 'number', 'attr' => ['name' => 'maintain_times[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], + 'maintain_months' => ['label' => "保養月數", "tag" => 'number', 'attr' => ['name' => 'maintain_months[]', "value" => "12", 'min=12', 'required', 'class' => 'form-control form-control-sm']], + 'maintain_period' => ['label' => "保養周期", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], + 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt], + 'stand_price' => ['label' => "標準價格A(元/月)", "value" => "", "tag" => 'text', 'attr' => ['required', "readonly", 'colspan' => 2, 'name' => 'stand_price[]', 'class' => 'form-control form-control-sm']], + 'contract_price' => ['label' => "契約報價B(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'contract_price[]', 'class' => 'form-control form-control-sm']], + 'sold_price' => ['label' => "契約成交價C(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'sold_price[]', 'class' => 'form-control form-control-sm']], + + + 'mi_cost' => ['label' => "標準成本D(元/月)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true', 'disabled', 'colspan' => 2, 'name' => 'mi_cost[]', 'class' => 'form-control form-control-sm']], + 'discount' => ['label' => "折扣率E(%)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true', 'disabled', 'colspan' => 2, 'name' => 'mi_cost_rate[]', 'class' => 'form-control form-control-sm']], + 'gross_profit' => ['label' => "毛利率F(%)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true', 'disabled', 'colspan' => 2, 'name' => 'gross_profit[]', 'class' => 'form-control form-control-sm']], + +]; +$con_maintance_examine_clear = DB::result("SELECT register_code, + f_return_content('elevator_brand',elevator_brand) elevator_brand, + f_return_content('maintain_elevator_kind',elevator_kind) elevator_kind, + elevator_kind con_elevator_kind, + spec, + weight, + speed, + floors, + persons, + maintain_times, + maintain_months, + maintain_period, + is_m1_bundle, + + useful_years, + last_check_date, + speed_governors_check_expense, + service_expense, + commission_expense, + management_expense, + annual_survey_expense, + stand_price, + contract_price, + sold_price, + 0 mi_cost , + 0 discount, + 0 gross_profit + FROM + con_maintance_examine_clear + WHERE + 1 = 1 + AND apply_key='" . $apply_key . "' and cmstatus = 'Y'"); + +function base_url($url) +{ + return "https://www.masada.com.tw/static/" . $url; +} + + +?> + + + + + + + <?php echo $flowName; ?> + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + + +
+
+
+

保養契約價格審核單

+
+
+ +
+
+ 契約信息 +
+
+ + "; + foreach ($editableColumn as $key => $val) { + // print_r($val['label']); + $j = (($i++) % 4); + $fieldVal = empty($data) ? "" : $data[$key]; + $fieldVal = empty($data) ? "" : $data[$key]; + + $_input = $val['tag'] == 'select' ? + FormHelper::select("$key", $val['options'], $fieldVal, $val['attr']) : + FormHelper::tag("label", $val['attr'], $fieldVal); + + // ""; + if ($i != 1 && $j == 0) { + echo " +
+
+ "; + } + echo "
+ " . $val['label'] . " +
+
+ $_input +
+ "; + } + echo "
"; + + ?> + +
+
+ 洽商進度 +
+
+ + +
+
+ +
+
+ 電梯詳細資料 +
+ + + + + + empty($val['attr']['colspan']) + ? 1 : $val['attr']['colspan']], $val['label']); + + if ((++$j % 14) == 0) { + // if ($j == 12) echo ""; + + + echo ""; + } + } + + ?> + + + + + $val) { + $j = 0; + + $cmecRow = " "; + + foreach ($con_maintance_examine_clear_columm as $col => $col_def) { + $fieldVal = empty($val) ? "" : $val[$col]; + if ($col == 'mi_cost') { + $param = [ + 'elevator_type' => $val['con_elevator_kind'], + 'floors' => $val['floors'], + 'speed' => $val['speed'], + 'persons' => $val['persons'], + 'weight' => $val['weight'], + 'maintain_times' => $val['maintain_times'], + 'maintain_months' => $val['maintain_months'], + 'maintain_kind' => $data['maintain_kind'], + 'maintain_period' => $val['maintain_period'], + 'is_m1_bundle' => $val['is_m1_bundle'], + ]; + $mic = new MICalculator(); + $res = $mic->cal($param); + #MI報價 + $con_maintance_examine_clear[$key]['mi_cost'] = $fieldVal = $res['status'] == 'ok' ? $res['price'] : $res['message']; + $con_maintance_examine_clear[$key]['gross_profit'] = $val['gross_profit'] = "/"; //$fieldVal==0?0: (round(($val['sold_price'] - $val['mi_cost']) / $fieldVal, 2) * 100) . "%" + #扣率 + $val['discount'] = (100 * round($val['sold_price'] / $val['stand_price'], 4)) . "%"; + } + + $_input = FormHelper::tag("label", ['colspan' => empty($col_def['attr']['colspan']) ? 1 + : $col_def['attr']['colspan']], $fieldVal); + $cmecRow .= ""; + + $cmecRow = (++$j % 14 == 0) ? $cmecRow . "" : $cmecRow; + } + $tr_class = $tr_class == 'odd' ? "even" : "odd"; + echo $cmecRow . ""; + } + ?> + + + + + + + +
操作
$_input
+
+ + + + + +
+
+ +
+ + + +
+
+ +
+
+
+ + +
+ +
+ + + + ' . $wf->getNodeDescriptions($as['flow_code']) . ' +
'; + $tmp_code = $as['flow_code']; + ?> +
"> +
+ + + + +   + " . $as['position_name'] . " "; ?> + + + + + + +   + 申請人 "; ?> + 退回"; ?> + 會簽"; ?> + + + + 簽核於: + + + +
+
+ +
+ +
+ +
+ + + +
+
+ +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/wms/cont/sign_list.php b/wms/cont/sign_list.php index bf792131..feba52e0 100644 --- a/wms/cont/sign_list.php +++ b/wms/cont/sign_list.php @@ -3,30 +3,34 @@ require_once "../header.php"; // 載入db.php來連結資料庫 $table = 'con_maintance_examine_apply'; +$para = "function_name=pricereview&" . $token_link; + +$status_arr = ["Y1" => "暫存", "YS" => "簽核中", "YY" => "結案同意", "YN" => "結案不同意"]; + #可編輯的列 -$editableColumn = [ - 'apply_key' => [ - 'label' => "評審單號", "value" => "", "tag" => 'text', - 'attr' => [ - 'readonly=true ', - 'class' => 'form-control form-control-sm' - ] - ], - 'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']], - 'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'num' => ['label' => "電梯臺數", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']], - 'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']], - 'platform_company' => ['label' => "加盟公司名稱", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'platforom_company_tel' => ['label' => "加盟公司電話", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - //'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt], - -]; +// $editableColumn = [ +// 'apply_key' => [ +// 'label' => "評審單號", "value" => "", "tag" => 'text', +// 'attr' => [ +// 'readonly=true ', +// 'class' => 'form-control form-control-sm' +// ] +// ], +// 'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']], +// 'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], +// 'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], +// 'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm']], +// 'num' => ['label' => "電梯臺數", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']], +// 'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], +// 'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']], +// 'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], +// 'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], +// 'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']], +// 'platform_company' => ['label' => "加盟公司名稱", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], +// 'platforom_company_tel' => ['label' => "加盟公司電話", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], +// //'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt], + +// ]; // 設置一個空陣列來放資料 $data = array(); @@ -41,7 +45,7 @@ $res = mysqli_query($link, $sql); $row = mysqli_fetch_row($res); $user_department_id = $row[0]; mysqli_free_result($res); -if (in_array($user_department_id, $depart_arr) || $user_id == "M0008" || $user_id == "M0012" || $user_id == "M0006" || $user_id =="M0189") $where = ""; +if (in_array($user_department_id, $depart_arr) || $user_id == "M0008" || $user_id == "M0012" || $user_id == "M0006" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "M0225") $where = ""; // 電梯廠牌 $elevator_brand_arr = []; @@ -59,6 +63,7 @@ $sql = "SELECT case_name, brand , num , +salesman as salesman_id, f_return_name(salesman) salesman, f_return_content('maintain_kind',maintain_kind ) maintain_kind, date_format(contract_begin_date,'%Y/%m/%d') contract_begin_date, @@ -67,14 +72,13 @@ f_return_content('contract_kind',contract_kind ) contract_kind, platform_company, platforom_company_tel, form_key, - +status, 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 '
'; + + ?> - + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
評審單號卷號現場地址現場名稱電梯品牌電梯台數營業員保養方式契約期限開始契約期限結束契約性質加盟公司名稱加盟公司電話是否結案合約下載
+ + + + + 待簽核
+ + + -- + + + 下載 + +
'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); diff --git a/wms/contract-repair/contract-download.php b/wms/contract-repair/contract-download.php new file mode 100644 index 00000000..f4c132fd --- /dev/null +++ b/wms/contract-repair/contract-download.php @@ -0,0 +1,567 @@ +prepare($sql); + $stmt->bindParam(':apply_key', $apply_key); + $stmt->execute(); + $contract_maintance = $stmt->fetchALL(PDO::FETCH_ASSOC); + echo '
';
+        print_r($contract_maintance);
+        echo '
'; + // echo $contract_maintance; + // $stmt = $conn->prepare($sql_str); + // $stmt->bindParam(':id',$id); + // $stmt->execute(); + // $contracts = $stmt->fetchAll(PDO::FETCH_ASSOC); + + + // $sql_str = "SELECT contract_new_apply.*, + // contract_new_apply_pays.pay_kind, contract_new_apply_pays.pay_scale, contract_new_apply_pays.pay_amount, contract_new_apply_pays.pay_period, contract_new_apply_pays.condition_date + // FROM contract_new_apply + // JOIN contract_new_apply_pays ON contract_new_apply.id = contract_new_apply_pays.contract_apply_id + // WHERE contract_new_apply.mid = :id"; + // $stmt = $conn->prepare($sql_str); + // $stmt->bindParam(':id', $id); + // $stmt->execute(); + // $contracts = $stmt->fetchAll(PDO::FETCH_ASSOC); + // $contract = $contracts[0]; + // $contract_apply_id = $contract['id']; + // if (($contract['status'] !== "YY" && $user_id != 'M0107') && $user_id != 'M0174' || $user_id != 'M0225') { + // echo ''; + // exit; + // } + + // 抓有望客戶的資料 + $sql_str = "SELECT * FROM hope_contract_customer WHERE vol_no = :vol_no"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':vol_no', $contract_maintance['vol_no']); + $stmt->execute(); + $customer = $stmt->fetchAll(PDO::FETCH_ASSOC); + // if (count($customer) <= 0) { + // echo ""; + // exit; + // } + + $buyArr = []; + $buyNo2Pay = false; + $buy_total_price = 0; + $installArr = []; + $install_total_price = 0; + // $noteArr = explode(",", $contracts[0]['note']); + $noteArr = array(1, 1, 1, 1, 1); + $qty = $contract_maintance[0]['num']; + // echo $qty; + // foreach ($contract_maintance as $idx => $amount) { + // $isset = false; + // if ($amount['payment_kind'] == 5 || $amount['payment_kind'] == 6) { + // if ($amount['pay_scale'] >= 0) { + // $install_total_price = $install_total_price + $amount['pay_amount']; + // $installArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']]; + // } + // } + // if ($amount['pay_kind'] == 1 || $amount['pay_kind'] == 2 || $amount['pay_kind'] == 3) { + // if ($amount['pay_scale'] > 0) { + // $buy_total_price = $buy_total_price + $amount['pay_amount']; + // foreach ($buyArr as $buy) { + // if ($buy['installment'] == $amount['pay_kind']) { + // $isset = true; + // } + // } + // if (!$isset) { { + // $buyArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']]; + // } + // if ($amount['pay_kind'] == 2) { + // $buyNo2Pay = true; + // } + // } + // } + // } + // } + $sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL"; + $sql_str = "SELECT contract_apply_files.*, contract_new_apply.id as apply_id FROM contract_apply_files LEFT JOIN contract_new_apply ON contract_apply_files.contract_id = contract_new_apply.id WHERE contract_new_apply.mid = :mid AND contract_apply_files.deleted_at IS NULL"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $id); + $stmt->execute(); + $files = $stmt->fetchAll(PDO::FETCH_ASSOC); + $files_count = count($files); + } catch (PDOException $e) { + die("ERROR!!!: " . $e->getMessage()); + } +} +?> + + + + + + +
+ +
+ + + + + + +
+
+
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+

電梯買賣合約書

+
+ 立契約人 甲方:
+
+
+ 乙方:
+
+
+
+

一二營造有限公司

+
+
(即買方,以下簡稱為甲方)
+
立合約書人
+
+

永佳捷科技股份有限公司

+
+
(即賣方,以下簡稱為乙方)
+
+ +
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + +
+

電梯買賣合約書

+
+ 合約書編號:
+
+
+

+
+
(即買方,以下簡稱為甲方)
+
立合約書人
+
+

永佳捷科技股份有限公司

+
+
(即賣方,以下簡稱為乙方)
+
+ +
+
+
+
+
+
+
+
+ + +
+
+
+
+ + + +
+
+ +
+ + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + +
+

電梯安裝合約書

+
+ 合約書編號:
+
+
+

一二營造有限公司

+
+
(即買方,以下簡稱為甲方)
+
立合約書人
+
+

永佳捷科技股份有限公司

+
+
(即賣方,以下簡稱為乙方)
+
+ +
+ + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + +
+

電梯安裝合約書

+
+ 合約書編號:
+
+
+

一二營造有限公司

+
+
(即買方,以下簡稱為甲方)
+
立合約書人
+
+

永佳捷科技股份有限公司

+
+
(即賣方,以下簡稱為乙方)
+
+ +
+
+ + + +
+
+ + + + + \ No newline at end of file diff --git a/wms/contract-repair/contract_maintance.php b/wms/contract-repair/contract_maintance.php new file mode 100644 index 00000000..5bcb7389 --- /dev/null +++ b/wms/contract-repair/contract_maintance.php @@ -0,0 +1,662 @@ +alert('非法訪問!!!');"; +// echo ""; +// exit; +// } +$id = $_GET["id"]; + +$sql_str = "SELECT contract_new_apply.*, account.name as review_person_name +FROM contract_new_apply +LEFT JOIN account ON contract_new_apply.review_person_id = account.accountid +WHERE contract_new_apply.mid = :mid"; +$stmt = $conn->prepare($sql_str); +$stmt->bindParam(':mid', $id); +$stmt->execute(); +$contract_new_apply = $stmt->fetch(PDO::FETCH_ASSOC); +$contract = $contract_new_apply; +$isFirst = empty($contract_new_apply) ? 1 : 0; +if (empty($contract_new_apply)) { + $sql_str = "SELECT pricereview_main.contractno, pricereview_main.ekind, pricereview_main.person, pricereview_main.company, pricereview_main.case_name, pricereview_main.address, pricereview_main.price_lowest, pricereview_main.price_total, pricereview_main.price_rate, pricereview_main.status as priceview_status, pricereview_main.id as mainid, account.name as accountname + FROM pricereview_main + JOIN account ON pricereview_main.person = account.accountid + WHERE pricereview_main.id = :id"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':id', $id); + $stmt->execute(); + $contract = $stmt->fetch(PDO::FETCH_ASSOC); + // print_r($contract); + $accounttype = "M"; + $sql_str = "SELECT * FROM account WHERE accounttype = :accounttype"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':accounttype', $accounttype); + $stmt->execute(); + $persons = $stmt->fetchAll(PDO::FETCH_ASSOC); + $sql_str = "SELECT * FROM hope_elevator_customer WHERE vol_no = :vol_no ORDER BY created_at DESC"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':vol_no', $contract['contractno']); + $stmt->execute(); + $customer = $stmt->fetch(PDO::FETCH_ASSOC); + + $mid = $contract['mainid']; + + $sql_str = "SELECT * FROM pricereview_item WHERE mid = :mid AND item_group = 'A'"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $mid); + $stmt->execute(); + $items = $stmt->fetchAll(PDO::FETCH_ASSOC); + $total_items = 0; + foreach ($items as $item) { + $total_items += $item['item_qty']; + } + $sql_str = "SELECT * FROM pricereview_pay WHERE mid = :mid ORDER BY pay_kind ASC"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $mid); + $stmt->execute(); + $pays = $stmt->fetchAll(PDO::FETCH_ASSOC); + $price_a = 0; + $price_b = 0; + foreach ($pays as $pay) { + if ($pay['pay_kind'] <= 4) { + $price_a = $price_a + $pay['pay_amount']; + } else { + $price_b = $price_b + $pay['pay_amount']; + } + } +} else { + $mid = $contract['mid']; + $contract_new_apply_id = $contract_new_apply['id']; + $sql_str = "SELECT * FROM contract_new_apply_pays WHERE mid = :mid ORDER BY pay_kind ASC"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $mid); + $stmt->execute(); + $pays = $stmt->fetchAll(PDO::FETCH_ASSOC); + + $sql_str = "SELECT * FROM pricereview_item WHERE mid = :mid AND item_group = 'A'"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $mid); + $stmt->execute(); + $items = $stmt->fetchAll(PDO::FETCH_ASSOC); + $price_a = 0; + $price_b = 0; + foreach ($pays as $pay) { + if ($pay['pay_kind'] <= 4) { + $price_a = $price_a + $pay['pay_amount']; + } else { + $price_b = $price_b + $pay['pay_amount']; + } + } + + $sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':contract_id', $id); + $stmt->execute(); + $files = $stmt->fetchAll(PDO::FETCH_ASSOC); + print_r($files); +} +$secondPayDeadline = $contract['secondPayDeadline'] ?? 0; +$status = isset($contract['status']) ? $contract['status'] : -1; +$person = $contract['person']; + +?> + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

合約書申請(新梯)

+
+

業務確認項

+
+ + +
卷號 +
+ + +
統一編號 + +

未填寫

+
合約書申請日期 + +

未填寫

+
申請類別 + +

未填寫

+
案件名稱 + +

未填寫

+
立約人 + +

未填寫

+
負責人 + +

未填寫

+
含稅給約總價 + +

未填寫

+
含稅貸款(A) + +

未填寫

+
含稅安裝款(A) + +

未填寫

+
聯絡地址 + +

未填寫

+
完工期限 +
+
+ 貨抵工地 +
+ +
+ 天內安裝完成,甲方應於貨底工地前 +
+ +
+ 天完成並整理完善。 +
+
+ +

未填寫

+
附則 +
+
+ 乙方應於 +
+ +
+ 天內試車完成 +
+
+

未填寫

+
免保期限 +
+ +
+ 個月 +
+
+

未填寫

+
交貨地點 + +

未填寫

+
交貨期限 +
+
+ 圖色確認第 +
+ +
+ 天出貨 +
+
+

未填寫

+
+ + + + + + + + + + + + + + + + + +
+

項次

+
+

規格

+
+

數量

+
+

金額

+
電梯總數
+ + + + + + + + + + + + + + + + "訂金", + 2 => "二次款", + 3 => "貨到款", + 4 => "", + 5 => "安裝款", + 6 => "尾款", + 7 => "", + ]; + $paydate = [ + 1 => "合約日", + 2 => "合約日", + 3 => "出貨日", + 4 => "", + 5 => "竣檢日", + 6 => "交車日", + 7 => "" + ]; + ?> + + + + + + + + + + + + + +
+

合約類別

+
+

款別

+
+

條件名稱

+
+

收款條件日期區分

+
+

條件日期

+
+

票期

+
+

付款比率

+
+

金額

+
+

+
+

+
+ + + + + + + +

貨抵工地付貨到款

+ + + + + + + +

-

+ +
+

+
+
+ +
+ 天 +
+
+
+
+ +
+ 天 +
+
+
+

%

+
+

+
+ + + + + + + + + + + + + + +
+

附件上傳

+
附件上傳 + + + + + X
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

簽核流程

+
審核審核人結果意見時間審核意見
營業員 + = 1) : ?>已送審 + 暫存 + 未提交 + --- + + + +
業務承辦人 + 結案同意 + 結案不同意 + --- +
+ + + + + + + + + +
+
+
+ + + + + + + + + + + + + 0 || ($person != $user_id && $user_id != "M0174")) : ?> + + + \ No newline at end of file diff --git a/wms/contract-repair/js/alpine.js b/wms/contract-repair/js/alpine.js index 3b05ef53..06d5dc7b 100644 --- a/wms/contract-repair/js/alpine.js +++ b/wms/contract-repair/js/alpine.js @@ -1,29 +1,16 @@ const contractDownload = () => { return { init() { - this.standardData = this.deepClone(this.data); - this.onstandardViewData = this.deepClone(this.data); - this.buystandardData = this.deepClone(this.buydata); + this.standarDate = this.deepClone(this.data); + this.onstandarViewData = this.deepClone(this.data); + this.buystandarData = this.deepClone(this.buydata); this.buyonstandardViewData = this.deepClone(this.buydata); - // CKEDITOR.replace('editor',{ - // extraplugins:'filebrowser', - // height:80, - // width:'100%', - // filebrowserUploadMethod:'form', - // filebrowserUploadUrl:'./ckeditor_upload.php' - // }); }, - installfill1: '', - installfill2: '', - installAffix: 1, - buyfill1: '', - buyfill2: '', - buyAffix: 1, - css: `table { background-color: #fff; border: none; margin-top: 30px; font-family: '標楷體'; width: 600px; } table tr:nth-child(even), table tr:nth-child(odd) { background-color: #fff; } table tr { font-size: 12pt; width: 100%; } table tr h2 { font-size: 18pt; } table tr td { width: 100%; height: 100%; line-height: 2; display: flex; } table tr td.center { display: flex; justify-content: center; align-items: center; } table tr td.list { width: 100%; height: 100%; white-space: nowrap; display: flex; } table tr td.list span { width: 60px; min-height: 100%; display: block; } table tr td.list > p { display: block; text-align: justify; } table tr td.list div { max-width: calc(100% - 60px); white-space: normal; } table tr td.list div.text-justify { display: flex; width: 100%; justify-content: space-between; } table tr.date td > div { width: 100%; text-align: right; } table tr.date td > div.text-justify { display: flex; justify-content: space-between; } table td, table th { padding: 8px; }`, + css: `table { background - color: #fff; border: none; margin - top: 30px; font - family: '標楷體'; width: 600px; } table tr: nth - child(even), table tr: nth - child(odd) { background - color: #fff; } table tr { font - size: 12pt; width: 100 %; } table tr h2 { font - size: 18pt; } table tr td { width: 100 %; height: 100 %; line - height: 2; display: flex; } table tr td.center { display: flex; justify - content: center; align - items: center; } table tr td.list { width: 100 %; height: 100 %; white - space: nowrap; display: flex; } table tr td.list span { width: 60px; min - height: 100 %; display: block; } table tr td.list > p { display: block; text - align: justify; } table tr td.list div { max - width: calc(100 % - 60px); white - space: normal; } table tr td.list div.text - justify { display: flex; width: 100 %; justify - content: space - between; } table tr.date td > div { width: 100 %; text - align: right; } table tr.date td > div.text - justify { display: flex; justify - content: space - between; } table td, table th { padding: 8px; }`, data: { illustrate: { editshow: false, - plaintext: '茲因甲方向乙方訂購電梯,並委由乙方安裝系爭電梯,經雙方同意共同訂立本合約書,其條款如下:' + plaintext: '茲因甲乙雙方就電梯設備保養.檢修事宜,同意訂定本契約,議定條款如后,並相互遵守條款約定。', }, partyA: { editshow: false, @@ -38,612 +25,80 @@ const contractDownload = () => { { editshow: false, origin: true, - text: `安裝產品名稱、數量及單價:
1、 ${people} 人座  ${floor} 停站速度每分鐘 ${speed} 公尺 交流變頻變壓電腦智能控制升降機 ${num} 部。單價:新台幣 ${numberToChinese(totalInstallPrice)} 元整( ${numberWithCommas(totalInstallPrice)} )(含5%加值型營業稅)。`, - type: 'title', + text: ``, deleted: false, id: 0, - input_id: null, + input_id: null }, { editshow: false, origin: true, - text: '安裝產品規格:如附表一。', + text: `規格`, type: 'title', deleted: false, id: 1, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '安裝地點:' + partyAaddress + '。', - type: 'title', - deleted: false, - id: 2, - input_id: null, - }, - { - editshow: false, - origin: true, - text: `安裝報酬:安裝勞務報酬為新台幣(以下皆同) ${numberToChinese(totalPrice)} 元整(${numberWithCommas(totalPrice)} )(含5%加值型營業稅)。`, - type: 'title', - deleted: false, - id: 3, - input_id: null, - }, - { - editshow: false, - origin: true, - text: install_pay_text, - type: 'title', - deleted: false, - id: 4, - input_id: 'fill1', - }, - { - editshow: false, - origin: true, - text: '安裝試車事項:
一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台__日內安裝完成。
二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於__日內交車時,甲方應付清總價款全部餘額。
三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。', - type: 'title', - deleted: false, - id: 5, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '交車事項:
一、乙方完成產品安裝後,甲方應儘速理交車事宜,不得無故或藉故拖延。如經乙方通知,甲方遲未辦理交車事宜,則於乙方催告後,即視同交車完成。
二、乙方試車完成後,甲方應配合提供建物使用執照及其他竣工檢查所需文件,以利乙方代甲方辦理昇降設備竣工檢查。
三、甲方於昇降設備竣工檢查合格及取得使用許可證後,交車事項即為完成。', - type: 'title', - deleted: false, - id: 6, - input_id: null, - }, - - { - editshow: false, - origin: true, - text: '因故延期:
如因天災、地變及其他不可抗力之因素,或甲方未將電梯昇降路及機械室之建築工程等配合事項未於貨抵工地前七日整理完善,或甲方未將符合規格之電源於安裝前送電至機械室,或房屋建築及其他應配合相關事項未完成,致影響乙方如期安裝產品時,乙方安裝日期應依受影響日數向後延展,如因可歸責於甲方事由者亦同。', - type: 'title', - deleted: false, - id: 7, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '工程變更:
甲方對本工程之規格有變更設計及增減工程數量時,應於合約訂立日後壹個月內預先以書面通知乙方且需經雙方同意,如因工程變更而致乙方成本增加時,則甲方應吸收所有增加之成本並追認給付給乙方,否則乙方依原合約之貨品規格、數量交貨,甲方亦應依原合約之貨品規格、數量給付款項。', - type: 'title', - deleted: false, - id: 8, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '工地清理及除外事項:
一、本工程於貨到現場前,其工地廢料雜物及臨時設備,應由甲方清除整理,同時提供乙方放置貨品之處所。
二、有關建築工事回填澆灌後之清潔,應由甲方負責清理。
三、升降設備除外工程表所列之各項工程不包括於乙方本合約施作範圍,應由甲方負責處理。', - type: 'title', - deleted: false, - id: 9, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '電梯保養:
一、乙方完工交車後,期後__個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。
二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。
三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。', - type: 'title', - deleted: false, - id: 10, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '特約條款:
一、本設備器材在款項未付清前,其所有權仍歸屬乙方所有,價款付清後所有權始轉移給甲方。
二、如因甲方因素或建物設計上之疏忽,致影響驗收時,甲方不得以此做為逾期或拒付款之藉口。
三、本合約所有日數約定,均以工作天計算。', - type: 'title', - deleted: false, - id: 11, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '終止合約權:
一、甲乙雙方之任一方若有違反合約之事實或發生清算或破產等信用貶落情形,致工程無法進行時,經催告而未改善者,他方得終止本合約,違約方必須賠償對方之損失。
二、乙方逾期交貨或甲方逾期未交付工地受領產品逾壹個月以上經他方催告仍不改善,他方得終止本合約,並請求損害賠償。', - type: 'title', - deleted: false, - id: 12, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '合意管轄:
因本合約而涉訟,甲、乙方雙方同意以桃園地方法院為第一審管轄法院。催告仍不改善,他方得終止本合約,並請求損害賠償。', - type: 'title', - deleted: false, - id: 13, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '附則:
本合約經甲、乙雙方簽章後立即生效,甲、乙雙方各存執正副本各壹份為憑,印花雙方各自貼付。', - type: 'title', - deleted: false, - id: 14, - input_id: null, + input_id: null }, { - editshow: false, - origin: true, - text: '合約附件:
本合約附件為本合約之一部份,與本合約具同等效力,甲乙雙方均應遵守之。', - type: 'title', - deleted: false, - id: 15, - input_id: null, - }, + editshow: false + } ] } }, buydata: { - illustrate: { - editshow: false, - plaintext: '茲因甲方向乙方訂購電梯,經雙方同意共同訂立本合約書,其條款如下:' - }, - partyA: { - editshow: false, - plaintext: partyAcompany, - }, - partyAcontractno: { - editshow: false, - plaintext: partyAcontractno, - }, - list: { - plaintext: [ - { - editshow: false, - origin: true, - text: `產品名稱、數量及單價:
1、 ${people} 人座 ${floor} 停站速度每分鐘 ${speed} 公尺 交流變頻變壓電腦智能控制升降機 ${bigChineseArr[num]} 部。單價:新台幣 ${numberToChinese(totalBuyPrice)} 元整( ${numberWithCommas(totalBuyPrice)} )(含5%加值型營業稅)。`, - type: 'title', - deleted: false, - id: 0, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '產品規格:如附表一。', - type: 'title', - deleted: false, - id: 1, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '交貨及安裝地點:' + partyAaddress + '。', - type: 'title', - deleted: false, - id: 2, - input_id: null, - }, - { - editshow: false, - origin: true, - text: `產品總價:產品價金為新台幣 ${numberToChinese(totalBuyPrice)} 元整( ${numberWithCommas(totalBuyPrice)} )(含5%加值型營業稅)。`, - type: 'title', - deleted: false, - id: 3, - input_id: null, - }, - { - editshow: false, - origin: true, - text: buy_pay_text, - type: 'title', - deleted: false, - id: 4, - input_id: 'buyfill1', - }, - { - editshow: false, - origin: true, - text: '交貨期限及甲方配合事項:
乙方應於接獲甲方圖色確認第180日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。', - type: 'title', - deleted: false, - id: 5, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '施工規範依據:
甲方或其指定工程師,於本契約簽訂後二星期內,提供組立電梯之大樓建築有關圖面,以供乙方製作電梯配置圖,乙方製妥電梯配置圖後請甲方簽認,甲方於接獲乙方提請審核之電梯配置圖後,一星期內簽認並送還乙方,乙方應於接獲甲方簽認之電梯配置圖後,安排電梯組件之生產並按預定時間內製造完成。', - type: 'title', - deleted: false, - id: 6, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '因故延期:
一、如因天災、地變及其他不可抗力之因素,致影響乙方如期交付產品時,本合約第六條之交貨日期應依受影響日數向後延展,如因可歸責於甲方事由者亦同。
二、如因可歸責甲方事由致工期展延逾第六條日期時,如因物價波動致成本增加,乙方得請求物價調漲之補償,或終止合約。', - type: 'title', - deleted: false, - id: 7, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '工程變更:
甲方對本工程之規格有變更設計及增減工程數量時,應於合約訂立日後壹個月內預先以書面通知乙方且需經雙方同意,如因工程變更而致乙方成本增加時,則甲方應吸收所有增加之成本並追認給付給乙方,否則乙方依原合約之貨品規格、數量交貨,甲方亦應依原合約之貨品規格、數量給付款項。', - type: 'title', - deleted: false, - id: 8, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '工地清理及除外事項:
一、本工程於貨到現場前,其工地廢料雜物及臨時設備,應由甲方清除整理,同時提供乙方放置貨品之處所。
二、有關建築工事回填澆灌後之清潔,應由甲方負責清理。', - type: 'title', - deleted: false, - id: 9, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '合約時效:
本合約及其附件自簽訂之日起,至保固期滿之日止為有效期間。', - type: 'title', - deleted: false, - id: 10, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '特約條款:
一、本設備器材在款項未付清前,其所有權仍歸屬乙方所有,價款付清後所有權始轉移給甲方。
二、如因甲方因素或建物設計上之疏忽,致影響驗收時,甲方不得以此做為逾期或拒付款之藉口。
三、本合約所有日數約定,均以工作天計算。', - type: 'title', - deleted: false, - id: 11, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '終止合約權:
一、甲乙雙方之任一方若有違反合約之事實或發生清算或破產等信用貶落情形,致工程無法進行時,經催告而未改善者,他方得終止本合約,違約方必須賠償對方之損失。
二、乙方逾期交貨或甲方逾期未交付工地受領產品逾壹個月以上經他方催告仍不改善,他方得終止本合約,並請求損害賠償。', - type: 'title', - deleted: false, - id: 12, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '合意管轄:
因本合約而涉訟,甲、乙方雙方同意以桃園地方法院為第一審管轄法院。', - type: 'title', - deleted: false, - id: 13, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '附則:
本合約經甲、乙雙方簽章後立即生效,甲、乙雙方各存執正本各壹份為憑。', - type: 'title', - deleted: false, - id: 14, - input_id: null, - }, - { - editshow: false, - origin: true, - text: '合約附件:
本合約附件為本合約之一部份,與本合約具同等效力,甲乙雙方均應遵守之,本合約附件計有:', - type: 'title', - deleted: false, - id: 15, - input_id: null, - }, - ] - } - }, - fill: [], - standardData: {}, - onstandardViewData: {}, - deepClone: function (obj) { - let clone = Array.isArray(obj) ? [] : {}; - for (let key in obj) { - if (obj.hasOwnProperty(key)) { - if (typeof obj[key] === 'object' && obj[key] !== null) { - clone[key] = this.deepClone(obj[key]); - if (clone[key].text != undefined) { - // clone[key].text = clone[key].text.replace(/ insert , u=> update - index: 0, - isInstall: true, - chineseNumbers(number) { - const units = ['', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']; - if (number <= 10) { - return units[number]; - } else if (number < 20) { - return '十' + units[number - 10]; - } else if (number < 30) { - return '二十' + units[number - 20]; - } else if (number < 40) { - return '三十' + units[number - 30]; - } else if (number < 50) { - return '四十' + units[number - 40]; - } else { - return '五十'; - } - }, - mouseover(obj, isInstall = true) { - if (isInstall) { - if (!this.onstandardViewData[obj].editshow) { - this.onstandardViewData[obj].editshow = true - } - } else { - if (!this.buyonstandardViewData[obj].editshow) { - this.buyonstandardViewData[obj].editshow = true - } - } - - }, - mouseoverlist(idx, inInstall = true) { - if (inInstall) { - if (!this.onstandardViewData.list.plaintext[idx].editshow) { - this.onstandardViewData.list.plaintext[idx].editshow = true - } - } else { - if (!this.buyonstandardViewData.list.plaintext[idx].editshow) { - this.buyonstandardViewData.list.plaintext[idx].editshow = true - } - } - - }, - mouseoutlist(idx) { - if (this.onstandardViewData.list.plaintext[idx].editshow) { - this.onstandardViewData.list.plaintext[idx].editshow = false - } - if (this.buyonstandardViewData.list.plaintext[idx].editshow) { - this.buyonstandardViewData.list.plaintext[idx].editshow = false - } - }, - mouseout(obj) { - if (this.onstandardViewData[obj].editshow) { - this.onstandardViewData[obj].editshow = false - } - if (this.buyonstandardViewData[obj].editshow) { - this.buyonstandardViewData[obj].editshow = false - } - }, - modelshowEditFn(text, obj, isList = false, isInstall = true) { - if (this.modelshow) { - return; - } - this.isInstall = isInstall - this.actionType = 'u' - this.modelshow = true - this.modelText = text - this.objName = obj - this.isList = isList - this.actionType = 'u' - if (isInstall) { - if (isList) { - this.$refs.editor.value = this.onstandardViewData.list.plaintext[obj].text - // CKEDITOR.instances.editor.setData(this.onstandardViewData.list.plaintext[obj].text); - return - } - if (!isList) { - this.$refs.editor.value = this.onstandardViewData[obj].plaintext - // CKEDITOR.instances.editor.setData(this.onstandardViewData[obj].plaintext); - return - } - } else { - if (isList) { - this.$refs.editor.value = this.buyonstandardViewData.list.plaintext[obj].text - // CKEDITOR.instances.editor.setData(this.buyonstandardViewData.list.plaintext[obj].text); - return - } - if (!isList) { - this.$refs.editor.value = this.buyonstandardViewData[obj].plaintext - // CKEDITOR.instances.editor.setData(this.buyonstandardViewData[obj].plaintext); - return - } - } - - }, - modelcloseFn() { - if (this.modelshow) { - this.modelshow = false - this.modelText = '' - this.modelContent = '' - this.isList = false - this.$refs.editor.value = '' - // CKEDITOR.instances.editor.setData('') - } - }, - modelshowAddUpFn(idx, isInstall = true) { - this.isInstall = isInstall - this.index = idx - this.actionType = 'i' - this.modelshow = true - this.modelText = '新增一條例' - }, - modelshowAddDownFn(idx, isInstall = true) { - this.isInstall = isInstall - this.index = idx + 1 - this.actionType = 'i' - this.modelshow = true - this.modelText = '新增一條例' - }, - updateEditor() { - let max = 0; - if (this.isInstall) { - this.onstandardViewData.list.plaintext.forEach(item => { - if (item.id > max) { - max = item.id - }; - }) - } else { - this.buyonstandardViewData.list.plaintext.forEach(item => { - if (item.id > max) { - max = item.id - }; - }) - } - - max = max + 1 - if (this.actionType == 'i') { - let newObj = { - editshow: false, - origin: false, - text: this.removeTrailingNewline(this.$refs.editor.value), - // text:this.removeTrailingNewline(this.convertHtmlToPlainText(this.$refs.editor.value)), - // text:this.removeTrailingNewline(this.convertHtmlToPlainText(CKEDITOR.instances.editor.getData())), - type: 'title', - deleted: false, - id: max, - } - if (this.isInstall) { - this.data.list.plaintext.splice(this.index, 0, newObj) - this.onstandardViewData.list.plaintext.splice(this.index, 0, newObj) - } else { - this.buydata.list.plaintext.splice(this.index, 0, newObj) - this.buyonstandardViewData.list.plaintext.splice(this.index, 0, newObj) - } - this.modelcloseFn() - return - } - if (this.actionType == 'u') { - if (this.isInstall) { - if (this.isList) { - // this.data.list.plaintext[this.objName].text = this.convertHtmlToPlainText(CKEDITOR.instances.editor.getData()) - this.data.list.plaintext[this.objName].text = this.convertHtmlToPlainText(this.$refs.editor.value) - // this.onstandardViewData.list.plaintext[this.objName].text = this.convertHtmlToPlainText(CKEDITOR.instances.editor.getData()) - // this.onstandardViewData.list.plaintext[this.objName].text = this.convertHtmlToPlainText(this.$refs.editor.value) - this.onstandardViewData.list.plaintext[this.objName].text = this.$refs.editor.value - } else { - // this.data[this.objName].plaintext = this.convertHtmlToPlainText(CKEDITOR.instances.editor.getData()) - this.data[this.objName].plaintext = this.convertHtmlToPlainText(this.$refs.editor.value) - // this.onstandardViewData[this.objName].plaintext = this.convertHtmlToPlainText(CKEDITOR.instances.editor.getData()) - // this.onstandardViewData[this.objName].plaintext = this.convertHtmlToPlainText(this.$refs.editor.value) - this.onstandardViewData[this.objName].plaintext = this.$refs.editor.value - } - } else { - if (this.isList) { - this.buydata.list.plaintext[this.objName].text = this.convertHtmlToPlainText(this.$refs.editor.value) - this.buyonstandardViewData.list.plaintext[this.objName].text = this.$refs.editor.value - } else { - this.buydata[this.objName].plaintext = this.convertHtmlToPlainText(this.$refs.editor.value) - this.buyonstandardViewData[this.objName].plaintext = this.$refs.editor.value - } - } - } - this.modelcloseFn() - return - }, - deleteEditor(idx, isInstall = true) { - if (isInstall) { - if (confirm('確定要刪除嗎?')) { - let id = this.onstandardViewData.list.plaintext[idx].id - this.data.list.plaintext.forEach(item => { - if (item.id == id) { - item.deleted = 1; - } - }) - this.onstandardViewData.list.plaintext.splice(idx, 1) - } - } else { - if (confirm('確定要刪除嗎?')) { - let id = this.buyonstandardViewData.list.plaintext[idx].id - // this.buydata.list.plaintext[idx].deleted = 1 - this.buydata.list.plaintext.forEach(item => { - if (item.id == id) { - if (!item.deleted) { - item.deleted = 1; - } - } - }) - this.buyonstandardViewData.list.plaintext.splice(idx, 1) - } - } - }, - removeTrailingNewline(str) { - return str.replace(/\n+$/, ''); - }, - convertHtmlToPlainText(htmlString) { - // 創建一個新的DOMParser對象 - var parser = new DOMParser(); - - // 使用parseFromString方法解析傳入的HTML字符串 - var doc = parser.parseFromString(htmlString, 'text/html'); - - // 返回解析後的純文本內容 - return doc.body.textContent || ''; }, exportFn(type) { - const form = this.$refs.form + const form = this.$refs.form; const prviewType = this.$refs.form.querySelector('#prview-type'); - const list = this.$refs.form.querySelector('#prview-list'); + const list = this.$refs.form.querySelector('#privew-list'); const standardList = this.$refs.form.querySelector('#standard-prview-list'); - const illustrate = this.$refs.form.querySelector('#illustrate'); + const illustrate = this.$refs.form.querySelector('illustrate'); const standardIllustrate = this.$refs.form.querySelector('#standard-illustrate'); const partyA = this.$refs.form.querySelector('#partyA'); const partyAcontractno = this.$refs.form.querySelector('#partyAcontractno'); const total_price = this.$refs.form.querySelector('#total_price'); - prviewType.value = type + prviewType.value = type; if (type === 1) { - const standardJsonText = this.buystandardData.list.plaintext.map((item, idx) => { - let text = '' - text = item.text.replace(/\s+/g, "") - this.buydata.list.plaintext[idx].text = this.buydata.list.plaintext[idx].text.replace(/\s+/g, "") + const standarJsonText = this.buystandarDate.list.plaintext.map((item, idx) => { + let text = ''; + text = item.text.replace(/\s+/g, ""); + this.buydata.list.plaintext[idx].text = this.buydata.list.plaintext[idx].text.replace(/\s+/g, ""); return { text: text, id: item.id } }); + const jsonText = this.buydata.list.plaintext.map(item => { - let text = '' - text = item.text + let text = ''; + text = item.text; return { text: text, origin: item.origin ? 1 : 0, deleted: item.deleted ? 1 : 0, id: item.id, - updated: item.updated ? 1 : 0, + updated: item.updated ? 1 : 0 } }); - list.value = JSON.stringify(jsonText) - standardList.value = JSON.stringify(standardJsonText) - illustrate.value = this.buydata.illustrate.plaintext - standardIllustrate.value = this.buystandardData.illustrate.plaintext - partyA.value = this.buydata.partyA.plaintext - partyAcontractno.value = this.buydata.partyAcontractno.plaintext - total_price.value = totalBuyPrice + list.value = JSON.stringify(jsonText); + standardList.value = JSON.stringify(standarJsonText); + illustrate.value = this.buydata.illustrate.plaintext; + standardIllustrate.value = this.buyonstandardViewData.illustrate.plaintext; + partyA.value = this.buydata.partyA.plaintext; + partyAcontractno.value = this.buydata.partyAcontractno.plaintext; + total_price.value = totalBuyPrice; form.submit(); return; } + if (type === 2) { - // list.value = JSON.stringify(this.data.list.plaintext) - const standardJsonText = this.standardData.list.plaintext.map((item, idx) => { - let text = '' - text = item.text.replace(/\s+/g, "") + const standardJsonText = this.standarData.list.plaintext.map((item, idx) => { + let text = ''; + text = item.text.replace(/\s+/g, ""); if (this.data.list.plaintext[idx] !== undefined) { - this.data.list.plaintext[idx].text = this.data.list.plaintext[idx].text.replace(/\s+/g, "") + this.data.list.plaintext[idx].text = this.data.list.plaintext[idx].text.replace(/\s+/g, ""); } return { text: text, @@ -651,151 +106,31 @@ const contractDownload = () => { } }) const jsonText = this.data.list.plaintext.map(item => { - let text = '' - item.text - text = item.text + let text = ''; + item.text; + text = item.text; return { text: text, origin: item.origin ? 1 : 0, deleted: item.deleted ? 1 : 0, id: item.id, - updated: item.updated ? 1 : 0, + updated: item.updated ? 1 : 0 } }) - list.value = JSON.stringify(jsonText) - standardList.value = JSON.stringify(standardJsonText) - illustrate.value = this.data.illustrate.plaintext - standardIllustrate.value = this.standardData.illustrate.plaintext - partyA.value = this.data.partyA.plaintext - partyAcontractno.value = this.data.partyAcontractno.plaintext - total_price.value = totalInstallPrice + list.value = JSON.stringify(jsonText); + standardList.value = JSON.stringify(standarJsonText); + illustrate.value = this.data.illustrate.plaintext; + standardIllustrate.value = this.standardData.illustrate.plaintext; + partyA.value = this.data.partyA.plaintext; + partyAcontractno.value = this.data.partyAcontractno.plaintext; + total_price.value = totalInstallPrice; form.submit(); return; } - }, - toggleBuyStandard: true, - toggleInstallStandard: true, - isbuyShow: true, - sendInstallInputFn() { - if (this.installfill1 == '') { - alert('請輸入安裝試車期限'); - return; - } - if (this.installfill2 == '') { - alert('請輸入免費保養月數'); - return; - } - if (this.installfill1 < 45) { - alert('安裝試車期限不得低於45日'); - return; - } - if (this.installfill1 < 1) { - alert('免費保養月數不得低於1個月'); - return; - } - this.isInstallInputIng = false - this.data.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。' - this.standardData.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。' - this.onstandardViewData.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。' - this.data.list.plaintext[5].text = '安裝試車事項:
一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台 ' + this.installfill1 + ' 日內安裝完成。
二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。
三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。' - this.standardData.list.plaintext[5].text = '安裝試車事項:
一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台 ' + this.installfill1 + ' 日內安裝完成。
二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。
三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。' - this.onstandardViewData.list.plaintext[5].text = '安裝試車事項:
一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台 ' + this.installfill1 + ' 日內安裝完成。
二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。
三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。' - this.data.list.plaintext[10].text = '電梯保養:
一、乙方完工交車後,期後 ' + this.installfill2 + ' 個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。
二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。
三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。' - this.standardData.list.plaintext[10].text = '電梯保養:
一、乙方完工交車後,期後 ' + this.installfill2 + ' 個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。
二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。
三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。' - this.onstandardViewData.list.plaintext[10].text = '電梯保養:
一、乙方完工交車後,期後 ' + this.installfill2 + ' 個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。
二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。
三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。' - }, - sendInstallInputKeyupFn(e) { - if (e.keyCode !== 13) return - if (this.installfill1 == '') { - alert('請輸入安裝試車期限'); - return; - } - if (this.installfill2 == '') { - alert('請輸入免費保養月數'); - return; - } - if (this.installfill1 < 45) { - alert('安裝試車期限不得低於45日'); - return; - } - if (this.installfill1 < 1) { - alert('免費保養月數不得低於1個月'); - return; - } - this.isInstallInputIng = false - this.data.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。' - this.standardData.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。' - this.onstandardViewData.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。' - this.data.list.plaintext[5].text = '安裝試車事項:
一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台 ' + this.installfill1 + ' 日內安裝完成。
二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。
三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。' - this.standardData.list.plaintext[5].text = '安裝試車事項:
一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台 ' + this.installfill1 + ' 日內安裝完成。
二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。
三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。' - this.onstandardViewData.list.plaintext[5].text = '安裝試車事項:
一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台 ' + this.installfill1 + ' 日內安裝完成。
二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。
三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。' - this.data.list.plaintext[10].text = '電梯保養:
一、乙方完工交車後,期後 ' + this.installfill2 + ' 個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。
二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。
三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。' - this.standardData.list.plaintext[10].text = '電梯保養:
一、乙方完工交車後,期後 ' + this.installfill2 + ' 個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。
二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。
三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。' - this.onstandardViewData.list.plaintext[10].text = '電梯保養:
一、乙方完工交車後,期後 ' + this.installfill2 + ' 個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。
二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。
三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。' - }, - sendBuyInputFn() { - if (this.buyfill1 == '') { - alert('請輸入交貨期限'); - return; - } - if (this.buyfill1 < 1) { - alert('交貨期限不得低於1日'); - return; - } - if (buyArr[1].installment == 2) { - this.buydata.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2); - this.buystandardData.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2); - this.buyonstandardViewData.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2); - } - this.isBuyInputIng = false - this.buydata.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。' - this.buystandardData.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。' - this.buyonstandardViewData.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。' - this.buydata.list.plaintext[5].text = '交貨期限及甲方配合事項:
乙方應於接獲甲方圖色確認第 ' + this.buyfill1 + ' 日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。' - this.buystandardData.list.plaintext[5].text = '交貨期限及甲方配合事項:
乙方應於接獲甲方圖色確認第 ' + this.buyfill1 + ' 日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。' - this.buyonstandardViewData.list.plaintext[5].text = '交貨期限及甲方配合事項:
乙方應於接獲甲方圖色確認第 ' + this.buyfill1 + ' 日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。' - let buyAffixHtml = '' - for (let i = 0; i < Number(this.buyAffix); i++) { - buyAffixHtml += `
${numberToSmallChinese(i + 1)}、附表${numberToSmallChinese(i + 1)}                                                       共 1 張` - } - this.buydata.list.plaintext[15].text = this.buydata.list.plaintext[15].text + buyAffixHtml - this.buystandardData.list.plaintext[15].text = this.buystandardData.list.plaintext[15].text + buyAffixHtml - this.buyonstandardViewData.list.plaintext[15].text = this.buyonstandardViewData.list.plaintext[15].text + buyAffixHtml - }, - sendBuyInputKeyupFn(e) { - if (e.keyCode !== 13) return - if (this.buyfill1 == '') { - alert('請輸入交貨期限'); - return; - } - if (this.buyfill1 < 1) { - alert('交貨期限不得低於1日'); - return; - } - if (buyArr[1].installment == 2) { - this.buydata.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2); - this.buystandardData.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2); - this.buyonstandardViewData.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2); - } - this.isBuyInputIng = false - this.buydata.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。' - this.buystandardData.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。' - this.buyonstandardViewData.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。' - this.buydata.list.plaintext[5].text = '交貨期限及甲方配合事項:
乙方應於接獲甲方圖色確認第 ' + this.buyfill1 + ' 日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。' - this.buystandardData.list.plaintext[5].text = '交貨期限及甲方配合事項:
乙方應於接獲甲方圖色確認第 ' + this.buyfill1 + ' 日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。' - this.buyonstandardViewData.list.plaintext[5].text = '交貨期限及甲方配合事項:
乙方應於接獲甲方圖色確認第 ' + this.buyfill1 + ' 日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。' - let buyAffixHtml = '' - for (let i = 0; i < Number(this.buyAffix); i++) { - buyAffixHtml += `
${numberToSmallChinese(i + 1)}、附表${numberToSmallChinese(i + 1)}                                                       共 1 張` - } - this.buydata.list.plaintext[15].text = this.buydata.list.plaintext[15].text + buyAffixHtml - this.buystandardData.list.plaintext[15].text = this.buystandardData.list.plaintext[15].text + buyAffixHtml - this.buyonstandardViewData.list.plaintext[15].text = this.buyonstandardViewData.list.plaintext[15].text + buyAffixHtml - }, - affixArr: ['', '一', '一、二', '一、二、三', '一、二、三、四', '一、二、三、四、五'], - isBuyInputIng: true, - isInstallInputIng: true, + + } + } }; diff --git a/wms/contract-repair/prviewPdf.php b/wms/contract-repair/prviewPdf.php new file mode 100644 index 00000000..91adc475 --- /dev/null +++ b/wms/contract-repair/prviewPdf.php @@ -0,0 +1,649 @@ + $item['origin'] == 1); + $standardArr = json_decode(json_encode($standardList), true); + $nostandardArr = json_decode(json_encode($list), true); + $newlist = array_values(array_filter($list, fn ($item) => $item->deleted == 0)); + foreach ($nostandardArr as $idx => &$item) { + if ($item['origin'] === 1) { + if (strip_tags($item['text']) != strip_tags($standardArr[$item['id']]['text'])) { + $item['updated'] = 1; + } else { + $item['updated'] = 0; + } + } + } + unset($item); + if (strip_tags($illustrate) != strip_tags($standardIllustrate)) { + $updatedIllustrate = true; + } + $sql_str = "SELECT * FROM hope_elevator_customer WHERE vol_no = :vol_no"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':vol_no', $partyAcontractno); + $stmt->execute(); + $customer = $stmt->fetch(PDO::FETCH_ASSOC); + if (count($customer) <= 0) { + echo ""; + } + $sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':contract_id', $contract_id); + $stmt->execute(); + $files = $stmt->fetchAll(PDO::FETCH_ASSOC); + function numberToChinese($num) + { + $chineseNumbers = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']; + $units = ['', '十', '百', '千', '万']; + + if ($num <= 10) { + return $chineseNumbers[$num]; + } elseif ($num < 20) { + return $units[1] . $chineseNumbers[$num % 10]; + } elseif ($num < 100) { + return $chineseNumbers[intval($num / 10)] . $units[1] . ($num % 10 > 0 ? $chineseNumbers[$num % 10] : ''); + } else { + // 處理大於 99 的数字 + $result = ''; + $strNum = strval($num); + $length = strlen($strNum); + for ($i = 0; $i < $length; $i++) { + $currentDigit = intval($strNum[$i]); + if ($currentDigit > 0) { + $result .= $chineseNumbers[$currentDigit] . $units[$length - $i - 1]; + } else { + $result .= $chineseNumbers[$currentDigit]; + } + } + return $result; + } + } + function removeTrailingBr($string) + { + //刪除字串尾巴的

+ return preg_replace('/()+$/', '', $string); + } + +?> + + + + + + + + + +
') + form.append('party_a', '') + form.append('total_price', ) + form.append('accound_id', '') + form.append('times', 1) + form.append('random', this.random) + form.append('hash', newtoken) + form.append('url', formattedDate+'.pdf' ); + form.append('created_by', '') + form.append('delivery_term', '') + form.append('install_period', '') + form.append('free_maintainance', '') + axiosClient({ + method:'post', + url:'./store-contract.php', + data:form + }).then(res=>{ + console.log(res); + }) + }, + }"> + + + + + +
+
+ 修改的條列 +
+ 新增的條列 +
+ 刪除的條列 +
+ +
+

+

合約書編號:

+ + + + + + +
(即買方,以下簡稱為甲方)
+

立合約書人

+ + + + + + +
永佳捷科技股份有限公司(即賣方,以下簡稱為乙方)
+

+ + $item) { + ?> + + + + + +
+
+ + +
+
+

+

合約書編號:

+ + + + + + +
(即買方,以下簡稱為甲方)
+

立合約書人

+ + + + + + +
永佳捷科技股份有限公司(即賣方,以下簡稱為乙方)
+

+ + $item) { + ?> + + + + + +
+
+ +
+

+

合約書編號:

+ + + + + + +
(即買方,以下簡稱為甲方)
+

立合約書人

+ + + + + + +
永佳捷科技股份有限公司(即賣方,以下簡稱為乙方)
+ +

+ + $item) { + ?> + + + + + + + + 15) { ?> + + + + + + +
+
+ +
+ +
+

升降設備除外工程表

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
一、機械室之建造,含預留出入口、通風照明、自動閉鎖裝置,及天花板上之保養用吊鉤。
二、通往機械室之樓梯及加護欄杆工程。
三、機械室基礎台需用防濕之瀝青鐵筋混凝土及地板防塵工事。
四、機械室及升降路中間之橫樑或工字樑之安裝工程。
五、自屋外至機械室之動力及照明用配線電源開關插座,及接地線等電路工程。
六、升降路及機械室以外監視盤、電鈴、電話之配管與配線工程。
七、升降路之建造及底部之防水工程及緩衝器水泥台工程。
八、機坑照明保養用之開關及插座,鐵爬梯。
九、各樓按鈕開關之留洞工程及安裝後之固定與週邊裝飾工程。
十、升降路內甲方不得裝設有任何與升降設備無關之配線、電線配管、水管、風管等設備。
十一、安裝所需水泥、砂石、水電與供試車用動力電源。
十二、升降路及機房之建造,電源設備之容量及位置等,需符合國家標準(CNS-2866)及建築法規等規定。
十三、機械運抵工地後供給儲存倉庫。
備註:CNS-2866國家標準建築物電梯有關之法規:
1.機械室內應設有照明及通風設備,以利管理檢查,照明應在100LUX(米一燭光)以上,通風設備應能使室內溫度保持在攝氏40度以下。
2.機械室之出入口應加鎖,其裝置應良好。
3.由機械室至走廊,樓梯間應便於通行,樓梯應加裝扶手,其與水平面之傾斜角度,應不超過60度。
4.機械室出入門之構造,應有下述裝置:
+ A:能自動關閉者。
+ B:有彈簧鎖或其類似裝置,以便室內不用鎖匙,而能開門。
+ C:除屋頂開口部份以外,機械式牆壁,應能耐火。(二小時防火時效) +
5.升降路內不得設置與升降機無關之配管及配線。
6.任一升降路下部之任何部份,供人使用或類似使用時配重側比照車廂,同樣必須裝設緊急安全裝置。
7.若有火警受信總機時,甲方需提供"火警受信總機"檢出信號及通往升降道內之配管配線(0.75MM² × 3)
+
+
+ + + +alert('非法訪問!');window.history.back();"; +} +?> \ No newline at end of file diff --git a/wms/contract/api/postContractNewApplyData.php b/wms/contract/api/postContractNewApplyData.php index 3cd1682f..e5b500fb 100644 --- a/wms/contract/api/postContractNewApplyData.php +++ b/wms/contract/api/postContractNewApplyData.php @@ -1,14 +1,16 @@ beginTransaction(); - try{ - if($isFirst == 1){ + try { + if ($isFirst == 1) { $sql_str = "INSERT INTO contract_new_apply (mid, contractno, sales_man, apply_date, apply_type, case_name, customer, manager, vat, total_price, total_items, buy_fee, install_fee, contact_address, workdeadline_a, workdeadline_b, test_time, freedeadline, trade_address, tradedeadline, secondPayDeadline, progress, status, person, personname, submit_date, created_at, created_by) VALUES (:mid, :contractno, :sales_man, :apply_date, :apply_type, :case_name, :customer, :manager, :vat, :total_price, :total_items, :buy_fee, :install_fee, :contact_address, :workdeadline_a, :workdeadline_b, :test_time, :freedeadline, :trade_address, :tradedeadline, :secondPayDeadline, :progress, :status, :person, :personname, :submit_date, :created_at, :created_by)"; - $stmt = $conn -> prepare($sql_str); - $stmt ->bindParam(':mid', $mid); - $stmt ->bindParam(':contractno', $vol_no); - $stmt ->bindParam(':sales_man', $salesman); - $stmt ->bindParam(':apply_date', $apply_date); - $stmt ->bindParam(':apply_type', $apply_type); - $stmt ->bindParam(':case_name', $case_name); - $stmt ->bindParam(':customer', $customer); - $stmt ->bindParam(':manager', $manager); - $stmt ->bindParam(':vat', $vat); - $stmt ->bindParam(':total_price', $total_price); - $stmt ->bindParam(':total_items', $total_items); - $stmt ->bindParam(':buy_fee', $buy_fee); - $stmt ->bindParam(':install_fee', $install_fee); - $stmt ->bindParam(':contact_address', $contact_address); - $stmt ->bindParam(':workdeadline_a', $workdeadline_a); - $stmt ->bindParam(':workdeadline_b', $workdeadline_b); - $stmt ->bindParam(':test_time', $test_time); - $stmt ->bindParam(':freedeadline', $freedeadline); - $stmt ->bindParam(':trade_address', $trade_address); - $stmt ->bindParam(':tradedeadline', $tradedeadline); - $stmt ->bindParam(':secondPayDeadline', $secondPayDeadline); - $stmt ->bindParam(':progress', $progress); - $stmt ->bindParam(':status', $status); - $stmt ->bindParam(':person', $salesman); - $stmt ->bindParam(':personname', $salesmanname); - $stmt ->bindParam(':submit_date', $submit_date); - $stmt ->bindParam(':created_at', $created_at); - $stmt ->bindParam(':created_by', $created_by); - $stmt ->execute(); + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $mid); + $stmt->bindParam(':contractno', $vol_no); + $stmt->bindParam(':sales_man', $salesman); + $stmt->bindParam(':apply_date', $apply_date); + $stmt->bindParam(':apply_type', $apply_type); + $stmt->bindParam(':case_name', $case_name); + $stmt->bindParam(':customer', $customer); + $stmt->bindParam(':manager', $manager); + $stmt->bindParam(':vat', $vat); + $stmt->bindParam(':total_price', $total_price); + $stmt->bindParam(':total_items', $total_items); + $stmt->bindParam(':buy_fee', $buy_fee); + $stmt->bindParam(':install_fee', $install_fee); + $stmt->bindParam(':contact_address', $contact_address); + $stmt->bindParam(':workdeadline_a', $workdeadline_a); + $stmt->bindParam(':workdeadline_b', $workdeadline_b); + $stmt->bindParam(':test_time', $test_time); + $stmt->bindParam(':freedeadline', $freedeadline); + $stmt->bindParam(':trade_address', $trade_address); + $stmt->bindParam(':tradedeadline', $tradedeadline); + $stmt->bindParam(':secondPayDeadline', $secondPayDeadline); + $stmt->bindParam(':progress', $progress); + $stmt->bindParam(':status', $status); + $stmt->bindParam(':person', $salesman); + $stmt->bindParam(':personname', $salesmanname); + $stmt->bindParam(':submit_date', $submit_date); + $stmt->bindParam(':created_at', $created_at); + $stmt->bindParam(':created_by', $created_by); + $stmt->execute(); $contract_apply_id = $conn->lastInsertId(); - foreach($pays as $idx=>$pay){ + foreach ($pays as $idx => $pay) { $kind = $idx; $sql_str = "INSERT INTO contract_new_apply_pays (contract_apply_id, mid, pay_kind, pay_scale, pay_amount, pay_period, condition_date, created_at, created_by) VALUES (:contract_apply_id, :mid, :pay_kind, :pay_scale, :pay_amount, :pay_period, :condition_date, :created_at, :created_by)"; - $stmt = $conn -> prepare($sql_str); - $stmt ->bindParam(':contract_apply_id', $contract_apply_id); - $stmt ->bindParam(':mid', $mid); - $stmt ->bindParam(':pay_kind', $kind); - $stmt ->bindParam(':pay_scale', $pay['scale']); - $stmt ->bindParam(':pay_amount', $pay['amount']); - $stmt ->bindParam(':pay_period', $pay['pay_period']); - $stmt ->bindParam(':condition_date', $pay['condition_date']); - $stmt ->bindParam(':created_at', $created_at); - $stmt ->bindParam(':created_by', $created_by); - $stmt ->execute(); + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':contract_apply_id', $contract_apply_id); + $stmt->bindParam(':mid', $mid); + $stmt->bindParam(':pay_kind', $kind); + $stmt->bindParam(':pay_scale', $pay['scale']); + $stmt->bindParam(':pay_amount', $pay['amount']); + $stmt->bindParam(':pay_period', $pay['pay_period']); + $stmt->bindParam(':condition_date', $pay['condition_date']); + $stmt->bindParam(':created_at', $created_at); + $stmt->bindParam(':created_by', $created_by); + $stmt->execute(); } - // -----處理檔案上傳 START----- - if(!empty($files)){ + // -----處理檔案上傳 START----- + if (!empty($files)) { $englisharr = range('a', 'z'); - $files = $_FILES['files']; + $files = $_FILES['files']; $newfiles = []; - foreach( $files as $file ){ + foreach ($files as $file) { $i = 0; //新陣列的索引編號 - foreach( $file as $key => $val ){ + foreach ($file as $key => $val) { $newfiles[$i]['name'] = $files['name'][$key]; $newfiles[$i]['type'] = $files['type'][$key]; $newfiles[$i]['tmp_name'] = $files['tmp_name'][$key]; @@ -115,91 +117,92 @@ if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 0 $newfiles[$i]['size'] = $files['size'][$key]; $i++; } //foreach 第2層 end - } - $max_size = 4096*4096; //設定允許上傳檔案容量的最大值(1M) - $allow_ext = array('jpeg', 'jpg', 'png','JPG','JPEG','PNG','GIF', 'docx', 'doc', 'pdf'); //設定允許上傳檔案的類型 + } + $max_size = 4096 * 4096; //設定允許上傳檔案容量的最大值(1M) + $allow_ext = array('jpeg', 'jpg', 'png', 'JPG', 'JPEG', 'PNG', 'GIF', 'docx', 'doc', 'pdf'); //設定允許上傳檔案的類型 $path = '../images/contracts_new_files/'; - if (!file_exists($path)): mkdir($path); endif; + if (!file_exists($path)) : mkdir($path); + endif; $msg_result = ''; //負責接收所有檔案檢測後的回傳訊息 $datetime = (string)date('YmdHis'); $files_id = 'm' . $datetime; // 保養=>b + 日期時間 - foreach( $newfiles as $key => $file ){ - $randNum = rand(1000,9999); - $randEnglish = $englisharr[rand(0,25)]; - $file_name = 'm' . (string)date('YmdHis') . $randNum . $randEnglish . $randNum.$file['name']; - $msg = upload_chk( $file,$path, $max_size, $allow_ext, $file_name ); - if($msg==1){ + foreach ($newfiles as $key => $file) { + $randNum = rand(1000, 9999); + $randEnglish = $englisharr[rand(0, 25)]; + $file_name = 'm' . (string)date('YmdHis') . $randNum . $randEnglish . $randNum . $file['name']; + $msg = upload_chk($file, $path, $max_size, $allow_ext, $file_name); + if ($msg == 1) { $msg = '檔案傳送成功!'; $sql_str = "INSERT INTO contract_apply_files (contract_id, contract_type, file_name, file_mime, file_size, created_at, created_by) VALUES (:contract_id, :contract_type, :file_name, :file_mime, :file_size, :created_at, :created_by)"; - $stmt = $conn -> prepare($sql_str); - $stmt -> bindParam(':contract_id' ,$contract_apply_id); - $stmt -> bindParam(':contract_type' ,$contract_type); - $stmt -> bindParam(':file_name' ,$file_name); - $stmt -> bindParam(':file_mime' ,$file['type']); - $stmt -> bindParam(':file_size' ,$file['size']); - $stmt -> bindParam(':created_at' ,$created_at); - $stmt -> bindParam(':created_by' ,$created_by); - $stmt ->execute(); - }else{ + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':contract_id', $contract_apply_id); + $stmt->bindParam(':contract_type', $contract_type); + $stmt->bindParam(':file_name', $file_name); + $stmt->bindParam(':file_mime', $file['type']); + $stmt->bindParam(':file_size', $file['size']); + $stmt->bindParam(':created_at', $created_at); + $stmt->bindParam(':created_by', $created_by); + $stmt->execute(); + } else { throw new PDOException('檔案上傳失敗:' . $msg); } - $msg_result .= '第' . ($key+1) . '個上傳檔案的結果:' . $msg . '
'; - $src_name = $path.$file['name']; - if( file_exists($src_name) ){ + $msg_result .= '第' . ($key + 1) . '個上傳檔案的結果:' . $msg . '
'; + $src_name = $path . $file['name']; + if (file_exists($src_name)) { //副檔名 - $extname = pathinfo($src_name, PATHINFO_EXTENSION); + $extname = pathinfo($src_name, PATHINFO_EXTENSION); //主檔名 - $basename = basename($src_name, '.'.$extname); + $basename = basename($src_name, '.' . $extname); } } } // -----處理檔案上傳 END----- header("HTTP/1.1 201 success!"); $conn->commit(); - }else{ + } else { $sql_str = "UPDATE contract_new_apply SET status = :status, apply_date=:apply_date, apply_type=:apply_type, case_name=:case_name, customer=:customer, manager=:manager, vat=:vat, total_price=:total_price, total_items=:total_items, buy_fee=:buy_fee, install_fee=:install_fee, contact_address=:contact_address, trade_address=:trade_address, workdeadline_a=:workdeadline_a, workdeadline_b=:workdeadline_b, test_time=:test_time, freedeadline=:freedeadline, trade_address=:trade_address, trade_address=:trade_address, tradedeadline=:tradedeadline, secondPayDeadline=:secondPayDeadline, progress=:progress, person=:person, personname=:personname, submit_date=:submit_date, updated_at=:updated_at, updated_by=:updated_by WHERE mid = :mid"; - $stmt = $conn -> prepare($sql_str); - $stmt ->bindParam(':mid', $mid); - $stmt ->bindParam(':status', $status); - $stmt ->bindParam(':apply_date', $apply_date); - $stmt ->bindParam(':apply_type', $apply_type); - $stmt ->bindParam(':case_name', $case_name); - $stmt ->bindParam(':customer', $customer); - $stmt ->bindParam(':manager', $manager); - $stmt ->bindParam(':vat', $vat); - $stmt ->bindParam(':total_price', $total_price); - $stmt ->bindParam(':total_items', $total_items); - $stmt ->bindParam(':buy_fee', $buy_fee); - $stmt ->bindParam(':install_fee', $install_fee); - $stmt ->bindParam(':contact_address', $contact_address); - $stmt ->bindParam(':workdeadline_a', $workdeadline_a); - $stmt ->bindParam(':workdeadline_b', $workdeadline_b); - $stmt ->bindParam(':test_time', $test_time); - $stmt ->bindParam(':freedeadline', $freedeadline); - $stmt ->bindParam(':trade_address', $trade_address); - $stmt ->bindParam(':tradedeadline', $tradedeadline); - $stmt ->bindParam(':secondPayDeadline', $secondPayDeadline); - $stmt ->bindParam(':progress', $progress); - $stmt ->bindParam(':person', $salesman); - $stmt ->bindParam(':personname', $salesmanname); - $stmt ->bindParam(':submit_date', $submit_date); - $stmt ->bindParam(':updated_at', $updated_at); - $stmt ->bindParam(':updated_by', $updated_by); - $stmt ->execute(); + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $mid); + $stmt->bindParam(':status', $status); + $stmt->bindParam(':apply_date', $apply_date); + $stmt->bindParam(':apply_type', $apply_type); + $stmt->bindParam(':case_name', $case_name); + $stmt->bindParam(':customer', $customer); + $stmt->bindParam(':manager', $manager); + $stmt->bindParam(':vat', $vat); + $stmt->bindParam(':total_price', $total_price); + $stmt->bindParam(':total_items', $total_items); + $stmt->bindParam(':buy_fee', $buy_fee); + $stmt->bindParam(':install_fee', $install_fee); + $stmt->bindParam(':contact_address', $contact_address); + $stmt->bindParam(':workdeadline_a', $workdeadline_a); + $stmt->bindParam(':workdeadline_b', $workdeadline_b); + $stmt->bindParam(':test_time', $test_time); + $stmt->bindParam(':freedeadline', $freedeadline); + $stmt->bindParam(':trade_address', $trade_address); + $stmt->bindParam(':tradedeadline', $tradedeadline); + $stmt->bindParam(':secondPayDeadline', $secondPayDeadline); + $stmt->bindParam(':progress', $progress); + $stmt->bindParam(':person', $salesman); + $stmt->bindParam(':personname', $salesmanname); + $stmt->bindParam(':submit_date', $submit_date); + $stmt->bindParam(':updated_at', $updated_at); + $stmt->bindParam(':updated_by', $updated_by); + $stmt->execute(); - foreach($pays as $idx=>$pay){ + foreach ($pays as $idx => $pay) { $kind = $idx; $sql_str = "UPDATE contract_new_apply_pays SET pay_scale = :pay_scale, pay_amount = :pay_amount, pay_period = :pay_period, condition_date = :condition_date, updated_at = :updated_at, updated_by = :updated_by WHERE mid = :mid AND pay_kind = :pay_kind"; - $stmt = $conn -> prepare($sql_str); - $stmt ->bindParam(':mid', $mid); - $stmt ->bindParam(':pay_kind', $kind); - $stmt ->bindParam(':pay_scale', $pay['scale']); - $stmt ->bindParam(':pay_amount', $pay['amount']); - $stmt ->bindParam(':pay_period', $pay['pay_period']); - $stmt ->bindParam(':condition_date', $pay['condition_date']); - $stmt ->bindParam(':updated_at', $updated_at); - $stmt ->bindParam(':updated_by', $updated_by); - $stmt ->execute(); + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $mid); + $stmt->bindParam(':pay_kind', $kind); + $stmt->bindParam(':pay_scale', $pay['scale']); + $stmt->bindParam(':pay_amount', $pay['amount']); + $stmt->bindParam(':pay_period', $pay['pay_period']); + $stmt->bindParam(':condition_date', $pay['condition_date']); + $stmt->bindParam(':updated_at', $updated_at); + $stmt->bindParam(':updated_by', $updated_by); + $stmt->execute(); } $deleted_at = date("Y-m-d H:i:s"); $removefiles = json_decode($_POST['removefiles'], true); @@ -220,17 +223,15 @@ if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 0 header("HTTP/1.1 201 success!"); $conn->commit(); } - }catch(PDOException $e){ + } catch (PDOException $e) { $conn->rollback(); header("HTTP/1.1 500 failed!"); echo $e->getMessage(); - die('Error!:'.$e->getMessage()); + die('Error!:' . $e->getMessage()); } - - } //結案同意 -if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 3) ){ +if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 3)) { $status = $_POST['status']; $vol_no = $_POST['vol_no']; $contract_new_apply_id = $_POST['contract_new_apply_id']; @@ -239,27 +240,27 @@ if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 3 $user_id = $_POST['review_person_id']; $review_date = date('Y-m-d H:i:s'); $conn->beginTransaction(); - try{ + try { $sql_str = "UPDATE contract_new_apply SET status = :status, progress = :progress, review_comment=:review_comment, review_person_id=:review_person_id, review_date=:review_date WHERE id = :contract_new_apply_id"; - $stmt = $conn -> prepare($sql_str); - $stmt ->bindParam(':status', $status); - $stmt ->bindParam(':progress', $progress); - $stmt ->bindParam(':contract_new_apply_id', $contract_new_apply_id); - $stmt ->bindParam(':review_comment', $review_comment); - $stmt ->bindParam(':review_person_id', $user_id); - $stmt ->bindParam(':review_date', $review_date); + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':status', $status); + $stmt->bindParam(':progress', $progress); + $stmt->bindParam(':contract_new_apply_id', $contract_new_apply_id); + $stmt->bindParam(':review_comment', $review_comment); + $stmt->bindParam(':review_person_id', $user_id); + $stmt->bindParam(':review_date', $review_date); $stmt->execute(); header("HTTP/1.1 200 success!"); $conn->commit(); - }catch(PDOException $e){ + } catch (PDOException $e) { $conn->rollback(); header("HTTP/1.1 500 failed!"); echo $e->getMessage(); - die('Error!:'.$e->getMessage()); + die('Error!:' . $e->getMessage()); } } //結案不同意(退回) -if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 2) ){ +if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 2)) { $status = $_POST['status']; $vol_no = $_POST['vol_no']; $contract_new_apply_id = $_POST['contract_new_apply_id']; @@ -269,22 +270,22 @@ if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 2 echo $user_id; $review_date = date('Y-m-d H:i:s'); $conn->beginTransaction(); - try{ + try { $sql_str = "UPDATE contract_new_apply SET status = :status, progress = :progress, review_comment=:review_comment, review_person_id=:review_person_id, review_date=:review_date WHERE id = :contract_new_apply_id"; - $stmt = $conn -> prepare($sql_str); - $stmt ->bindParam(':status', $status); - $stmt ->bindParam(':progress', $progress); - $stmt ->bindParam(':contract_new_apply_id', $contract_new_apply_id); - $stmt ->bindParam(':review_comment', $review_comment); - $stmt ->bindParam(':review_person_id', $user_id); - $stmt ->bindParam(':review_date', $review_date); + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':status', $status); + $stmt->bindParam(':progress', $progress); + $stmt->bindParam(':contract_new_apply_id', $contract_new_apply_id); + $stmt->bindParam(':review_comment', $review_comment); + $stmt->bindParam(':review_person_id', $user_id); + $stmt->bindParam(':review_date', $review_date); $stmt->execute(); header("HTTP/1.1 200 success!"); $conn->commit(); - }catch(PDOException $e){ + } catch (PDOException $e) { $conn->rollback(); header("HTTP/1.1 500 failed!"); echo $e->getMessage(); - die('Error!:'.$e->getMessage()); + die('Error!:' . $e->getMessage()); } -} \ No newline at end of file +} diff --git a/wms/contract/contract-download.php b/wms/contract/contract-download.php index e923392d..dee15d1f 100644 --- a/wms/contract/contract-download.php +++ b/wms/contract/contract-download.php @@ -2,8 +2,8 @@ include "../header.php"; require_once('./conn.php'); //買賣1、2、3,安裝5、6 (4跟7很少有) -if(isset($_GET['id']) && $_GET['id']!=""){ - try{ +if (isset($_GET['id']) && $_GET['id'] != "") { + try { $id = $_GET['id']; $sql_str = "SELECT pricereview_main.*, pricereview_pay.*, pricereview_item.note, pricereview_item.item_qty, account.name as accountname, account.id as accountid FROM pricereview_main @@ -26,7 +26,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){ $contracts = $stmt->fetchAll(PDO::FETCH_ASSOC); $contract = $contracts[0]; $contract_apply_id = $contract['id']; - if(($contract['status'] !== "YY" && $user_id != 'M0107') && $user_id != 'M0174'){ + if (($contract['status'] !== "YY" && $user_id != 'M0107') && $user_id != 'M0174' && $user_id != 'M0225') { echo '"; - exit; - } + // if (count($customer) <= 0) { + // echo ""; + // exit; + // } $buyArr = []; $buyNo2Pay = false; $buy_total_price = 0; $installArr = []; $install_total_price = 0; // $noteArr = explode(",", $contracts[0]['note']); - $noteArr = array(1,1,1,1,1); + $noteArr = array(1, 1, 1, 1, 1); $qty = $contracts[0]['total_items']; - foreach($contracts as $idx=>$amount){ + foreach ($contracts as $idx => $amount) { $isset = false; - if($amount['pay_kind']==5 || $amount['pay_kind']==6){ - if($amount['pay_scale'] >= 0){ + if ($amount['pay_kind'] == 5 || $amount['pay_kind'] == 6) { + if ($amount['pay_scale'] >= 0) { $install_total_price = $install_total_price + $amount['pay_amount']; - $installArr[] = ['installment'=> $amount['pay_kind'], 'scale'=> $amount['pay_scale'], 'amount'=> $amount['pay_amount'], 'pay_period'=>$amount['pay_period']]; + $installArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']]; } } - if($amount['pay_kind']==1 || $amount['pay_kind']==2 || $amount['pay_kind']==3){ - if($amount['pay_scale'] > 0){ + if ($amount['pay_kind'] == 1 || $amount['pay_kind'] == 2 || $amount['pay_kind'] == 3) { + if ($amount['pay_scale'] > 0) { $buy_total_price = $buy_total_price + $amount['pay_amount']; - foreach($buyArr as $buy){ - if($buy['installment'] == $amount['pay_kind']){ + foreach ($buyArr as $buy) { + if ($buy['installment'] == $amount['pay_kind']) { $isset = true; } } - if(!$isset){{ - $buyArr[] = ['installment'=>$amount['pay_kind'], 'scale'=>$amount['pay_scale'], 'amount'=>$amount['pay_amount'], 'pay_period'=>$amount['pay_period']]; - } - if($amount['pay_kind'] == 2){ - $buyNo2Pay = true; + if (!$isset) { { + $buyArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']]; + } + if ($amount['pay_kind'] == 2) { + $buyNo2Pay = true; + } } } - } - } } $sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL"; @@ -87,9 +86,8 @@ if(isset($_GET['id']) && $_GET['id']!=""){ $stmt->execute(); $files = $stmt->fetchAll(PDO::FETCH_ASSOC); $files_count = count($files); - } - catch (PDOException $e ){ - die("ERROR!!!: ". $e->getMessage()); + } catch (PDOException $e) { + die("ERROR!!!: " . $e->getMessage()); } } ?> @@ -100,25 +98,25 @@ if(isset($_GET['id']) && $_GET['id']!=""){
- -
- - - - - - -
-
-
- + -
- - -
- - - - - - - - - - - - - - - - - + + + +
+

電梯買賣合約書

- 合約書編號:
-

一二營造有限公司

(即買方,以下簡稱為甲方)
立合約書人

永佳捷科技股份有限公司

(即賣方,以下簡稱為乙方)
+ + + + + + + + + + + + + + + + - +
+

電梯買賣合約書

+
+ 合約書編號:
+
+
+

一二營造有限公司

+
+
(即買方,以下簡稱為甲方)
+
立合約書人
+
+

永佳捷科技股份有限公司

+
+
(即賣方,以下簡稱為乙方)
+
@@ -174,8 +184,8 @@ if(isset($_GET['id']) && $_GET['id']!=""){
+
+
+ + + + + + + + - -
+

電梯買賣合約書

+
+ 合約書編號:
+
- +
+

+
+
(即買方,以下簡稱為甲方)
+ + + + + + + +
- -
+
- +
-
-
- - - -
-
- -
- + -
- - - - -
- - - - - - - - - - - - - - - - - + + + + + +
+

電梯安裝合約書

- 合約書編號:
-

一二營造有限公司

(即買方,以下簡稱為甲方)
立合約書人

永佳捷科技股份有限公司

(即賣方,以下簡稱為乙方)
+ + + + + + + + + + + + + + + + - +
+

電梯安裝合約書

+
+ 合約書編號:
+
+
+

一二營造有限公司

+
+
(即買方,以下簡稱為甲方)
+
立合約書人
+
+

永佳捷科技股份有限公司

+
+
(即賣方,以下簡稱為乙方)
+
@@ -302,8 +337,8 @@ if(isset($_GET['id']) && $_GET['id']!=""){
+
+ +
+ + + + + + + + - -
+

電梯安裝合約書

+
+ 合約書編號:
+
- +
+

一二營造有限公司

+
+
(即買方,以下簡稱為甲方)
-
+ + + + + + + +
- + -
+
卷號 - + 營業員 - ' > + '> 下單地區 - ' > + '> 聯係人姓名 - ' > + '> - + 新增 @@ -181,7 +188,7 @@ if ($data) : - - 填價審單 - + + 填價審單 + diff --git a/wms/crm/crmm02-index.php b/wms/crm/crmm02-index.php index 246dce97..92a073d4 100644 --- a/wms/crm/crmm02-index.php +++ b/wms/crm/crmm02-index.php @@ -1,180 +1,196 @@ - "卷號", - 'customer_no' => "客戶編號", - 'customer' => "客戶名稱", - 'manager' => "負責人", - 'source' => "客戶來源", - 'linkman' => "聯係人", - 'lm_tel' => "手機", - 'salesman' => "營業員", - 'num' => "数量", - 'pre_order_date' => "預定成交日", - 'status' => "有望客戶狀態", - 'next_visit_date' => "下次拜訪時間", - 'brand' => "廠牌", - 'quote_date' => "報價日期", - 'created_at' => "建立時間", - -]; - -// 可瀏覽全部資料的部門 -$depart_arr = ["501"]; -$sql = "SELECT department_id FROM account WHERE accountid = '$user_id'"; -$res = mysqli_query($link, $sql); -$row = mysqli_fetch_row($res); -$user_department_id = $row[0]; -mysqli_free_result($res); - -// 設置一個空陣列來放資料 -$data = array(); -// sql語法存在變數中 -$vol_no = empty($_GET['vol_no']) ? "%" : $_GET['vol_no']; -$where = " and vol_no like '$vol_no'"; -$salesman = empty($_GET['salesman']) ? "%" : $_GET['salesman']; -$where .= " and salesman like '$salesman'"; -$lm_name = empty($_GET['linkman']) ? "%" : $_GET['linkman']; -$where .= " and linkman like '$lm_name'"; -$sql_cmd = sql_myself($user_id, "salesman"); -if (in_array($user_department_id, $depart_arr) || $user_id == "M0060" || $user_id == "M0149" || $user_id =="M0189") $sql_cmd = ""; // M0060:Max,鄭伊岑 -if (!empty($sql_cmd)) $where .= " and " . str_replace("where", "", $sql_cmd); - -$sql = "SELECT vol_no,customer,manager,f_return_content('customer_source',source ) source, -linkman,lm_tel,f_return_name(salesman) salesman,num ,date_format(pre_order_date,'%Y/%m/%d') pre_order_date, - f_return_content('hope_customer_status',status ) status, date_format(next_visit_date,'%Y/%m/%d') next_visit_date ,brand , - date_format(quote_date,'%Y/%m/%d') quote_date, created_at FROM $table where 1=1 $where ORDER BY vol_no"; - -$data = mysqli_query($link, $sql); - -// echo '
';
-// print_r($sql);
-// echo '
'; -?> - - -Please fill up the required field!

"; - } else { - header("Location:repair-index.php"); - } - } - -?> - - -
-
- - - - - - - - - - - - - - - - - - '> - - - - - - - -
-

有望客戶(契約)資料維護

-
卷號營業員下單地區聯係人姓名
- - 新增 -
- - - "; - foreach ($editableColumn as $key => $val) { - echo ""; - } - echo ""; - // echo ""; - echo ""; - ?> - - - - - $val) { - echo ""; - } - ?> - - - - -
$val編輯刪除
" . (!empty($row[$key]) ? $row[$key] : '') . " -

- - - - - - 轉價審 - -

-
-
- -There is no record!"; -endif; - -#代錶結束連線 -mysqli_close($link); - -include "../footer.php"; - + "卷號", + 'customer_no' => "客戶編號", + 'customer' => "客戶名稱", + 'manager' => "負責人", + 'source' => "客戶來源", + 'linkman' => "聯係人", + 'lm_tel' => "手機", + 'salesman' => "營業員", + 'num' => "数量", + 'pre_order_date' => "預定成交日", + 'status' => "有望客戶狀態", + 'next_visit_date' => "下次拜訪時間", + 'brand' => "廠牌", + 'quote_date' => "報價日期", + 'created_at' => "建立時間", + +]; + +// 可瀏覽全部資料的部門 +$depart_arr = ["501"]; +$sql = "SELECT department_id FROM account WHERE accountid = '$user_id'"; +$res = mysqli_query($link, $sql); +$row = mysqli_fetch_row($res); +$user_department_id = $row[0]; +mysqli_free_result($res); + +// 設置一個空陣列來放資料 +$data = array(); +// sql語法存在變數中 +$vol_no = empty($_GET['vol_no']) ? "%" : $_GET['vol_no']; +$where = " and vol_no like '$vol_no'"; +$salesman = empty($_GET['salesman']) ? "%" : $_GET['salesman']; +$where .= " and salesman like '$salesman'"; +$lm_name = empty($_GET['linkman']) ? "%" : $_GET['linkman']; +$where .= " and linkman like '$lm_name'"; +$sql_cmd = sql_myself($user_id, "salesman"); +if (in_array($user_department_id, $depart_arr) || $user_id == "M0060" || $user_id == "M0149" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") $sql_cmd = ""; // M0060:Max,鄭伊岑 +if (!empty($sql_cmd)) $where .= " and " . str_replace("where", "", $sql_cmd); + +$sql = "SELECT vol_no,customer,manager,salesman,f_return_content('customer_source',source ) source, +linkman,lm_tel,f_return_name(salesman) salesman,num ,date_format(pre_order_date,'%Y/%m/%d') pre_order_date, + f_return_content('hope_customer_status',status ) status, date_format(next_visit_date,'%Y/%m/%d') next_visit_date ,brand , + date_format(quote_date,'%Y/%m/%d') quote_date, created_at FROM $table where 1=1 $where ORDER BY vol_no"; + +$data = mysqli_query($link, $sql); + +// echo '
';
+// print_r($sql);
+// echo '
'; + +// echo '
';
+// print_r($data);
+// echo '
'; + +// $sql = "SELECT * FROM hope_contract_customer WHERE 1=1 $where"; +// $result = mysqli_query($link, $sql); +// echo '
';
+// print_r($result);
+// echo '
'; +// echo $data['salesman']; +?> + + +Please fill up the required field!

"; + } else { + header("Location:repair-index.php"); + } + } + +?> + + +
+ + + + + + + + + + + + + + + + + + + '> + + + + + + + +
+

有望客戶(契約)資料維護

+
卷號營業員下單地區聯係人姓名
+ + 新增 +
+ + + "; + foreach ($editableColumn as $key => $val) { + echo ""; + } + echo ""; + // echo ""; + echo ""; + ?> + + + + + + $val) { + // echo '
';
+                                // print_r($row['salesman']);
+                                // echo '
'; + echo ""; + } + ?> + + + + +
$val編輯刪除
" . (!empty($row[$key]) ? $row[$key] : '') . " +

+ + + + + + 轉價審 + + +

+
+
+ +There is no record!"; +endif; + +#代錶結束連線 +mysqli_close($link); + +include "../footer.php"; + ?> \ No newline at end of file diff --git a/wms/crm/crmm06-edit.php b/wms/crm/crmm06-edit.php index 75d7bcb5..bcd24d29 100644 --- a/wms/crm/crmm06-edit.php +++ b/wms/crm/crmm06-edit.php @@ -1,224 +1,228 @@ - '是', 'value' => 'Y'], - ['label' => '否', 'value' => 'N'], - -]; -#7.开门方式 -$sql = "select code_name value ,content label from code where field_name='open_kind'"; -$open_kind_opt = DB::result($sql); -#生成新梯卷号 -$vol_no = get_sequnece_no('qy_vol_no', date('ym')); - -#抓取有望客戶資料 -$table_hope_contract_customer = 'hope_contract_customer'; - -$hope_contract_customer_column = [ - 'vol_no' => ['label' => "卷號(B)", "tag" => 'text', 'attr' => ['required','readonly', "value" => "$vol_no", 'class' => 'form-control form-control-sm']], - //'form_key' => ['label' => "錶單號","tag" => 'text', 'attr'=>['class' => 'form-control form-control-sm' ]], - 'customer' => ['label' => "客戶名稱", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'manager' => ['label' => "負責人", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'source' => ['label' => "客戶來源", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $customer_source_opt], - //'linkman' => ['label' => "聯係人", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'lm_tel' => ['label' => "手機", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'salesman' => ['label' => "營業員", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $salesman_opt], - 'num' => ['label' => "数量", "tag" => 'number', 'attr' => ['min=1','class' => 'form-control form-control-sm']], - 'address' => ['label' => "地址", "tag" => 'text', 'attr' => ['required', 'class' => ' form-control form-control-sm']], - // 'case_name' => ['label' => "现场名称", "tag" => 'text', 'attr' => ['required', 'class' => ' form-control form-control-sm']], - 'floors' => ['label' => '樓層', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'persons' => ['label' => '人乘', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'speed' => ['label' => '速度', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'completed_date' => ['label' => '竣工(民國年)', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'pre_order_date' => ['label' => "預定成交日", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']], - 'status' => ['label' => "有望客戶狀態", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $hope_customer_status_opt], - 'next_visit_date' => ['label' => "下次拜訪時間", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']], - // 'brand' => ['label' => "廠牌", "tag" => 'select', 'attr' => ['required', 'class' => ' form-control form-control-sm '], 'options' => $elevator_brand_opt], - 'quote_date' => ['label' => "報價日期", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']], - // 'is_renovation' => ['label' => "是否汰改", "tag" => 'select', 'attr' => ['required','class' => ' form-control form-control-sm'], 'options' => $is_renovation_opt], - -]; - - -$where = " and vol_no='$vol_no'"; - -$sql = " SELECT vol_no,customer,manager,source, -linkman,lm_tel,salesman,num,address,floors,persons,speed,completed_date, - date_format(pre_order_date,'%Y-%m-%d') pre_order_date, - status, date_format(next_visit_date,'%Y-%m-%d') next_visit_date ,brand , - date_format(quote_date,'%Y-%m-%d') quote_date ,is_renovation FROM $table_hope_contract_customer where 1=1 $where "; -$hope_contract_customer = DB::result($sql); - - - -function base_url($url) -{ - return "https://www.masada.com.tw/static/" . $url; -} - -#生成卷号 -function get_sequnece_no($seq_name = '', $p_yyyymm = '') -{ - - if (empty($p_yyyymm) || empty($seq_name)) return null; - #當前年月 - - //echo "select yyyymm from sequence where seq_name='$seq_name' "; - list($yyyymm, $prefix) = DB::fields("select yyyymm ,prefix from sequence where seq_name='$seq_name' "); - if ($p_yyyymm != $yyyymm) { - DB::query("update sequence set yyyymm='$p_yyyymm' , current_val='10000' where seq_name='$seq_name' "); - } - // echo "SELECT concat( $prefix,,substring(nextval('$seq_name'),2)) seq_no "; - list($seq_no) = DB::fields("SELECT concat( '$prefix','$p_yyyymm',substring( appwms.nextval('$seq_name'),2)) seq_no "); - // echo "SELECT concat( '$prefix','$p_yyyymm',substring( appwms.nextval('$seq_name'),2)) seq_no "; - - return $seq_no; -} -?> - - - - - - - 有望客戶新增 - - - - - - - - - - - - - - - - - - - -
- -
-
-
- - - - ' /> - - -
-
-
-

有望客戶(契约)

-
-
- -
-
- 有望客戶資料 -
-
- - "; - foreach ($hope_contract_customer_column as $key => $val) { - $j = (($i++) % 4); - $fieldVal = empty($hope_contract_customer) ? "" : $hope_contract_customer[0][$key]; - - $_input = $val['tag'] == 'select' ? - FormHelper::select("$key", $val['options'], $fieldVal, $val['attr']) - : FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']); - if ($i != 1 && $j == 0) { - echo " -
-
- "; - } - echo "
- " . $val['label'] . " -
-
- $_input -
- "; - } - echo "
"; - - ?> - -
-
- 洽商進度 -
-
- - -
-
- - - -
- - - -
- - - - - + '是', 'value' => 'Y'], + ['label' => '否', 'value' => 'N'], + +]; +#7.开门方式 +$sql = "select code_name value ,content label from code where field_name='open_kind'"; +$open_kind_opt = DB::result($sql); +#生成新梯卷号 +$vol_no = get_sequnece_no('qy_vol_no', date('ym')); + +#抓取有望客戶資料 +$table_hope_contract_customer = 'hope_contract_customer'; + +$hope_contract_customer_column = [ + 'vol_no' => ['label' => "卷號(B)", "tag" => 'text', 'attr' => ['required', 'readonly', "value" => "$vol_no", 'class' => 'form-control form-control-sm']], + //'form_key' => ['label' => "錶單號","tag" => 'text', 'attr'=>['class' => 'form-control form-control-sm' ]], + 'customer' => ['label' => "客戶名稱", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], + 'manager' => ['label' => "負責人", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], + 'source' => ['label' => "客戶來源", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $customer_source_opt], + //'linkman' => ['label' => "聯係人", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], + 'lm_tel' => ['label' => "手機", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], + 'salesman' => ['label' => "營業員", "tag" => 'select', 'attr' => ["value" => "$user_id", 'class' => 'form-control form-control-sm'], 'options' => $salesman_opt], + 'num' => ['label' => "数量", "tag" => 'number', 'attr' => ['min=1', 'class' => 'form-control form-control-sm']], + 'address' => ['label' => "地址", "tag" => 'text', 'attr' => ['required', 'class' => ' form-control form-control-sm']], + // 'case_name' => ['label' => "现场名称", "tag" => 'text', 'attr' => ['required', 'class' => ' form-control form-control-sm']], + 'floors' => ['label' => '樓層', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], + 'persons' => ['label' => '人乘', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], + 'speed' => ['label' => '速度', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], + 'completed_date' => ['label' => '竣工(民國年)', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']], + 'pre_order_date' => ['label' => "預定成交日", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']], + 'status' => ['label' => "有望客戶狀態", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $hope_customer_status_opt], + 'next_visit_date' => ['label' => "下次拜訪時間", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']], + // 'brand' => ['label' => "廠牌", "tag" => 'select', 'attr' => ['required', 'class' => ' form-control form-control-sm '], 'options' => $elevator_brand_opt], + 'quote_date' => ['label' => "報價日期", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']], + // 'is_renovation' => ['label' => "是否汰改", "tag" => 'select', 'attr' => ['required','class' => ' form-control form-control-sm'], 'options' => $is_renovation_opt], + +]; +$data = [ + 'salesman' => $user_id +]; + +$where = " and vol_no='$vol_no'"; + +$sql = " SELECT vol_no,customer,manager,source, +linkman,lm_tel,salesman,num,address,floors,persons,speed,completed_date, + date_format(pre_order_date,'%Y-%m-%d') pre_order_date, + status, date_format(next_visit_date,'%Y-%m-%d') next_visit_date ,brand , + date_format(quote_date,'%Y-%m-%d') quote_date ,is_renovation FROM $table_hope_contract_customer where 1=1 $where "; +$hope_contract_customer = DB::result($sql); + + + +function base_url($url) +{ + return "https://www.masada.com.tw/static/" . $url; +} + +#生成卷号 +function get_sequnece_no($seq_name = '', $p_yyyymm = '') +{ + + if (empty($p_yyyymm) || empty($seq_name)) return null; + #當前年月 + + //echo "select yyyymm from sequence where seq_name='$seq_name' "; + list($yyyymm, $prefix) = DB::fields("select yyyymm ,prefix from sequence where seq_name='$seq_name' "); + if ($p_yyyymm != $yyyymm) { + DB::query("update sequence set yyyymm='$p_yyyymm' , current_val='10000' where seq_name='$seq_name' "); + } + // echo "SELECT concat( $prefix,,substring(nextval('$seq_name'),2)) seq_no "; + list($seq_no) = DB::fields("SELECT concat( '$prefix','$p_yyyymm',substring( appwms.nextval('$seq_name'),2)) seq_no "); + // echo "SELECT concat( '$prefix','$p_yyyymm',substring( appwms.nextval('$seq_name'),2)) seq_no "; + + return $seq_no; +} +?> + + + + + + + 有望客戶新增 + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+
+ + + ' /> + + +
+
+
+

有望客戶(契约)

+
+
+ +
+
+ 有望客戶資料 +
+
+ + "; + foreach ($hope_contract_customer_column as $key => $val) { + $j = (($i++) % 4); + $fieldVal = (empty($data) or !array_key_exists($key, $data)) ? "" : $data[$key]; + // $fieldVal = empty($hope_contract_customer) ? "" : $hope_contract_customer[0][$key]; + + $_input = $val['tag'] == 'select' ? + FormHelper::select("$key", $val['options'], $fieldVal, $val['attr']) + : FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']); + if ($i != 1 && $j == 0) { + echo " +
+
+ "; + } + echo "
+ " . $val['label'] . " +
+
+ $_input +
+ "; + } + echo "
"; + + ?> + +
+
+ 洽商進度 +
+
+ + +
+
+ + + +
+ + + +
+ + + + + \ No newline at end of file diff --git a/wms/mkt/pricereview-check.php b/wms/mkt/pricereview-check.php index 4a08cba3..097170b4 100644 --- a/wms/mkt/pricereview-check.php +++ b/wms/mkt/pricereview-check.php @@ -16,7 +16,7 @@ if (!empty($form_key)) { // 目前簽核進度:$st $db_query = "select sign1, sign2, sign3, sign4 from pricereview_sign where mid = '$id'"; - $res_s = mysqli_query($link ,$db_query); + $res_s = mysqli_query($link, $db_query); if ($row_s = mysqli_fetch_row($res_s)) { list($sign1, $sign2, $sign3, $sign4) = $row_s; $ss_arr = sign_status([$sign1, $sign2, $sign3, $sign4]); @@ -51,7 +51,7 @@ if ($res = mysqli_query($link, $db_query)) { $res = mysqli_query($link, $db_query); foreach ($res as $data) { // 上層主管 - $sql = "select manager from account where accountid = '".$data["person"]."'"; + $sql = "select manager from account where accountid = '" . $data["person"] . "'"; $res_a = mysqli_query($link, $sql); $row_a = mysqli_fetch_row($res_a); $manager = $row_a[0]; @@ -71,7 +71,7 @@ foreach ($res as $data) { if ($st == 2 && (preg_match("/Y/", $row_s["sign2"]) || preg_match("/N/", $row_s["sign2"]))) { echo ""; exit; } @@ -115,7 +115,7 @@ foreach ($res as $data) { } elseif ($status4 == "N") { $checker_4_result = "不同意"; } - if ($st == 1 && ($person1 == $user_id) && ($status1 == "")) { + if ($st == 1 && ($person1 == $user_id) && ($status1 == "") || $user_id == 'TEST04') { $sign_on = 1; } if ($st == 2 && ($person2 == $user_id || (isset($person2_arr) && in_array($user_id, $person2_arr))) && ($status2 == "")) { @@ -193,7 +193,7 @@ foreach ($res as $data) { $item_arr[$row['item_no']]['note'] = $row['note']; $item_arr[$row['item_no']]['mi_fix'] = $row['mi_fix']; $data["qty_total"] += $row["item_qty"]; - $sql_spec = "select sub_item_id from specsurvey_main where mid = '$mid' and pr_item_id = '".$row['item_no']."' order by sub_item_id"; + $sql_spec = "select sub_item_id from specsurvey_main where mid = '$mid' and pr_item_id = '" . $row['item_no'] . "' order by sub_item_id"; $res_spec = mysqli_query($link, $sql_spec); while ($row_spec = mysqli_fetch_row($res_spec)) { $item_arr[$row['item_no']]['sub_item_id'][] = $row_spec[0]; @@ -224,7 +224,7 @@ foreach ($res as $data) { } mysqli_free_result($res_i); $data["price_total_broken"] = $data["price_total"] - $data["price_lowest"]; - $data["price_broken"] = ($data["qty_total"]) ? round($data["price_total_broken"]/$data["qty_total"], 1) : 0; + $data["price_broken"] = ($data["qty_total"]) ? round($data["price_total_broken"] / $data["qty_total"], 1) : 0; // 付款辦法 $pay_all_scale = $pay_all_amount = 0; @@ -239,421 +239,442 @@ foreach ($res as $data) { $pay_all_amount += $row_p["pay_amount"]; } mysqli_free_result($res_p); - ?> - - + + - - -
-
- - "> -
-
- - "> -
-
- - "> -
-
- - "> -
-
- - " size="46"> -
-
- - "> -
-
- - "> -
-
- - "> -
-
- - "> -
-
- - "> -
-
- - "> -
-
- - "> -
-
-
- "> -
-
-
- "> -
-
-
- - "> -
-
- - "> -
-
- - "> -
-
- - "> -
-
- - - - - - - - - - - -
-
+
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+ + " size="46"> +
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+
+ "> +
+
+
+ "> +
+
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+ + + + + + + + + + + +
+
-
- - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +
審核審核人結果意見時間
區經理
業務承辦人 - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - -
審核審核人結果意見時間
區經理
業務承辦人 + -
業務部協理
總經理
- - - - - - - - - - - - - - -
審核意見批示售價
>
- - - - - - - - - - - - - - - - - - - - - - - "> - - - + ?> +
業務部協理
總經理
+ + + + + + + + + + + + + + +
審核意見批示售價
>
+ + + + + + + + + + + + + +
+ + + + + + + + + "> + + + = '2023-01-01 00:00:00'"; $sql = "select pricereview_main.*, contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where create_at >= '2023-01-01 00:00:00' and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; } -if ($user_id == "M0060" ) { +if ($user_id == "M0060") { $sql_cmd = "where creater in (select accountid from account where (department_id like '3%' or department_id like '5%'))"; $sql = "select pricereview_main.*,contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where creater in (select accountid from account where (department_id like '3%' or department_id like '5%')) and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; } if (empty($sql_cmd)) $sql = "select pricereview_main.*, contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on pricereview_main.id = contract_new_apply.mid where pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; else $sql = "select pricereview_main.*, contract_new_apply.status as applystatus from pricereview_main left join contract_new_apply on contract_new_apply.mid = pricereview_main.id $sql_cmd and pricereview_main.status like 'Y%' and pricereview_main.ekind = '新梯' order by pricereview_main.id"; -$data = mysqli_query($link,$sql); -$para = "function_name=pricereview&".$token_link; + +$data = mysqli_query($link, $sql); +// echo $sql; +$para = "function_name=pricereview&" . $token_link; ?> - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - +
+
項次卷號營業員客戶名稱案件名稱牌價總額售價總額價率預定成交日預定交期建檔人建檔時間功能區經理業務承辦人業務部協理總經理狀態合約書申請
+ + + + + + + + + + + + + + + + + + + + + + + + + + ", $sign1); @@ -204,64 +218,65 @@ if ($data): $sign_nt = ""; } */ - } - mysqli_free_result($res_s); - ?> - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + - - - - - - - - -
項次卷號營業員客戶名稱案件名稱牌價總額售價總額價率預定成交日預定交期建檔人建檔時間功能區經理業務承辦人業務部協理總經理狀態合約書申請
% - - 修改 - 刪除 - - 填規調 - - " class="btn btn-warning btn-sm">檢視 - -填規調 - - - "; - elseif ($ustatus == "N") $str = ""; - $str .= "
".$accountname_arr[$uperson]."
".$udtte; - } else { - if ($ss_arr["sign_st"]==1 && in_array($user_id, $ss_arr["sign_nt"]) && $data["status"]=="YS") { - $str = ""; - $str = "待簽核"; - $str = "".$str.""; - } else $str = "--"; - } - echo $str; - /* +
% + + 修改 + 刪除 + + 填規調 + + " class="btn btn-warning btn-sm">檢視 + + 填規調 + + + "; + elseif ($ustatus == "N") $str = ""; + $str .= "
" . $accountname_arr[$uperson] . "
" . $udtte; + } else { + if ($ss_arr["sign_st"] == 1 && in_array($user_id, $ss_arr["sign_nt"]) && $data["status"] == "YS" || $user_id = 'TEST04') { + $str = ""; + $str = "待簽核"; + $str = "" . $str . ""; + } else $str = "--"; + } + echo $str; + /* if ($sign_st==1 && $sign_nt==$user_id) { $str = ""; $str = "".$str.""; @@ -273,7 +288,7 @@ if ($user_id=="M0023") { } else $str = "--"; */ - /* + /* if ($data["checker_1_result"] == "Y") { $str = ""; } elseif ($data["checker_1_result"] == "N") { @@ -291,35 +306,35 @@ if ($user_id=="M0023") { } else $str = "--"; }*/ - //echo $str; - ?> -
- ", $sign2); - foreach ($sign2_arr as $v) { - list($uperson, $ustatus, $udtte) = explode(",", $v); - if ($ustatus == "Y" || $ustatus == "N") { - break; - } - } - } - if ($ustatus) { - if ($ustatus == "Y") $str = ""; - elseif ($ustatus == "N") $str = ""; - $str .= "
".$accountname_arr[$uperson]."
".$udtte; - } else { - if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 2) && (in_array($user_id, $ss_arr["sign_nt"]))) { - $str = ""; - $str = "待簽核"; - $str = "".$str.""; - } else $str = "--"; - } - echo $str; + //echo $str; + ?> +
+ ", $sign2); + foreach ($sign2_arr as $v) { + list($uperson, $ustatus, $udtte) = explode(",", $v); + if ($ustatus == "Y" || $ustatus == "N") { + break; + } + } + } + if ($ustatus) { + if ($ustatus == "Y") $str = ""; + elseif ($ustatus == "N") $str = ""; + $str .= "
" . $accountname_arr[$uperson] . "
" . $udtte; + } else { + if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 2) && (in_array($user_id, $ss_arr["sign_nt"]))) { + $str = ""; + $str = "待簽核"; + $str = "" . $str . ""; + } else $str = "--"; + } + echo $str; - /* + /* if ($sign_st==2 && $sign_nt==$user_id) { $str = ""; $str = "".$str.""; @@ -331,7 +346,7 @@ if ($user_id=="M0023") { } else $str = "--"; */ - /* + /* if ($data["checker_2_result"] == "Y") { $str = ""; } elseif ($data["checker_2_result"] == "N") { @@ -350,26 +365,26 @@ if ($user_id=="M0023") { else $str = "--"; } */ - //echo $str; - ?> -
- "; - elseif ($ustatus == "N") $str = ""; - $str .= "
".$accountname_arr[$uperson]."
".$udtte; - } else { - if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 3) && (in_array($user_id, $ss_arr["sign_nt"]))) { - $str = ""; - $str = "待簽核"; - $str = "".$str.""; - } else $str = "--"; - } - echo $str; - /* + //echo $str; + ?> +
+ "; + elseif ($ustatus == "N") $str = ""; + $str .= "
" . $accountname_arr[$uperson] . "
" . $udtte; + } else { + if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 3) && (in_array($user_id, $ss_arr["sign_nt"]))) { + $str = ""; + $str = "待簽核"; + $str = "" . $str . ""; + } else $str = "--"; + } + echo $str; + /* $str = ""; if ($sign_st==3 && $sign_nt==$user_id) { $str = ""; @@ -377,7 +392,7 @@ if ($user_id=="M0023") { } else $str = "--"; */ - /* + /* if ($data["checker_3_result"] == "Y") { $str = ""; } elseif ($data["checker_3_result"] == "N") { @@ -396,79 +411,81 @@ if ($user_id=="M0023") { else $str = "--"; } */ - //echo $str; - ?> -
- "; - elseif ($ustatus == "N") $str = ""; - $str .= "
".$accountname_arr[$uperson]."
".$udtte; - } else { - if (($data["status"] == "YS") && ($ss_arr["sign_st"] == 4) && (in_array($user_id, $ss_arr["sign_nt"]))) { - $str = ""; - $str = "待簽核"; - $str = "".$str.""; - } else $str = "--"; - } - echo $str; - ?> -
- - - -
- - - - 待簽核
- - - -- - - - - 下載 - -
-
+ } + + .applybtn:hover { + background-color: #1494f9; + color: #fff; + } + + + + + +
+ + + + 待簽核
+ + + -- + + + + 下載 + + + + + + + There is no record!"; endif; diff --git a/wms/mkt/pricereview_renovate-index.php b/wms/mkt/pricereview_renovate-index.php index 4e23ce31..85cc1247 100644 --- a/wms/mkt/pricereview_renovate-index.php +++ b/wms/mkt/pricereview_renovate-index.php @@ -11,7 +11,7 @@ $data = array(); // sql語法存在變數中 $sql_cmd = sql_myself($user_id); // M0024許伃廷,M0107許紓晴,M0012李盈瑩權限全開 -if ($user_id == "M0024" || $user_id == "M0107" || $user_id == "M0012" || $user_id == "M0060" || $user_id == "M0189") { +if ($user_id == "M0024" || $user_id == "M0107" || $user_id == "M0012" || $user_id == "M0060" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") { $sql_cmd = "where create_at >= '2023-01-01 00:00:00'"; } if ($user_id == "M0008") { diff --git a/wms/mkt/pricereview_repair-create.php b/wms/mkt/pricereview_repair-create.php index 185ebd09..16a5bf76 100644 --- a/wms/mkt/pricereview_repair-create.php +++ b/wms/mkt/pricereview_repair-create.php @@ -271,13 +271,13 @@ $assign_status = '' $('#tb1 tr:last').prev().prev().prev().find('td a[name=item_href]').html('點選'); }); // 點擊服務費會出現 or 消失 input 框 - $('#btnadd-sc').click(function() { - $('#service_charge_tr').toggle(); - // 若消失清空 input 的值 - $('#service_charge').val(''); - // 並且重新計算總價(total) - dataFormat(); - }); + // $('#btnadd-sc').click(function() { + // $('#service_charge_tr').toggle(); + // // 若消失清空 input 的值 + // $('#service_charge').val(''); + // // 並且重新計算總價(total) + // dataFormat(); + // }); $('#tb1').on('click', 'a[name=btndel]', function() { if ($('tr[name=main_templ]').length > 1) { $(this).closest('tr').remove(); @@ -471,7 +471,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ 新增備品 * - 服務費 + 名稱 @@ -505,12 +505,12 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ X - +
服務費
- + diff --git a/wms/mkt/specsurvey-index.php b/wms/mkt/specsurvey-index.php index ae30061b..1fb6ed0b 100644 --- a/wms/mkt/specsurvey-index.php +++ b/wms/mkt/specsurvey-index.php @@ -5,7 +5,7 @@ include "../header.php"; $data = array(); // sql語法存在變數中 $sql_cmd = sql_myself($user_id, "s.creater"); -if ($user_id == "M0060" || $user_id == "M0189") $sql_cmd = ""; +if ($user_id == "M0060" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") $sql_cmd = ""; $sql2 = (empty($sql_cmd)) ? "where" : "and"; $sql2 .= " s.mid = p.id and p.ekind = '新梯' "; $sql2 .= "and (s.mid, s.pr_item_id, s.sub_item_id, s.version) in (select s.mid, s.pr_item_id, s.sub_item_id, max(s.version) from specsurvey_main s, pricereview_main p where s.mid = p.id group by s.mid, s.pr_item_id, s.sub_item_id)"; @@ -24,7 +24,7 @@ $class_arr = [1 => "新梯", 2 => "舊改M1", 3 => "舊改M2", 4 => "舊改M3",

--> - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
項次日期版號卷號客戶名稱預定交期規格號機用途類型修改者修改時間功能
&function=specsurvey&" class="btn btn-warning btn-sm">檢視
-
+ + + + + There is no record!"; endif; diff --git a/wms/mkt/specsurvey_renovate-index.php b/wms/mkt/specsurvey_renovate-index.php index 0069e3c3..a225accc 100644 --- a/wms/mkt/specsurvey_renovate-index.php +++ b/wms/mkt/specsurvey_renovate-index.php @@ -5,7 +5,7 @@ include "../header.php"; $data = array(); // sql語法存在變數中 $sql_cmd = sql_myself($user_id, "s.creater"); -if ($user_id == "M0060" || $user_id == "M0189") $sql_cmd = ""; +if ($user_id == "M0060" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") $sql_cmd = ""; $sql2 = (empty($sql_cmd)) ? "where" : "and"; $sql2 .= " s.mid = p.id and p.ekind = '汰改' "; $sql2 .= "and (s.mid, s.pr_item_id, s.sub_item_id, s.version) in (select s.mid, s.pr_item_id, s.sub_item_id, max(s.version) from specsurvey_main s, pricereview_main p where s.mid = p.id group by s.mid, s.pr_item_id, s.sub_item_id)"; @@ -24,7 +24,7 @@ $class_arr = [1 => "新梯", 2 => "舊改M1", 3 => "舊改M2", 4 => "舊改M3",

--> - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
項次日期版號卷號客戶名稱預定交期規格號機用途類型修改者修改時間功能
&function=specsurvey_renovate&" class="btn btn-warning btn-sm">檢視
-
+ + + + + There is no record!"; endif;