From 0e2ccacc04092c5fb357a34e6174f90542bc6cc2 Mon Sep 17 00:00:00 2001 From: 10994015 Date: Thu, 9 Nov 2023 17:46:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E7=B4=84=E5=85=A5=E5=8A=9B=E4=BF=AE?= =?UTF-8?q?=E6=94=B91109?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/contract/api/getComboNo.php | 10 +- wms/contract/api/getContractData.php | 4 +- wms/contract/api/postContractData.php | 2 +- wms/contract/contract-input.php | 204 +++++++++--------- ...90947427180t71804OlaIEQjXAZDasK9Pd1Jxb.jpg | Bin 0 -> 81753 bytes ...90954176835l68354OlaIEQjXAZDasK9Pd1Jxb.jpg | Bin 0 -> 81753 bytes ...90954583134s31344OlaIEQjXAZDasK9Pd1Jxb.jpg | Bin 0 -> 81753 bytes ...91004414235g42354OlaIEQjXAZDasK9Pd1Jxb.jpg | Bin 0 -> 81753 bytes 8 files changed, 108 insertions(+), 112 deletions(-) create mode 100644 wms/contract/images/contracts/c202311090947427180t71804OlaIEQjXAZDasK9Pd1Jxb.jpg create mode 100644 wms/contract/images/contracts/c202311090954176835l68354OlaIEQjXAZDasK9Pd1Jxb.jpg create mode 100644 wms/contract/images/contracts/c202311090954583134s31344OlaIEQjXAZDasK9Pd1Jxb.jpg create mode 100644 wms/contract/images/contracts/c202311091004414235g42354OlaIEQjXAZDasK9Pd1Jxb.jpg diff --git a/wms/contract/api/getComboNo.php b/wms/contract/api/getComboNo.php index 5c81120d..c258be15 100644 --- a/wms/contract/api/getComboNo.php +++ b/wms/contract/api/getComboNo.php @@ -34,12 +34,18 @@ class CreateComboNo{ $interval = date_diff($startdate, $enddate); - $months = $interval->y * 12 + $interval->m +1; + $months = $interval->y * 12 + $interval->m; $months = $this->combo === 'bw' ? $months*2 : $months; $newarr = []; $idx = 0; - $scheduleDate = $startdate; + $ori_first_month = date('m', strtotime($this->startdate)); + $first_day = date('Y-m-d', strtotime($this->startdate. ' + 3 days')); + $new_first_month = date('m', strtotime($first_day)); + if($ori_first_month != $new_first_month){ + $first_day = date('Y-m-t', strtotime($this->startdate)); + } + $scheduleDate = new DateTime($first_day); for ($i = 0; $i < $months; $i++){ $newarr[] = [$this->comboarr[$comboarr[$idx]], $scheduleDate->format("Y-m-d")]; $idx ++; diff --git a/wms/contract/api/getContractData.php b/wms/contract/api/getContractData.php index 38b98bcc..86d8301c 100644 --- a/wms/contract/api/getContractData.php +++ b/wms/contract/api/getContractData.php @@ -3,9 +3,9 @@ require_once('../conn.php'); if(isset($_GET['contractno']) && $_GET['contractno']!=''){ try{ $contractno = $_GET['contractno']; - $sql_str = "SELECT * FROM con_maintance_examine_apply + $sql_str = "SELECT COUNT(con_maintance_examine_clear.apply_key) as count,con_maintance_examine_apply.*, con_maintance_examine_clear.* FROM con_maintance_examine_apply LEFT JOIN con_maintance_examine_clear on con_maintance_examine_apply.apply_key=con_maintance_examine_clear.apply_key - WHERE con_maintance_examine_apply.vol_no = :vol_no"; + WHERE con_maintance_examine_apply.vol_no = :vol_no GROUP BY con_maintance_examine_apply.apply_key;"; $stmt = $conn->prepare($sql_str); $stmt->bindParam(':vol_no', $contractno); $stmt->execute(); diff --git a/wms/contract/api/postContractData.php b/wms/contract/api/postContractData.php index 37238bc6..67d08f1a 100644 --- a/wms/contract/api/postContractData.php +++ b/wms/contract/api/postContractData.php @@ -202,6 +202,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") { } //create schedule table + $comboNo = new CreateComboNo($mcycle, $contract_begin_date, $contract_end_date); $comboArr = json_decode($comboNo->getComboNo(), true); foreach($facilityno as $no){ @@ -219,7 +220,6 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") { $result = $stmt -> execute(); } } - // create contract_b_signed_back table $contract_type = $mtype; $company = $customer; diff --git a/wms/contract/contract-input.php b/wms/contract/contract-input.php index 295542bc..e41013ee 100644 --- a/wms/contract/contract-input.php +++ b/wms/contract/contract-input.php @@ -24,12 +24,11 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
makeTFacilityNo("T", 'X', 5); isLoading:false, fail_arr:[], nextStepFn(){ - if(this.data.contractno == '') return alert('請輸入合約號'); - this.isLoading = true - axios.get('./api/getContractData.php?contractno=' + this.data.contractno).then(res=>{ - console.log(res) - - if(!this.customize){ - this.data.total_price = res.data.sold_price - this.data.salesman = res.data.salesman - this.data.contract_begin_date = res.data.contract_begin_date - this.data.contract_end_date = res.data.contract_end_date - this.data.address = res.data.address - this.data.customer = res.data.customer - this.data.partyA = res.data.customer - this.data.partyAaddress = res.data.address - this.data.spec = res.data.spec - this.data.weight = res.data.weight - this.data.numberofpassenger = res.data.persons - this.data.numberofstop = res.data.stop - this.data.numberoffloor = res.data.floors - this.data.speed = res.data.speed - this.data.takecertificatedate = res.data.contract_begin_date - let cityIndex = this.data.address.indexOf('市'); - if (cityIndex > 1) { - // 獲取''市''前面的兩個字 - let city = this.data.address.substring(cityIndex - 2, cityIndex + 1); - this.data.area = city; - console.log(this.data.area); - } else { - this.data.area = '' - console.log('沒有找到或者格式不正確'); - } - } - this.step = 2 - this.isLoading = false - }).catch(err=>{ - console.error(err) - this.isLoading = false - }) + if(this.step==1){ + if(this.data.contractno == '') return alert('請輸入合約號'); + this.isLoading = true + this.getContractDate(); + }else if(this.step == 2){ + this.step = 3 + } }, nextStepKeyupFn(e){ if(e.keyCode !== 13) return - if(this.contractno == '') return alert('請輸入合約號'); - this.isLoading = true + if(this.step==1){ + if(this.data.contractno == '') return alert('請輸入合約號'); + this.isLoading = true + this.getContractDate(); + }else if(this.step == 2){ + this.step = 3 + } + }, + getContractDate(){ axios.get('./api/getContractData.php?contractno=' + this.data.contractno).then(res=>{ - console.log(res) if(!this.customize){ + console.log(res.data); this.data.total_price = res.data.sold_price this.data.salesman = res.data.salesman this.data.contract_begin_date = res.data.contract_begin_date @@ -139,10 +115,8 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5); // 獲取''市''前面的兩個字 let city = this.data.address.substring(cityIndex - 2, cityIndex + 1); this.data.area = city; - console.log(this.data.area); } else { this.data.area = '' - console.log('沒有找到或者格式不正確'); } } this.step = 2 @@ -153,22 +127,30 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5); }) }, preStepFn(){ - this.data.total_price = '' - this.data.salesman = '' - this.data.contract_begin_date = '' - this.data.contract_end_date = '' - this.data.address = '' - this.data.customer = '' - this.data.partyA = '' - this.data.partyAaddress = '' - this.data.spec = '' - this.data.weight = '' - this.data.numberofpassenger = '' - this.data.numberofstop = '' - this.data.numberoffloor = '' - this.data.speed = '' - this.data.takecertificatedate = '' - this.step = 1 + if(this.step==2){ + if(confirm('回到上一頁會將本頁資料清空,確定返回嗎?')){ + this.step = 1 + this.data.total_price = '' + this.data.salesman = '' + this.data.contract_begin_date = '' + this.data.contract_end_date = '' + this.data.address = '' + this.data.customer = '' + this.data.partyA = '' + this.data.partyAaddress = '' + this.data.spec = '' + this.data.weight = '' + this.data.numberofpassenger = '' + this.data.numberofstop = '' + this.data.numberoffloor = '' + this.data.speed = '' + this.data.takecertificatedate = '' + this.step = 1 + return; + } + }else if(this.step == 3){ + this.step = 2 + } }, save(){ this.isLoading = true @@ -233,7 +215,7 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5); }, uploadFiles(e){ this.data.files = e.target.files - } + }, }">
@@ -282,7 +264,7 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5); 營業員 - @@ -302,10 +284,10 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5); - 合約總價 + 電梯台數 - -

未填寫

+ +

未填寫

統一編號/身分證 @@ -393,6 +375,28 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);

未填寫

+ + 廠牌 + + +

未填寫

+ + 區域 + + +

未填寫

+ + 詳細地址 + + +

未填寫

+ + 保養別 @@ -414,16 +418,21 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);

未填寫

- - 電梯數量 - - -

未填寫

+ 附件 + + +

未填寫

- - 規格 + + + + + - -