From 7b37600f41cc4845375cb236b783fbe3f6618944 Mon Sep 17 00:00:00 2001 From: 10994015 Date: Thu, 16 Nov 2023 18:05:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E7=B4=84=E6=9B=B8=E7=94=B3=E8=AB=8B?= =?UTF-8?q?=20=E6=96=B0=E6=A2=AF=201116?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/contract/api/postNewContractData.php | 5 +- wms/contract/api/putContractData.php | 5 +- wms/contract/contract-new-apply.php | 460 ++++++++++++++++++++ wms/contract/contract-newelevator-edit.php | 34 +- wms/contract/contract-newelevator-input.php | 17 +- wms/contract/js/alpine.js | 30 ++ wms/contract/styles/style.css | 40 +- wms/contract/styles/style.css.map | 2 +- wms/contract/styles/style.scss | 6 +- wms/mkt/pricereview-index.php | 10 +- 10 files changed, 566 insertions(+), 43 deletions(-) create mode 100644 wms/contract/contract-new-apply.php diff --git a/wms/contract/api/postNewContractData.php b/wms/contract/api/postNewContractData.php index dc08c30c..001fe1f5 100644 --- a/wms/contract/api/postNewContractData.php +++ b/wms/contract/api/postNewContractData.php @@ -22,6 +22,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['co $lm_tel = $_POST["lm_tel"]; $address = $_POST["address"]; $salesman = $_POST["salesman"]; + $qc = $_POST["qc"]; $contracttype = $_POST["contracttype"]; $files = !empty($_FILES['files']) ? $_FILES['files'] : null; $files_id = null; @@ -36,6 +37,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['co if(empty($lm_tel)) $fail_arr[] = '聯絡人電話為必填'; if(empty($address)) $fail_arr[] = '地址為必填'; if(empty($salesman)) $fail_arr[] = '營業員為必填'; + if(empty($qc)) $fail_arr[] = '請選擇QC或官檢'; if(count($fail_arr) > 0) { header("HTTP/1.1 422 Unprocessable Entity"); echo json_encode($fail_arr); @@ -105,7 +107,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['co $files = null; } - $sql_str = "INSERT INTO contract_m_signed_back (contract_no, customer, manager, vat, case_name, linkman, lm_tel, address, salesman, salesman_name, files_id, created_at, created_by) VALUES (:contract_no, :customer, :manager, :vat, :case_name, :linkman, :lm_tel, :address, :salesman, :salesman_name, :files_id, :created_at, :created_by)"; + $sql_str = "INSERT INTO contract_m_signed_back (contract_no, customer, manager, vat, case_name, linkman, lm_tel, address, salesman, salesman_name, files_id, created_at, created_by, qc_official_type) VALUES (:contract_no, :customer, :manager, :vat, :case_name, :linkman, :lm_tel, :address, :salesman, :salesman_name, :files_id, :created_at, :created_by, :qc)"; $stmt = $conn -> prepare($sql_str); $stmt -> bindParam(":contract_no",$contractno); $stmt -> bindParam(":customer",$customer); @@ -120,6 +122,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['co $stmt -> bindParam(":files_id",$files_id); $stmt -> bindParam(":created_at",$created_at); $stmt -> bindParam(":created_by",$created_by); + $stmt -> bindParam(":qc",$qc); $stmt -> execute(); diff --git a/wms/contract/api/putContractData.php b/wms/contract/api/putContractData.php index 63694e83..f1e78164 100644 --- a/wms/contract/api/putContractData.php +++ b/wms/contract/api/putContractData.php @@ -17,6 +17,7 @@ if(isset($_POST['contractno']) && $_POST['contractno']!="" && isset($_POST["id"] $lm_tel = !empty($_POST['lm_tel']) ? $_POST['lm_tel'] : null; $address = !empty($_POST['address']) ? $_POST['address'] : null; $salesman = !empty($_POST['salesman']) ? $_POST['salesman'] : null; + $qc = !empty($_POST['qc']) ? $_POST['qc'] : null; $deletefiles = !empty($_POST['deletefiles']) ? $_POST['deletefiles'] : null; $files_id = !empty($_POST['files_id']) ? $_POST['files_id'] : null; $files = !empty($_FILES['files']) ? $_FILES['files'] : null; @@ -33,6 +34,7 @@ if(isset($_POST['contractno']) && $_POST['contractno']!="" && isset($_POST["id"] if(empty($lm_tel)) $fail_arr[] = '聯絡人電話為必填'; if(empty($address)) $fail_arr[] = '地址為必填'; if(empty($salesman)) $fail_arr[] = '營業員為必填'; + if(empty($qc)) $fail_arr[] = '請選擇QC或管檢'; if(count($fail_arr) > 0) { header("HTTP/1.1 422 Unprocessable Entity"); echo json_encode($fail_arr); @@ -41,7 +43,7 @@ if(isset($_POST['contractno']) && $_POST['contractno']!="" && isset($_POST["id"] $conn->beginTransaction(); - $sql_str = "UPDATE contract_m_signed_back SET contract_no=:contract_no, customer=:customer, manager=:manager, vat=:vat, case_name=:case_name, linkman=:linkman, lm_tel=:lm_tel, address=:address, salesman=:salesman WHERE id = :id"; + $sql_str = "UPDATE contract_m_signed_back SET contract_no=:contract_no, customer=:customer, manager=:manager, vat=:vat, case_name=:case_name, linkman=:linkman, lm_tel=:lm_tel, address=:address, salesman=:salesman, qc_official_type=:qc WHERE id = :id"; $stmt = $conn -> prepare($sql_str); $stmt -> bindParam(':contract_no' ,$contract_no); $stmt -> bindParam(':customer' ,$customer); @@ -52,6 +54,7 @@ if(isset($_POST['contractno']) && $_POST['contractno']!="" && isset($_POST["id"] $stmt -> bindParam(':lm_tel' ,$lm_tel); $stmt -> bindParam(':address' ,$address); $stmt -> bindParam(':salesman' ,$salesman); + $stmt -> bindParam(':qc' ,$qc); $stmt -> bindParam(':id' ,$id); $stmt -> execute(); if(!empty($deletefiles)){ diff --git a/wms/contract/contract-new-apply.php b/wms/contract/contract-new-apply.php new file mode 100644 index 00000000..15eb41f5 --- /dev/null +++ b/wms/contract/contract-new-apply.php @@ -0,0 +1,460 @@ +alert('非法訪問!!!');"; + echo ""; + exit; +} +$id = $_GET["id"]; +$sql_str = "SELECT pricereview_main.*, 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); + +$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); +print_r($customer); +?> + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

合約書申請(新梯)

+
+

業務確認項

+
+ + +
卷號 + +

未填寫

+
營業員 + +

未填寫

+
合約書申請日期 + +

未填寫

+
申請類別 + +

未填寫

+
案件名稱 + +

未填寫

+
立約人 + +

未填寫

+
負責人 + +

未填寫

+
統一編號 + +

未填寫

+
含稅給約總價 + +

未填寫

+
含稅貸款(A) + +

未填寫

+
含稅安裝款(A) + +

未填寫

+
聯絡地址 + +

未填寫

+
完工期限 + +

未填寫

+
附則 + +

未填寫

+
免保期限 + +

未填寫

+
交貨地點 + +

未填寫

+
交貨期限 + +

未填寫

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

項次

+
+

規格

+
+

數量

+
+

金額

+
1 + +

未填寫

+
+ +

未填寫

+
+ +

未填寫

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

合約類別

+
+

款別

+
+

條件名稱

+
+

收款條件日期區分

+
+

條件日期

+
+

票期

+
+

付款比率

+
+

金額

+
+

銷售

+
+

訂金

+
+

簽約後X天付訂金

+
+

合約日

+
+

30天

+
+

30天

+
+

20%

+
+

636000

+
+

銷售

+
+

二次款

+
+

簽約後X天付二次款

+
+

合約日

+
+

30天

+
+

30天

+
+

0%%

+
+

0

+
+

銷售

+
+

貨到款

+
+

貨抵工地付貨到款

+
+

出貨日

+
+

-

+
+

30天

+
+

50%

+
+

1590000

+
+

+
+

+
+

+
+

+
+

+
+

+
+

+
+

+
+

安裝

+
+

安裝款

+
+

安裝完成後X天收款

+
+

竣檢日

+
+

30天

+
+

30天

+
+

20%

+
+

636000

+
+

安裝

+
+

尾款

+
+

交車後X天付尾款

+
+

交車日

+
+

0天

+
+

30天

+
+

10%

+
+

318000

+
+

+
+

+
+

+
+

+
+

+
+

+
+

+
+

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

簽核流程

+
業務部協理已通過業務部承辦人已通過營業經理已通過營業員已通過
+ +
+
+
+ + + \ No newline at end of file diff --git a/wms/contract/contract-newelevator-edit.php b/wms/contract/contract-newelevator-edit.php index 3aef11fa..424a0d01 100644 --- a/wms/contract/contract-newelevator-edit.php +++ b/wms/contract/contract-newelevator-edit.php @@ -54,6 +54,7 @@ $persons = array_map(function($person){ files:, newfiles:[], deletefiles:[], + qc:"", files_id: "", }, fail_arr:[], @@ -74,11 +75,13 @@ $persons = array_map(function($person){ form.append("case_name", this.data.case_name); form.append("linkman", this.data.linkman); form.append("lm_tel", this.data.lm_tel); - form.append("address", this.data.address); + form.append("address", this.data.address);user_id form.append("salesman", this.data.salesman); + form.append("qc", this.data.qc); form.append("deletefiles", this.data.deletefiles); form.append("files_id", this.data.files_id); form.append("user_id", ""); + form.append("", ""); for (var i = 0; i < this.data.newfiles.length; i++) { form.append("files[]", this.data.newfiles[i]); @@ -87,19 +90,8 @@ $persons = array_map(function($person){ axios.post("./api/putContractData.php", form).then(res=>{ console.log(res.data) if(res.status === 200){ - alert("更新成功") - this.step = 1 - this.data.contractno="" - this.data.customer="" - this.data.manager="" - this.data.vat="" - this.data.case_name="" - this.data.linkman="" - this.data.lm_tel="" - this.data.address="" - this.data.salesman="" - this.data.files=[] - this.customize = false + alert("更新成功"); + window.location.reload(); } this.isLoading = false }).catch(error=>{ @@ -186,8 +178,18 @@ $persons = array_map(function($person){

未填寫

+ QC和官檢 + + +

未填寫

+ 案件名稱 - +

未填寫

@@ -239,6 +241,8 @@ $persons = array_map(function($person){