diff --git a/wms/cont/api/getUsername.php b/wms/cont/api/getUsername.php new file mode 100644 index 00000000..396682d1 --- /dev/null +++ b/wms/cont/api/getUsername.php @@ -0,0 +1,15 @@ +prepare($sql_str); +$stmt->bindParam(':accountid', $accountid); +$stmt->execute(); +$user = $stmt->fetch(PDO::FETCH_ASSOC); +echo $user['name']; \ No newline at end of file diff --git a/wms/cont/api/postElevatorPricereview.php b/wms/cont/api/postElevatorPricereview.php index e69de29b..a55e27f8 100644 --- a/wms/cont/api/postElevatorPricereview.php +++ b/wms/cont/api/postElevatorPricereview.php @@ -0,0 +1,411 @@ +prepare($sql_str); +$stmt->bindParam(':vol_no', $vol_no); +$stmt->bindParam(':apply_key', $apply_key); +$stmt->execute(); +$contract = $stmt->fetch(PDO::FETCH_ASSOC); + +if(!$contract){ + $sql_str = "INSERT INTO con_maintance_examine_apply (apply_key, vol_no, customer, address, case_name ,brand, num, salesman, maintain_kind, contract_begin_date, contract_end_date, contract_kind, payment_kind, progress_remark, service_fee, total_price, total_sale_price, penalty, deposit_rate, keep_rate, warranty_rate, memo, status, creater, create_at) + VALUES (:apply_key, :vol_no, :customer, :address, :case_name ,:brand, :num, :salesman, :maintain_kind, :contract_begin_date, :contract_end_date, :contract_kind, :payment_kind, :progress_remark, :service_fee, :total_price, :total_sale_price, :penalty, :deposit_rate, :keep_rate, :warranty_rate, :memo, :status, :creater, :create_at)"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':apply_key', $apply_key); + $stmt->bindParam(':vol_no', $vol_no); + $stmt->bindParam(':customer', $customer); + $stmt->bindParam(':address', $address); + $stmt->bindParam(':case_name', $case_name); + $stmt->bindParam(':brand', $brand); + $stmt->bindParam(':num', $num); + $stmt->bindParam(':salesman', $salesman); + $stmt->bindParam(':maintain_kind', $maintain_kind); + $stmt->bindParam(':contract_begin_date', $contract_begin_date); + $stmt->bindParam(':contract_end_date', $contract_end_date); + $stmt->bindParam(':contract_kind', $contract_kind); + $stmt->bindParam(':payment_kind', $payment_kind); + $stmt->bindParam(':progress_remark', $progress_remark); + $stmt->bindParam(':service_fee', $serviceFee); + $stmt->bindParam(':total_price', $total_price); + $stmt->bindParam(':total_sale_price', $total_sale_price); + $stmt->bindParam(':penalty', $penalty); + $stmt->bindParam(':deposit_rate', $deposit_rate); + $stmt->bindParam(':keep_rate', $keep_rate); + $stmt->bindParam(':warranty_rate', $warranty_rate); + $stmt->bindParam(':memo', $remark); + $stmt->bindParam(':status', $status); + $stmt->bindParam(':creater', $creater); + $stmt->bindParam(':create_at', $current_date); + $stmt->execute(); + + $sql_str = "INSERT INTO con_maintance_examine_clear (apply_key, register_code, elevator_brand, elevator_kind, spec, weight, speed, stop, floors, persons, elevator_num, useful_years, last_check_date, speed_governors_check_expense, maintain_times, is_m1_bundle, maintain__months, maintain_period, maintain_method, stand_price, contract_price, sold_price, commission_expense, management_expense, annual_survey_expense, service_expense, cmstatus, updated_at, creater, created_at) + VALUES (:apply_key, :register_code, :elevator_brand, :elevator_kind, :spec, :weight, :speed, :stop, :floors, :persons, :elevator_num, :useful_years, :last_check_date, :speed_governors_check_expense, :maintain_times, :is_m1_bundle, :maintain__months, :maintain_period, :maintain_method, :stand_price, :contract_price, :sold_price, :commission_expense, :management_expense, :annual_survey_expense, :service_expense, :cmstatus, :updated_at, :creater, :created_at) "; + + foreach($elevators as $elevator){ + if(empty($elevator['permitNumber'])) $register_code = "A"; + + if($elevator['spec'] == "MAE100") $elevator_kind = "A"; + if($elevator['spec'] == "MAF100") $elevator_kind = "B"; + if($elevator['spec'] == "MAM200") $elevator_kind = "D"; + if($elevator['spec'] == "MAH100") $elevator_kind = "E"; + + $speed_governors_check_expense = null; + $maintain_times = 1; + $commission_expense = null; + $management_expense = null; + $service_expense = ($elevator['sale_price'] / $total_sale_price) * $serviceFee; + $cmstatus = "Y"; + + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':apply_key', $apply_key); + $stmt->bindParam(':item_no', $elevator['id']); + $stmt->bindParam(':register_code', $register_code); + $stmt->bindParam(':elevator_brand', $elevator['brand']); + $stmt->bindParam(':elevator_kind', $elevator_kind); + $stmt->bindParam(':spec', $elevator['spec']); + $stmt->bindParam(':weight', $elevator['weight']); + $stmt->bindParam(':speed', $elevator['speed']); + $stmt->bindParam(':stop', $elevator['stop']); + $stmt->bindParam(':floors', $elevator['stop']); + $stmt->bindParam(':persons', $elevator['person']); + $stmt->bindParam(':elevator_num', $elevator['qty']); + $stmt->bindParam(':useful_years', $elevator['checkYear']); + $stmt->bindParam(':last_check_date', $elevator['lastDate']); + $stmt->bindParam(':speed_governors_check_expense', $speed_governors_check_expense); + $stmt->bindParam(':maintain_times', $maintain_times); + $stmt->bindParam(':is_m1_bundle', $elevator['m1']); + $stmt->bindParam(':maintain__months', $elevator['months']); + $stmt->bindParam(':maintain_period', $elevator['cycle']); + $stmt->bindParam(':maintain_method', $elevator['method']); + $stmt->bindParam(':stand_price', $elevator['price']); + $stmt->bindParam(':contract_price', $elevator['sale_price']); + $stmt->bindParam(':sold_price', $elevator['sale_price']); + $stmt->bindParam(':commission_expense', $elevator['commission_expense']); + $stmt->bindParam(':management_expense', $elevator['management_expense']); + $stmt->bindParam(':annual_survey_expense', $elevator['yearCheckFee']); + $stmt->bindParam(':service_expense', $elevator['service_expense']); + $stmt->bindParam(':cmstatus', $cmstatus); + $stmt->bindParam(':updated_at', $updated_at); + $stmt->bindParam(':creater', $creater); + $stmt->bindParam(':created_at', $created_at); + $stmt->execute(); + } + + $sql_str = "INSERT INTO pricereview_maintain_item (mid, item_no, item_group, item_spec, option_relate_spec, item_unit_price, item_qty, item_price_bp, memo) + VALUES (:mid, :item_no, :item_group, :item_spec, :option_relate_spec, :item_unit_price, :item_qty, :item_price_bp, :memo)"; + + foreach($otherOptions as $option){ + $item_price_bp = $option['price']*$option['num']; + $option_relate_spec = $option['toElevator'][0]['id']; + $item_group = "E"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $apply_key); + $stmt->bindParam(':item_no', $option['pr_no']); + $stmt->bindParam(':item_group', $item_group); + $stmt->bindParam(':item_spec', $option['name']); + $stmt->bindParam(':option_relate_spec', $option_relate_spec); + $stmt->bindParam(':item_unit_price', $option['price']); + $stmt->bindParam(':item_qty', $option['num']); + $stmt->bindParam(':item_price_bp', $item_price_bp); + $stmt->bindParam(':memo', $option['memo']); + $stmt->execute(); + } +}else{ + $sql_str = "UPDATE con_maintance_examine_apply SET + case_name=:case_name, + num=:num, + maintain_kind=:maintain_kind, + contract_kind=:contract_kind, + payment_kind=:payment_kind, + contract_begin_date=:contract_begin_date, + contract_end_date=:contract_end_date, + service_fee=:service_fee, + total_price=:total_price, + total_sale_price=:total_sale_price, + penalty=:penalty, + deposit_rate=:deposit_rate, + keep_rate=:keep_rate, + warranty_rate=:warranty_rate, + remark=:remark, + status=:status, + updated_at=:updated_at + progress_remark=:progress_remark + WHERE apply_key=:apply_key AND vol_no=:vol_no"; + + $stmt->bindParam(':apply_key', $apply_key); + $stmt->bindParam(':vol_no', $vol_no); + $stmt->bindParam(':case_name', $case_name); + $stmt->bindParam(':num', $num); + $stmt->bindParam(':maintain_kind', $maintain_kind); + $stmt->bindParam(':contract_begin_date', $contract_begin_date); + $stmt->bindParam(':contract_end_date', $contract_end_date); + $stmt->bindParam(':contract_kind', $contract_kind); + $stmt->bindParam(':payment_kind', $payment_kind); + $stmt->bindParam(':progress_remark', $progress_remark); + $stmt->bindParam(':service_fee', $serviceFee); + $stmt->bindParam(':total_price', $total_price); + $stmt->bindParam(':total_sale_price', $total_sale_price); + $stmt->bindParam(':penalty', $penalty); + $stmt->bindParam(':deposit_rate', $deposit_rate); + $stmt->bindParam(':keep_rate', $keep_rate); + $stmt->bindParam(':warranty_rate', $warranty_rate); + $stmt->bindParam(':memo', $remark); + $stmt->bindParam(':status', $status); + $stmt->bindParam(':updated_at', $current_date); + $stmt->execute(); + + //整機單價 + $sql_str = "SELECT * FROM con_maintance_examine_clear WHERE apply_key=:apply_key AND vol_no=:vol_no"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':apply_key', $apply_key); + $stmt->bindParam(':vol_no', $vol_no); + $stmt->execute(); + $items = $stmt->fetchAll(PDO::FETCH_ASSOC); + + $oldItemsNo = (array)array_column($oldElevators, 'item_no'); + $newItemsNo = (array)array_column($elevators, 'id'); + $onlyInOldIds = array_values(array_diff($oldItemsNo, $newItemsNo)); // 只有舊的有,新傳入的沒有,所以刪除(delete) + $onlyInNewIds = array_values(array_diff($newItemsNo, $oldItemsNo)); //只有新傳入的有,舊的沒有,所以新增(insert) + $inBothIds = array_values(array_intersect($oldItemsNo, $newItemsNo)); //舊的跟新的都有,所以要更新(update) + + foreach($onlyInOldIds as $oldIdx){ + $sql_str = "DELETE FROM con_maintance_examine_clear WHERE apply_key = :apply_key AND item_no = :item_no AND vol_no=:vol_no"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':apply_key', $apply_key); + $stmt->bindParam(':item_no', $oldidx); + $stmt->bindParam(':vol_no', $vol_no); + $stmt->execute(); + } + foreach($onlyInNewIds as $newidx){ + $sql_str = "INSERT INTO con_maintance_examine_clear (apply_key, register_code, elevator_brand, elevator_kind, spec, weight, speed, stop, floors, persons, elevator_num, useful_years, last_check_date, speed_governors_check_expense, maintain_times, is_m1_bundle, maintain__months, maintain_period, maintain_method, stand_price, contract_price, sold_price, commission_expense, management_expense, annual_survey_expense, service_expense, cmstatus, updated_at, creater, created_at) + VALUES (:apply_key, :register_code, :elevator_brand, :elevator_kind, :spec, :weight, :speed, :stop, :floors, :persons, :elevator_num, :useful_years, :last_check_date, :speed_governors_check_expense, :maintain_times, :is_m1_bundle, :maintain__months, :maintain_period, :maintain_method, :stand_price, :contract_price, :sold_price, :commission_expense, :management_expense, :annual_survey_expense, :service_expense, :cmstatus, :updated_at, :creater, :created_at) "; + $elevator = array_values(array_filter($elevators, fn($el)=> $el['id'] == $newidx))[0]; + $register_code = empty($elevator['permitNumber']) ? "A" : $elevator['permitNumber']; + if($elevator['spec'] == "MAE100") $elevator_kind = "A"; + if($elevator['spec'] == "MAF100") $elevator_kind = "B"; + if($elevator['spec'] == "MAM200") $elevator_kind = "D"; + if($elevator['spec'] == "MAH100") $elevator_kind = "E"; + + $speed_governors_check_expense = null; + $maintain_times = 1; + $commission_expense = null; + $management_expense = null; + $service_expense = ($elevator['sale_price'] / $total_sale_price) * $serviceFee; + $cmstatus = "Y"; + + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':apply_key', $apply_key); + $stmt->bindParam(':item_no', $elevator['id']); + $stmt->bindParam(':register_code', $register_code); + $stmt->bindParam(':elevator_brand', $elevator['brand']); + $stmt->bindParam(':elevator_kind', $elevator_kind); + $stmt->bindParam(':spec', $elevator['spec']); + $stmt->bindParam(':weight', $elevator['weight']); + $stmt->bindParam(':speed', $elevator['speed']); + $stmt->bindParam(':stop', $elevator['stop']); + $stmt->bindParam(':floors', $elevator['stop']); + $stmt->bindParam(':persons', $elevator['person']); + $stmt->bindParam(':elevator_num', $elevator['qty']); + $stmt->bindParam(':useful_years', $elevator['checkYear']); + $stmt->bindParam(':last_check_date', $elevator['lastDate']); + $stmt->bindParam(':speed_governors_check_expense', $speed_governors_check_expense); + $stmt->bindParam(':maintain_times', $maintain_times); + $stmt->bindParam(':is_m1_bundle', $elevator['m1']); + $stmt->bindParam(':maintain__months', $elevator['months']); + $stmt->bindParam(':maintain_period', $elevator['cycle']); + $stmt->bindParam(':maintain_method', $elevator['method']); + $stmt->bindParam(':stand_price', $elevator['price']); + $stmt->bindParam(':contract_price', $elevator['sale_price']); + $stmt->bindParam(':sold_price', $elevator['sale_price']); + $stmt->bindParam(':commission_expense', $elevator['commission_expense']); + $stmt->bindParam(':management_expense', $elevator['management_expense']); + $stmt->bindParam(':annual_survey_expense', $elevator['yearCheckFee']); + $stmt->bindParam(':service_expense', $elevator['service_expense']); + $stmt->bindParam(':cmstatus', $cmstatus); + $stmt->bindParam(':updated_at', $updated_at); + $stmt->bindParam(':creater', $creater); + $stmt->bindParam(':created_at', $created_at); + $stmt->execute(); + } + + foreach($inBothIds as $bothidx){ + $sql_str = "INSERT INTO con_maintance_examine_clear (apply_key, register_code, elevator_brand, elevator_kind, spec, weight, speed, stop, floors, persons, elevator_num, useful_years, last_check_date, speed_governors_check_expense, maintain_times, is_m1_bundle, maintain__months, maintain_period, maintain_method, stand_price, contract_price, sold_price, commission_expense, management_expense, annual_survey_expense, service_expense, cmstatus, updated_at, creater, creater, created_at) + VALUES (:apply_key, :register_code, :elevator_brand, :elevator_kind, :spec, :weight, :speed, :stop, :floors, :persons, :elevator_num, :useful_years, :last_check_date, :speed_governors_check_expense, :maintain_times, :is_m1_bundle, :maintain__months, :maintain_period, :maintain_method, :stand_price, :contract_price, :sold_price, :commission_expense, :management_expense, :annual_survey_expense, :service_expense, :cmstatus, :updated_at, :creater, :creater, :created_at) "; + $sql_str = "UPDATE con_maintance_examine_clear SET + register_code=:register_code, + elevator_brand=:elevator_brand, + elevator_kind=:elevator_kind, + spec=:spec, + weight=:weight, + speed=:speed, + stop=:stop, + floors=:floors, + persons=:persons, + elevator_num=:elevator_num, + useful_years=:useful_years, + last_check_date=:last_check_date, + speed_governors_check_expense=:speed_governors_check_expense, + maintain_times=:maintain_times, + is_m1_bundle=:is_m1_bundle, + maintain__months=:maintain__months, + maintain_period=:maintain_period, + maintain_method=:maintain_method, + stand_price=:stand_price, + contract_price=:contract_price, + sold_price=:sold_price, + commission_expense=:commission_expense, + management_expense=:management_expense, + annual_survey_expense=:annual_survey_expense, + service_expense=:service_expense, + cmstatus=:cmstatus, + updated_at=:updated_at + WHERE apply_key=:apply_key AND item_no=:item_no"; + + $elevator = array_values(array_filter($elevators, fn($el)=> $el['id'] == $bothidx))[0]; + $register_code = empty($elevator['permitNumber']) ? "A" : $elevator['permitNumber']; + if($elevator['spec'] == "MAE100") $elevator_kind = "A"; + if($elevator['spec'] == "MAF100") $elevator_kind = "B"; + if($elevator['spec'] == "MAM200") $elevator_kind = "D"; + if($elevator['spec'] == "MAH100") $elevator_kind = "E"; + + $speed_governors_check_expense = null; + $maintain_times = 1; + $commission_expense = null; + $management_expense = null; + $service_expense = ($elevator['sale_price'] / $total_sale_price) * $serviceFee; + $cmstatus = "Y"; + + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':apply_key', $apply_key); + $stmt->bindParam(':register_code', $register_code); + $stmt->bindParam(':elevator_brand', $elevator['brand']); + $stmt->bindParam(':elevator_kind', $elevator_kind); + $stmt->bindParam(':spec', $elevator['spec']); + $stmt->bindParam(':weight', $elevator['weight']); + $stmt->bindParam(':speed', $elevator['speed']); + $stmt->bindParam(':stop', $elevator['stop']); + $stmt->bindParam(':floors', $elevator['stop']); + $stmt->bindParam(':persons', $elevator['person']); + $stmt->bindParam(':elevator_num', $elevator['qty']); + $stmt->bindParam(':useful_years', $elevator['checkYear']); + $stmt->bindParam(':last_check_date', $elevator['lastDate']); + $stmt->bindParam(':speed_governors_check_expense', $speed_governors_check_expense); + $stmt->bindParam(':maintain_times', $maintain_times); + $stmt->bindParam(':is_m1_bundle', $elevator['m1']); + $stmt->bindParam(':maintain__months', $elevator['months']); + $stmt->bindParam(':maintain_period', $elevator['cycle']); + $stmt->bindParam(':maintain_method', $elevator['method']); + $stmt->bindParam(':stand_price', $elevator['price']); + $stmt->bindParam(':contract_price', $elevator['sale_price']); + $stmt->bindParam(':sold_price', $elevator['sale_price']); + $stmt->bindParam(':commission_expense', $elevator['commission_expense']); + $stmt->bindParam(':management_expense', $elevator['management_expense']); + $stmt->bindParam(':annual_survey_expense', $elevator['yearCheckFee']); + $stmt->bindParam(':service_expense', $elevator['service_expense']); + $stmt->bindParam(':cmstatus', $cmstatus); + $stmt->bindParam(':updated_at', $updated_at); + + $stmt->bindParam(':item_no', $bothidx); + $stmt->execute(); + } + + //除外項目 + $sql_str = "SELECT * FROM pricereview_maintain_item WHERE mid = :apply_key AND item_group = 'E'"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $apply_key); + $stmt->execute(); + $item_other_options = $stmt->fetchAll(PDO::FETCH_ASSOC); + $oldOtherOptionsNo = (array)array_column($item_other_options, 'item_no'); + $newOtherOptioinNo = (array)array_column($otherOptions, 'id'); + + $nlyInOtherOptionOldIds = array_values(array_diff($oldOtherOptionsNo, $newOtherOptioinNo)); + $onlyInOtherOptionNewIds = array_values(array_diff($newOtherOptioinNo, $oldOtherOptionsNo)); + $inBothOtherOptionIds = array_values(array_intersect($oldOtherOptionsNo, $newOtherOptioinNo)); + + foreach($onlyInOtherOptionOldIds as $oldotheroptionidx){ + $sql_str = "DELETE FROM pricereview_maintain_item WHERE mid = :apply_key AND item_no = :item_no AND item_group = 'E'"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $apply_key); + $stmt->bindParam(':item_no', $oldotheroptionidx); + $stmt->execute(); + } + + foreach($onlyInOtherOptionNewIds as $newotheroptionidx){ + $option = array_values(array_filter($otherOptions, fn($el)=> $el['id'] == $newotheroptionidx))[0]; + + $sql_str = "INSERT INTO pricereview_maintain_item (mid, item_no, item_group, item_spec, option_relate_spec, item_unit_price, item_qty, item_price_bp, memo) + VALUES (:mid, :item_no, :item_group, :item_spec, :option_relate_spec, :item_unit_price, :item_qty, :item_price_bp, :memo)"; + + $item_price_bp = $option['price']*$option['num']; + $option_relate_spec = $option['toElevator'][0]['id']; + $item_group = "E"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $apply_key); + $stmt->bindParam(':item_no', $option['pr_no']); + $stmt->bindParam(':item_group', $item_group); + $stmt->bindParam(':item_spec', $option['name']); + $stmt->bindParam(':option_relate_spec', $option_relate_spec); + $stmt->bindParam(':item_unit_price', $option['price']); + $stmt->bindParam(':item_qty', $option['num']); + $stmt->bindParam(':item_price_bp', $item_price_bp); + $stmt->bindParam(':memo', $option['memo']); + $stmt->execute(); + } + foreach($inBothOtherOptionIds as $bothotheroptionidx){ + $option = array_values(array_filter($otherOptions, fn($el)=> $el['id'] == $bothotheroptionidx))[0]; + + $sql_str = "UPDATE pricereview_maintain_item SET item_spec=:item_spec, option_relate_spec=:option_relate_spec, item_unit_price = :item_unit_price, item_qty = :item_qty, item_price_bp = :item_price_bp, memo = :memo + WHERE mid = :apply_key AND item_no = :item_no AND item_group = 'E'"; + + $item_group = "E"; + $item_price_bp = $option['price']*$option['num']; + $option_relate_spec = $option['toElevator'][0]['id']; + + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':mid', $apply_key); + $stmt->bindParam(':item_no', $option['pr_no']); + $stmt->bindParam(':item_group', $item_group); + $stmt->bindParam(':item_spec', $option['name']); + $stmt->bindParam(':option_relate_spec', $option_relate_spec); + $stmt->bindParam(':item_unit_price', $option['price']); + $stmt->bindParam(':item_qty', $option['num']); + $stmt->bindParam(':item_price_bp', $item_price_bp); + $stmt->bindParam(':memo', $option['memo']); + $stmt->execute(); + } +} + +if($status == "YS"){ + +} + + +echo "success"; \ No newline at end of file diff --git a/wms/cont/js/pricereviewAlpine.js b/wms/cont/js/pricereviewAlpine.js index 1fabad15..6c6ec7bf 100644 --- a/wms/cont/js/pricereviewAlpine.js +++ b/wms/cont/js/pricereviewAlpine.js @@ -49,6 +49,7 @@ const pricereviewCreate = ()=>{ name:"", price: 0, num:"", + memo:"", }, otherOptionKey:0, currentOtherOptionKey:'', @@ -179,6 +180,7 @@ const pricereviewCreate = ()=>{ name: this.modalOtherOptionInfo.name, price: this.modalOtherOptionInfo.price, num: this.modalOtherOptionInfo.num, + memo: this.modalOtherOptionInfo.memo, toElevator:[], }) this.modalOtherOptionInfo = { @@ -186,6 +188,7 @@ const pricereviewCreate = ()=>{ name: '', price: 0, num: '', + memo: '', } this.hideCreateOtherOptionModal(); }, @@ -327,12 +330,17 @@ const pricereviewCreate = ()=>{ console.log(res.data); if(res.data == 'success'){ alert("保存成功!"); - window.location.reload(); + // window.location.reload(); } }) }, submit(){ }, + async getUsername(user_id){ + if(user_id == '') return '---' + const res = await axios.get('./api/getUsername.php', {params: {user_id: user_id}}) + return res.data ; + }, } } \ No newline at end of file diff --git a/wms/cont/pricereviewCreate.php b/wms/cont/pricereviewCreate.php index 27174458..954f15b0 100644 --- a/wms/cont/pricereviewCreate.php +++ b/wms/cont/pricereviewCreate.php @@ -82,7 +82,7 @@ function getApplyKey($p_yyyymm, $seq_name){ 電梯數量 營業員 - + 當前契約期限結束 @@ -350,6 +350,7 @@ function getApplyKey($p_yyyymm, $seq_name){ 單價 數量 複價 + 備註 所屬電梯 功能 @@ -364,10 +365,11 @@ function getApplyKey($p_yyyymm, $seq_name){ - + 請輸入正整數 + 小計 - + @@ -481,5 +483,5 @@ function getApplyKey($p_yyyymm, $seq_name){ const progress_status = ''; const user_id = ''; const user_name = ''; - + const progress_remark = ``; \ No newline at end of file diff --git a/wms/cont/window-modal/otherOptionModal.php b/wms/cont/window-modal/otherOptionModal.php index 565ccbf5..588bf0b7 100644 --- a/wms/cont/window-modal/otherOptionModal.php +++ b/wms/cont/window-modal/otherOptionModal.php @@ -13,13 +13,15 @@ 單價 數量 複價 + 備註 - + + diff --git a/wms/contract/js/alpine.js b/wms/contract/js/alpine.js index e9d84276..815514c9 100644 --- a/wms/contract/js/alpine.js +++ b/wms/contract/js/alpine.js @@ -246,7 +246,7 @@ const contractDownload = () => { { editshow: false, origin: true, - text: '交貨期限及甲方配合事項:
乙方應於接獲甲方圖色確認第180日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。', + text: '交貨期限及甲方配合事項:
乙方應於接獲甲方圖色確認第180日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。於指定出貨日期,且乙方備妥材料後,如甲方向後延展出貨日期,如延展日期逾三個月,乙方得酌收額外增生之倉儲保管費用。', type: 'title', deleted: false, id: 5, diff --git a/wms/mkt/assets/js/pricereviewAlpine.js b/wms/mkt/assets/js/pricereviewAlpine.js index 255c8251..8208b859 100644 --- a/wms/mkt/assets/js/pricereviewAlpine.js +++ b/wms/mkt/assets/js/pricereviewAlpine.js @@ -988,8 +988,6 @@ const pricereviewCheck = ()=>{ this.demolishOptions = items.filter(item=> item.item_group =='C'); this.maintainOptions = items.filter(item=> item.item_group =='D'); this.otherOptions = items.filter(item=> item.item_group =='E'); - console.log("optionnnn=>", this.options); - console.log(this.elevators); this.elevators.forEach((elevator, idx)=>{ this.options.forEach(option=>{ if(option.option_relate_spec == elevator.item_no){ @@ -1071,10 +1069,7 @@ const pricereviewCheck = ()=>{ } } } - - this.getElevatorMi(idx, spec, person, stop, open, speed, elevator.item_weight) - }); this.sign1 = this.getUsername(sign1) this.sign2 = this.getUsername(sign2) @@ -1170,38 +1165,38 @@ const pricereviewCheck = ()=>{ mid: mid, user_id: user_id, reviewcomment:'', - optionsTotalPrice(){ + get optionsTotalPrice(){ return this.options.reduce((total, option) => { return total + (option.item_qty * option.item_unit_price); }, 0); }, - otherOptionsTotalPrice(){ + get otherOptionsTotalPrice(){ return this.otherOptions.reduce((total, option) => { return total + (option.item_qty * option.item_unit_price); }, 0); }, - maintainOptionsTotalPrice(){ + get maintainOptionsTotalPrice(){ return this.maintainOptions.reduce((total, option) => { return total + (option.item_qty * option.item_unit_price); }, 0); }, - demolishOptionsTotalPrice(){ + get demolishOptionsTotalPrice(){ return this.demolishOptions.reduce((total, option) => { return total + (option.item_qty * option.item_unit_price); }, 0); }, - totalScale(){ + get totalScale(){ return this.pays.reduce((total, option) => { return total + Number(option.pay_scale ); }, 0); }, - totalElevatorsPrice(){ + get totalElevatorsPrice(){ return this.elevators.reduce((total, elevator) => { return total + (elevator.item_qty * elevator.price); }, 0); }, - totalStandardPrice(){ - return this.totalElevatorsPrice() + this.otherOptionsTotalPrice() + this.optionsTotalPrice() + this.maintainOptionsTotalPrice() + this.demolishOptionsTotalPrice(); + get totalStandardPrice(){ + return this.totalElevatorsPrice + this.otherOptionsTotalPrice + this.optionsTotalPrice + this.maintainOptionsTotalPrice + this.demolishOptionsTotalPrice; }, check(sign, status, user_id = this.user_id ){ console.log(sign); diff --git a/wms/mkt/pricereviewCheck.php b/wms/mkt/pricereviewCheck.php index 5eec5566..ca66f475 100644 --- a/wms/mkt/pricereviewCheck.php +++ b/wms/mkt/pricereviewCheck.php @@ -409,7 +409,7 @@ function getSignerName($signer){ 小計 - + @@ -449,7 +449,7 @@ function getSignerName($signer){ 小計 - + @@ -489,7 +489,7 @@ function getSignerName($signer){ 小計 - + @@ -529,7 +529,7 @@ function getSignerName($signer){ 小計 - + @@ -671,7 +671,7 @@ function getSignerName($signer){ 合計 - + @@ -707,12 +707,12 @@ function getSignerName($signer){ 價率%(B/A) - + - + 預定成交日 diff --git a/wms/sign/list.php b/wms/sign/list.php index f2d65bf5..f40bc8b5 100644 --- a/wms/sign/list.php +++ b/wms/sign/list.php @@ -113,7 +113,8 @@ JOIN FROM subflow GROUP BY - form_key) AS sf ON d.form_key = sf.form_key + form_key + ) AS sf ON d.form_key = sf.form_key JOIN subflow c ON c.form_key = sf.form_key AND c.seq = sf.max_seq WHERE