10994015 1 year ago
parent
commit
24b93402f6
  1. 27
      wms/contract/api/getContractData.php
  2. 2
      wms/contract/api/getFacilityNo.php
  3. 96
      wms/contract/api/postContractData.php
  4. 296
      wms/contract/contract-input.php
  5. 7
      wms/contract/export-pdf.php
  6. BIN
      wms/contract/images/contracts/c202311081429488338k8338202204260238d952-c57d-4306-98fc-2a0a92278382.jpg
  7. BIN
      wms/contract/images/contracts/c202311081434191255r1255202204260238d952-c57d-4306-98fc-2a0a92278382.jpg
  8. BIN
      wms/contract/images/contracts/c202311081434539019c9019202204260238d952-c57d-4306-98fc-2a0a92278382.jpg
  9. BIN
      wms/contract/images/contracts/c202311081435583265z3265202204260238d952-c57d-4306-98fc-2a0a92278382.jpg
  10. BIN
      wms/contract/images/contracts/c202311081438444055k4055202204260238d952-c57d-4306-98fc-2a0a92278382.jpg
  11. BIN
      wms/contract/images/contracts/c202311081438445230g52301697165865064.jpg
  12. BIN
      wms/contract/images/contracts/c202311081438448320u83201697599065970.jpg
  13. BIN
      wms/contract/images/contracts/c202311081444122858a28581697599065970.jpg
  14. BIN
      wms/contract/images/contracts/c202311081444124981q4981202204260238d952-c57d-4306-98fc-2a0a92278382.jpg
  15. BIN
      wms/contract/images/contracts/c202311081444126049x60491697165865064.jpg
  16. BIN
      wms/contract/images/contracts/c202311081444483652o3652202204260238d952-c57d-4306-98fc-2a0a92278382.jpg
  17. BIN
      wms/contract/images/contracts/c202311081444484116d41161697599065970.jpg
  18. BIN
      wms/contract/images/contracts/c202311081444489890p98901697165865064.jpg
  19. BIN
      wms/contract/images/contracts/c202311090947427180t71804OlaIEQjXAZDasK9Pd1Jxb.jpg
  20. BIN
      wms/contract/images/contracts/c202311090954176835l68354OlaIEQjXAZDasK9Pd1Jxb.jpg
  21. BIN
      wms/contract/images/contracts/c202311090954583134s31344OlaIEQjXAZDasK9Pd1Jxb.jpg
  22. BIN
      wms/contract/images/contracts/c202311091004414235g42354OlaIEQjXAZDasK9Pd1Jxb.jpg
  23. BIN
      wms/contract/images/contracts/c202311101747315948u59481697165865064.jpg
  24. BIN
      wms/contract/images/contracts/c202311101747319269t92691697599065970.jpg
  25. BIN
      wms/contract/images/contracts/c202311101747481959u19591697165865064.jpg
  26. BIN
      wms/contract/images/contracts/c202311101747483858a38581697599065970.jpg
  27. BIN
      wms/contract/images/contracts/c202311101750548465f84651697599065970.jpg
  28. BIN
      wms/contract/images/contracts/c202311101758595752g57521697599065970.jpg
  29. 4
      wms/contract/prviewPdf.php
  30. 22
      wms/contract/styles/style.css
  31. 2
      wms/contract/styles/style.css.map
  32. 25
      wms/contract/styles/style.scss

27
wms/contract/api/getContractData.php

@ -3,20 +3,37 @@ require_once('../conn.php');
if(isset($_GET['contractno']) && $_GET['contractno']!=''){ if(isset($_GET['contractno']) && $_GET['contractno']!=''){
try{ try{
$contractno = $_GET['contractno']; $contractno = $_GET['contractno'];
$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 $sql_str = "SELECT 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 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 GROUP BY con_maintance_examine_apply.apply_key;"; WHERE con_maintance_examine_apply.vol_no = :vol_no ;";
$sql_str = "SELECT * FROM con_maintance_examine_apply WHERE vol_no = :vol_no ORDER BY create_at DESC;";
$stmt = $conn->prepare($sql_str); $stmt = $conn->prepare($sql_str);
$stmt->bindParam(':vol_no', $contractno); $stmt->bindParam(':vol_no', $contractno);
$stmt->execute(); $stmt->execute();
$contract = $stmt->fetch(PDO::FETCH_ASSOC); $contract= $stmt->fetch(PDO::FETCH_ASSOC);
if(empty($contract)){
echo false;
exit;
}
$apply_key = $contract['apply_key'];
$sql_str = "SELECT * FROM con_maintance_examine_clear WHERE apply_key = :apply_key";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':apply_key', $apply_key);
$stmt->execute();
$elevators= $stmt->fetchAll(PDO::FETCH_ASSOC);
$count = COUNT($elevators);
$contract['elevators'] = $elevators;
$contract['num'] = $count;
$contractResponse = json_encode($contract); $contractResponse = json_encode($contract);
// 設定回應標頭為 JSON // 設定回應標頭為 JSON
header('Content-Type: application/json'); header('Content-Type: application/json');
// 將 JSON 回應返回給客戶端 // 將 JSON 回應返回給客戶端
echo json_encode($contract); echo $contractResponse;
// echo json_encode($contractResponse);
}catch (PDOException $e ){ }catch (PDOException $e ){
die("ERROR!!!: ". $e->getMessage()); die("ERROR!!!: ". $e->getMessage());
} }

2
wms/contract/api/getFacilityNo.php

@ -488,7 +488,7 @@ class CreateFacilityNo
* @param int $seq_name : 幾個案場 0-99 * @param int $seq_name : 幾個案場 0-99
* @return array $new_facilityno : 作番號 * @return array $new_facilityno : 作番號
*/ */
function makeBFacilityNo($sale_type, $make_type, $num) function makeBFacilityNo($sale_type, $make_type, $num=1)
{ {
if (count($sale_type) !== $num) if (count($sale_type) !== $num)
return "陣列數量不一致!"; return "陣列數量不一致!";

96
wms/contract/api/postContractData.php

@ -40,7 +40,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") {
$longitude = !empty($_POST['longitude']) ? $_POST['longitude'] : null; $longitude = !empty($_POST['longitude']) ? $_POST['longitude'] : null;
$num = !empty($_POST['num']) ? $_POST['num'] : null; $num = !empty($_POST['num']) ? $_POST['num'] : null;
$files = !empty($_FILES['files']) ? $_FILES['files'] : null; $files = !empty($_FILES['files']) ? $_FILES['files'] : null;
$elevators = !empty($_POST['elevators']) ? json_decode($_POST['elevators'], true) : [];
// validate // validate
$fail_arr = []; $fail_arr = [];
if($contractno === '') return $fail_arr[] = '合約號為必填'; if($contractno === '') return $fail_arr[] = '合約號為必填';
@ -48,7 +48,6 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") {
if($total_price == '') $fail_arr[] = '合約總價為必填'; if($total_price == '') $fail_arr[] = '合約總價為必填';
if($vat == '') $fail_arr[] = '統一編號為必填'; if($vat == '') $fail_arr[] = '統一編號為必填';
if($mtype == '') $fail_arr[] = '維修型態為必填'; if($mtype == '') $fail_arr[] = '維修型態為必填';
if($opendoor == '') $fail_arr[] = '開門方式為必填';
if($phone == '') $fail_arr[] = '客戶電話為必填'; if($phone == '') $fail_arr[] = '客戶電話為必填';
if($email == '') $fail_arr[] = 'Email為必填'; if($email == '') $fail_arr[] = 'Email為必填';
if($mworker == '') $fail_arr[] = '保養員為必填'; if($mworker == '') $fail_arr[] = '保養員為必填';
@ -59,22 +58,11 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") {
if($address == '') $fail_arr[] = '地址為必填'; if($address == '') $fail_arr[] = '地址為必填';
if($area == '') $fail_arr[] = '區域為必填'; if($area == '') $fail_arr[] = '區域為必填';
if($customer == '') $fail_arr[] = '客戶為必填'; if($customer == '') $fail_arr[] = '客戶為必填';
if($partyA == '') $fail_arr[] = '甲方為必填'; if($partyA == '') $fail_arr[] = '業務聯繫人為必填';
if($partyAaddress == '') $fail_arr[] = '甲方地址為必填'; if($partyAaddress == '') $fail_arr[] = '業務聯繫人地址為必填';
if($partyAphone == '') $fail_arr[] = '甲方電話為必填'; if($partyAphone == '') $fail_arr[] = '業務聯繫人電話為必填';
if($partyAemail == '') $fail_arr[] = '甲方Email為必填'; if($partyAemail == '') $fail_arr[] = '業務聯繫人Email為必填';
if($spec == '') $fail_arr[] = '規格為必填'; if($num == '') $fail_arr[] = '電梯數量為必填';
if($weight == '') $fail_arr[] = '重量為必填';
if($numberofpassenger == '') $fail_arr[] = '乘客人數為必填';
if($numberofstop == '') $fail_arr[] = '停留站數為必填';
if($numberoffloor == '') $fail_arr[] = '停留樓層為必填';
if($speed == '') $fail_arr[] = '速度為必填';
if($takecertificatedate == '') $fail_arr[] = '取標日期為必填';
if($maintainance == '') $fail_arr[] = '保養為必填';
if($licensedate == '') $fail_arr[] = '營業員為必填';
if($latitude == '') $fail_arr[] = '緯度為必填';
if($longitude == '') $fail_arr[] = '經度為必填';
if($num == '') $fail_arr[] = '數量為必填';
if(count($fail_arr) > 0) { if(count($fail_arr) > 0) {
header("HTTP/1.1 422 Unprocessable Entity"); header("HTTP/1.1 422 Unprocessable Entity");
echo json_encode($fail_arr); echo json_encode($fail_arr);
@ -153,54 +141,56 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") {
'MAF100'=>'F', 'MAF100'=>'F',
'MAZ100'=>'B', 'MAZ100'=>'B',
]; ];
$facility_arr = [];
foreach($elevators as $elevator){
$facility_arr[] = $elevator['spec'];
}
$facilityno = $createFacilityNo->makeBFacilityNo("T", $dailyNecessities[$elevator['spec']], (int)$num);
$sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid"; $sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid";
$stmt = $conn->prepare($sql_str); $stmt = $conn->prepare($sql_str);
$stmt->bindParam(':accountid',$mworker); $stmt->bindParam(':accountid',$mworker);
$stmt->execute(); $stmt->execute();
$worker = $stmt->fetch(PDO::FETCH_ASSOC); $worker = $stmt->fetch(PDO::FETCH_ASSOC);
$facilityno = $createFacilityNo->makeBFacilityNo("T", $dailyNecessities[$spec], (int)$num);
$define = "B";
$customerid = $vat; $customerid = $vat;
$opentype = $opendoor; $define = "B";
$repairtype = "A"; $repairtype = "A";
$facility_kind = $spec;
$maintainance = "E";
$repairerid = $mworker; $repairerid = $mworker;
$repairername = $worker['name']; $repairername = $worker['name'];
foreach($elevators as $idx=>$elevator){
foreach($facilityno as $fno){
$sql_str = "INSERT INTO facility (contractno, define, facilityno, latitude, longitude, customerid, weight, numberofpassenger, numberofstop, numberoffloor, opentype, speed, repairtype, maintainance, facility_kind, address, repairerid, repairername, creater, create_at, area, takecertificatedate, licensedate) $sql_str = "INSERT INTO facility (contractno, define, facilityno, latitude, longitude, customerid, weight, numberofpassenger, numberofstop, numberoffloor, opentype, speed, repairtype, maintainance, facility_kind, address, repairerid, repairername, creater, create_at, area, takecertificatedate, licensedate)
VALUES (:contractno, :define, :facilityno, :latitude, :longitude, :customerid, :weight, :numberofpassenger, :numberofstop, :numberoffloor, :opentype, :speed, :repairtype, :maintainance, :facility_kind, :address, :repairerid, :repairername, :creater, :create_at, :area, :takecertificatedate, :licensedate)"; VALUES (:contractno, :define, :facilityno, :latitude, :longitude, :customerid, :weight, :numberofpassenger, :numberofstop, :numberoffloor, :opentype, :speed, :repairtype, :maintainance, :facility_kind, :address, :repairerid, :repairername, :creater, :create_at, :area, :takecertificatedate, :licensedate)";
$stmt = $conn -> prepare($sql_str); $stmt = $conn -> prepare($sql_str);
$stmt -> bindParam(':contractno' ,$contractno); $stmt -> bindParam(':contractno' ,$contractno);
$stmt -> bindParam(':define' ,$define); $stmt -> bindParam(':define' ,$define);
$stmt -> bindParam(':facilityno' ,$fno); $stmt -> bindParam(':facilityno' ,$facilityno[$idx]);
$stmt -> bindParam(':latitude' ,$latitude); $stmt -> bindParam(':latitude' ,$elevator['latitude']);
$stmt -> bindParam(':longitude' ,$longitude); $stmt -> bindParam(':longitude' ,$elevator['longitude']);
$stmt -> bindParam(':customerid' ,$customerid); $stmt -> bindParam(':customerid' ,$customerid);
$stmt -> bindParam(':weight' ,$weight); $stmt -> bindParam(':weight' ,$elevator['weight']);
$stmt -> bindParam(':numberofpassenger' ,$numberofpassenger); $stmt -> bindParam(':numberofpassenger' ,$elevator['persons']);
$stmt -> bindParam(':numberofstop' ,$numberofstop); $stmt -> bindParam(':numberofstop' ,$elevator['stop']);
$stmt -> bindParam(':numberoffloor' ,$numberoffloor); $stmt -> bindParam(':numberoffloor' ,$elevator['floors']);
$stmt -> bindParam(':opentype' ,$opentype); $stmt -> bindParam(':opentype' ,$elevator['opendoor']);
$stmt -> bindParam(':speed' ,$speed); $stmt -> bindParam(':speed' ,$elevator['speed']);
$stmt -> bindParam(':repairtype' ,$repairtype); $stmt -> bindParam(':repairtype' ,$repairtype);
$stmt -> bindParam(':maintainance' ,$maintainance); $stmt -> bindParam(':maintainance' ,$maintainance);
$stmt -> bindParam(':facility_kind' ,$facility_kind); $stmt -> bindParam(':facility_kind' ,$elevator['spec']);
$stmt -> bindParam(':address' ,$address); $stmt -> bindParam(':address' ,$address);
$stmt -> bindParam(':repairerid' ,$repairerid); $stmt -> bindParam(':repairerid' ,$repairerid);
$stmt -> bindParam(':repairername' ,$repairername); $stmt -> bindParam(':repairername' ,$repairername);
$stmt -> bindParam(':creater' ,$creater); $stmt -> bindParam(':creater' ,$creater);
$stmt -> bindParam(':create_at' ,$create_at); $stmt -> bindParam(':create_at' ,$create_at);
$stmt -> bindParam(':area' ,$area); $stmt -> bindParam(':area' ,$area);
$stmt -> bindParam(':takecertificatedate' ,$takecertificatedate); $stmt -> bindParam(':takecertificatedate' ,$elevator['takecertificatedate']);
$stmt -> bindParam(':licensedate' ,$licensedateeeee); $stmt -> bindParam(':licensedate' ,$elevator['licensedateeeee']);
$result = $stmt -> execute(); $result = $stmt -> execute();
} }
//create schedule table //create schedule table
$comboNo = new CreateComboNo($mcycle, $contract_begin_date, $contract_end_date); $comboNo = new CreateComboNo($mcycle, $contract_begin_date, $contract_end_date);
@ -237,6 +227,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") {
$bonus = 1000; $bonus = 1000;
$max_bonus = 2000; $max_bonus = 2000;
if(!empty($files)){
$englisharr = range('a', 'z'); $englisharr = range('a', 'z');
$file = $_FILES['files']; $file = $_FILES['files'];
$file_name = $file['name']; $file_name = $file['name'];
@ -256,7 +247,6 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") {
$i++; $i++;
} //foreach 第2層 end } //foreach 第2層 end
} }
echo json_encode($newfiles);
$max_size = 4096*4096; //設定允許上傳檔案容量的最大值(1M) $max_size = 4096*4096; //設定允許上傳檔案容量的最大值(1M)
$allow_ext = array('jpeg', 'jpg', 'png','JPG','JPEG','PNG','GIF'); //設定允許上傳檔案的類型 $allow_ext = array('jpeg', 'jpg', 'png','JPG','JPEG','PNG','GIF'); //設定允許上傳檔案的類型
$path = '../images/contracts/'; $path = '../images/contracts/';
@ -291,8 +281,11 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") {
} }
} }
$sql_str = "INSERT INTO contract_b_signed_back (contract_no, contract_type, company, customer_no, salesperson, contract_start_date, contract_end_date, total_price, opendoor, customer_phone, customer_email, repairman, cycle, contact_person, contact_address, contact_phone, contact_email, takecertificatedate, license_date, elevators_number, spec, weight, speed, numberofpassenger, numberofstop, numberoffloor, latitude, longitude, area, address, files_id, bonus, max_bonus, created_at, created_by) }else{
VALUES (:contract_no, :contract_type, :company, :customer_no, :salesperson, :contract_start_date, :contract_end_date, :total_price, :opendoor, :customer_phone, :customer_email, :repairman, :cycle, :contact_person, :contact_address, :contact_phone, :contact_email, :takecertificatedate, :license_date, :elevators_number, :spec, :weight, :speed, :numberofpassenger, :numberofstop, :numberoffloor, :latitude, :longitude, :area, :address, :files_id, :bonus, :max_bonus, :created_at, :created_by)"; $files = null;
}
$sql_str = "INSERT INTO contract_b_signed_back (contract_no, contract_type, company, customer_no, salesperson, contract_start_date, contract_end_date, total_price, customer_phone, customer_email, repairman, cycle, contact_person, contact_address, contact_phone, contact_email, elevators_number, area, address, files_id, bonus, max_bonus, created_at, created_by)
VALUES (:contract_no, :contract_type, :company, :customer_no, :salesperson, :contract_start_date, :contract_end_date, :total_price, :customer_phone, :customer_email, :repairman, :cycle, :contact_person, :contact_address, :contact_phone, :contact_email, :elevators_number, :area, :address, :files_id, :bonus, :max_bonus, :created_at, :created_by)";
$stmt = $conn -> prepare($sql_str); $stmt = $conn -> prepare($sql_str);
$stmt -> bindParam(":contract_no",$contractno); $stmt -> bindParam(":contract_no",$contractno);
$stmt -> bindParam(":contract_type",$contract_type); $stmt -> bindParam(":contract_type",$contract_type);
@ -302,7 +295,6 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") {
$stmt -> bindParam(":contract_start_date",$contract_begin_date); $stmt -> bindParam(":contract_start_date",$contract_begin_date);
$stmt -> bindParam(":contract_end_date",$contract_end_date); $stmt -> bindParam(":contract_end_date",$contract_end_date);
$stmt -> bindParam(":total_price",$total_price); $stmt -> bindParam(":total_price",$total_price);
$stmt -> bindParam(":opendoor",$opendoor);
$stmt -> bindParam(":customer_phone",$customer_phone); $stmt -> bindParam(":customer_phone",$customer_phone);
$stmt -> bindParam(":customer_email",$customer_email); $stmt -> bindParam(":customer_email",$customer_email);
$stmt -> bindParam(":repairman",$repairman); $stmt -> bindParam(":repairman",$repairman);
@ -311,17 +303,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") {
$stmt -> bindParam(":contact_address",$contact_address); $stmt -> bindParam(":contact_address",$contact_address);
$stmt -> bindParam(":contact_phone",$contact_phone); $stmt -> bindParam(":contact_phone",$contact_phone);
$stmt -> bindParam(":contact_email",$contact_email); $stmt -> bindParam(":contact_email",$contact_email);
$stmt -> bindParam(":takecertificatedate",$takecertificatedate);
$stmt -> bindParam(":license_date",$license_date);
$stmt -> bindParam(":elevators_number",$elevators_number); $stmt -> bindParam(":elevators_number",$elevators_number);
$stmt -> bindParam(":spec",$spec);
$stmt -> bindParam(":weight",$weight);
$stmt -> bindParam(":speed",$speed);
$stmt -> bindParam(":numberofpassenger",$numberofpassenger);
$stmt -> bindParam(":numberofstop",$numberofstop);
$stmt -> bindParam(":numberoffloor",$numberoffloor);
$stmt -> bindParam(":latitude",$latitude);
$stmt -> bindParam(":longitude",$longitude);
$stmt -> bindParam(":area",$area); $stmt -> bindParam(":area",$area);
$stmt -> bindParam(":address",$address); $stmt -> bindParam(":address",$address);
$stmt -> bindParam(":files_id",$files_id); $stmt -> bindParam(":files_id",$files_id);
@ -337,8 +319,8 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "") {
$conn->commit(); $conn->commit();
}catch(PDOException $e){ }catch(PDOException $e){
$r = $conn->rollback(); $conn->rollback();
echo $r; echo $e->getMessage();
die('Error!:'.$e->getMessage()); die('Error!:'.$e->getMessage());
} }
} }
@ -401,4 +383,4 @@ function upload_chk( $file, $path, $max_size, $allow_ext, $file_name ){
} //if( $error == 0 ){ ..... end } //if( $error == 0 ){ ..... end
return $msg; //回傳$msg的結果 return $msg; //回傳$msg的結果
}// function end }

296
wms/contract/contract-input.php

@ -20,6 +20,7 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
?> ?>
<link rel="stylesheet" href="./styles/style.css"> <link rel="stylesheet" href="./styles/style.css">
<link rel="stylesheet" href="semantic/dist/semantic.min.css"> <link rel="stylesheet" href="semantic/dist/semantic.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.5.0/axios.min.js" integrity="sha512-aoTNnqZcT8B4AmeCFmiSnDlc4Nj/KPaZyB5G7JnOnUEkdNpCZs1LCankiYi01sLTyWy+m2P+W4XM+BuQ3Q4/Dg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.5.0/axios.min.js" integrity="sha512-aoTNnqZcT8B4AmeCFmiSnDlc4Nj/KPaZyB5G7JnOnUEkdNpCZs1LCankiYi01sLTyWy+m2P+W4XM+BuQ3Q4/Dg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
@ -33,11 +34,14 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
}, },
cities:[], cities:[],
data:{ data:{
<<<<<<< HEAD
contractno:'Q23080026', contractno:'Q23080026',
=======
contractno:'B23100060',
>>>>>>> yan
total_price:'', //合約總價 total_price:'', //合約總價
vat:'', //統一編號 vat:'', //統一編號
mtype:'A', //維修型態 mtype:'A', //維修型態
opendoor:'', //開門方式
phone:'', //客戶電話 phone:'', //客戶電話
email:'', //Email email:'', //Email
mworker:'', //保養員 mworker:'', //保養員
@ -54,6 +58,7 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
partyAphone:'', //業務聯繫人電話 partyAphone:'', //業務聯繫人電話
partyAemail:'', //業務聯繫人email partyAemail:'', //業務聯繫人email
files:[], //附件檔案 files:[], //附件檔案
<<<<<<< HEAD
spec:'', //機種 spec:'', //機種
brand:'', //廠牌 brand:'', //廠牌
weight: '', //載重 weight: '', //載重
@ -67,6 +72,11 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
num:'', //電梯數量 num:'', //電梯數量
latitude:'', //緯度 latitude:'', //緯度
longitude:'', //經度 longitude:'', //經度
=======
num:'', //電梯數量
disabled:false, //資料庫是否有電梯數量資料
elevators:[], //機種、載重、人乘、樓停、樓層、速度、緯度、經度、開門方式、保養別、廠牌、竣檢日、許可證日期
>>>>>>> yan
}, },
customize:false, customize:false,
step:1, step:1,
@ -78,6 +88,14 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
this.isLoading = true this.isLoading = true
this.getContractDate(); this.getContractDate();
}else if(this.step == 2){ }else if(this.step == 2){
<<<<<<< HEAD
=======
if(this.data.num <= 0) return alert('請填寫電梯數量!')
if(!this.data.disabled){
this.createElevator();
}
>>>>>>> yan
this.step = 3 this.step = 3
} }
}, },
@ -91,8 +109,37 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
this.step = 3 this.step = 3
} }
}, },
<<<<<<< HEAD
getContractDate(){ getContractDate(){
axios.get('./api/getContractData.php?contractno=' + this.data.contractno).then(res=>{ axios.get('./api/getContractData.php?contractno=' + this.data.contractno).then(res=>{
=======
createElevator(){
for(let i=0;i<this.data.num;i++){
this.data.elevators.push({
spec:'', //規格
weight:'', //載重
speed:'', //速度
persons:'', //人乘
stop:'', //樓停
floors:'', //樓層
latitude:'', //緯度
longitude:'', //經度
brand:'', //廠牌
opendoor:'', //開門方式
maintainance:'', //保養別
takecertificatedate:'', //竣檢日
licensedate:'', //許可證有效日期
})
}
},
getContractDate(){
axios.get('./api/getContractData.php?contractno=' + this.data.contractno).then(res=>{
if(!res.data){
this.step = 2
this.isLoading = false
return
}
>>>>>>> yan
if(!this.customize){ if(!this.customize){
console.log(res.data); console.log(res.data);
this.data.total_price = res.data.sold_price this.data.total_price = res.data.sold_price
@ -110,7 +157,14 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
this.data.numberoffloor = res.data.floors this.data.numberoffloor = res.data.floors
this.data.speed = res.data.speed this.data.speed = res.data.speed
this.data.takecertificatedate = res.data.contract_begin_date this.data.takecertificatedate = res.data.contract_begin_date
this.data.num = res.data.num
this.data.disabled = (res.data.num > 0) ? true : false;
this.data.elevators = res.data.elevators
let cityIndex = this.data.address.indexOf('市'); let cityIndex = this.data.address.indexOf('市');
console.log(cityIndex);
if(cityIndex == -1) {
cityIndex = this.data.address.indexOf('縣');
}
if (cityIndex > 1) { if (cityIndex > 1) {
// 獲取''市''前面的兩個字 // 獲取''市''前面的兩個字
let city = this.data.address.substring(cityIndex - 2, cityIndex + 1); let city = this.data.address.substring(cityIndex - 2, cityIndex + 1);
@ -128,7 +182,11 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
}, },
preStepFn(){ preStepFn(){
if(this.step==2){ if(this.step==2){
<<<<<<< HEAD
if(confirm('回到上一頁會將本頁資料清空,確定返回嗎?')){ if(confirm('回到上一頁會將本頁資料清空,確定返回嗎?')){
=======
if(confirm('回到上一頁會將會初始化資料,確定返回嗎?')){
>>>>>>> yan
this.step = 1 this.step = 1
this.data.total_price = '' this.data.total_price = ''
this.data.salesman = '' this.data.salesman = ''
@ -146,6 +204,12 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
this.data.speed = '' this.data.speed = ''
this.data.takecertificatedate = '' this.data.takecertificatedate = ''
this.step = 1 this.step = 1
<<<<<<< HEAD
=======
this.data.num = ''
this.data.disabled = false
this.data.elevators = []
>>>>>>> yan
return; return;
} }
}else if(this.step == 3){ }else if(this.step == 3){
@ -159,7 +223,6 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
form.append('total_price', this.data.total_price); form.append('total_price', this.data.total_price);
form.append('vat', this.data.vat); form.append('vat', this.data.vat);
form.append('mtype', this.data.mtype); form.append('mtype', this.data.mtype);
form.append('opendoor', this.data.opendoor);
form.append('phone', this.data.phone); form.append('phone', this.data.phone);
form.append('email', this.data.email); form.append('email', this.data.email);
form.append('mworker', this.data.mworker); form.append('mworker', this.data.mworker);
@ -174,20 +237,14 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
form.append('partyAaddress', this.data.partyAaddress); form.append('partyAaddress', this.data.partyAaddress);
form.append('partyAphone', this.data.partyAphone); form.append('partyAphone', this.data.partyAphone);
form.append('partyAemail', this.data.partyAemail); form.append('partyAemail', this.data.partyAemail);
form.append('spec', this.data.spec);
form.append('weight', this.data.weight);
form.append('numberofpassenger', this.data.numberofpassenger);
form.append('numberofstop', this.data.numberofstop);
form.append('numberoffloor', this.data.numberoffloor);
form.append('speed', this.data.speed);
form.append('takecertificatedate', this.data.takecertificatedate);
form.append('maintainance', this.data.maintainance);
form.append('licensedate', this.data.licensedate);
form.append('latitude', this.data.latitude);
form.append('longitude', this.data.longitude);
form.append('user_id', '<?php echo $user_id; ?>'); form.append('user_id', '<?php echo $user_id; ?>');
form.append('user_name', '<?php echo $user_name; ?>'); form.append('user_name', '<?php echo $user_name; ?>');
form.append('num', this.data.num); form.append('num', this.data.num);
<<<<<<< HEAD
=======
console.log(this.data.elevators);
form.append('elevators', JSON.stringify(this.data.elevators));
>>>>>>> yan
// 如果有附件檔案,可以逐一加入 // 如果有附件檔案,可以逐一加入
for (var i = 0; i < this.data.files.length; i++) { for (var i = 0; i < this.data.files.length; i++) {
@ -260,7 +317,11 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
<td style="vertical-align: middle">立約人</td> <td style="vertical-align: middle">立約人</td>
<td> <td>
<input type="text" x-model="data.customer" /> <input type="text" x-model="data.customer" />
<<<<<<< HEAD
<p class="alerttext" x-show="data.customer==''">未填寫</p> <p class="alerttext" x-show="data.customer==''">未填寫</p>
=======
<p class="alerttext" x-show="data.customer==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
<td style="vertical-align: middle">營業員</td> <td style="vertical-align: middle">營業員</td>
<td> <td>
@ -270,30 +331,52 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
<option value="<?php echo $person['accountid'] ?>"><?php echo $person['name'] ?></option> <option value="<?php echo $person['accountid'] ?>"><?php echo $person['name'] ?></option>
<?php } ?> <?php } ?>
</select> </select>
<<<<<<< HEAD
<p class="alerttext" x-show="data.salesman==''">未填寫</p> <p class="alerttext" x-show="data.salesman==''">未填寫</p>
=======
<p class="alerttext" x-show="data.salesman==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
<td style="vertical-align: middle">合約開始時間</td> <td style="vertical-align: middle">合約開始時間</td>
<td> <td>
<input class="form-control disabled_select" type="date" name="start_date" x-model="data.contract_begin_date" > <input class="form-control disabled_select" type="date" name="start_date" x-model="data.contract_begin_date" >
<<<<<<< HEAD
<p class="alerttext" x-show="data.contract_begin_date==''">未填寫</p> <p class="alerttext" x-show="data.contract_begin_date==''">未填寫</p>
=======
<p class="alerttext" x-show="data.contract_begin_date==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
<td style="vertical-align: middle">合約終止時間</td> <td style="vertical-align: middle">合約終止時間</td>
<td> <td>
<input class="form-control disabled_select" type="date" name="end_date" x-model="data.contract_end_date" > <input class="form-control disabled_select" type="date" name="end_date" x-model="data.contract_end_date" >
<<<<<<< HEAD
<p class="alerttext" x-show="data.contract_end_date==''">未填寫</p> <p class="alerttext" x-show="data.contract_end_date==''">未填寫</p>
=======
<p class="alerttext" x-show="data.contract_end_date==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: middle">電梯台數</td> <td style="vertical-align: middle">電梯台數</td>
<td> <td>
<<<<<<< HEAD
<input class="form-control disabled_select" type="number" x-model="data.num"> <input class="form-control disabled_select" type="number" x-model="data.num">
<p class="alerttext" x-show="data.num==''">未填寫</p> <p class="alerttext" x-show="data.num==''">未填寫</p>
=======
<input class="form-control disabled_select" type="number" x-model="data.num" :disabled="data.disabled">
<p class="alerttext" x-show="data.num==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
<p class="alerttext" x-show="data.num==0 && data.num!=''"><i class="fa-solid fa-circle-xmark"></i>電梯數量需大於0</p>
>>>>>>> yan
</td> </td>
<td style="vertical-align: middle">統一編號/身分證</td> <td style="vertical-align: middle">統一編號/身分證</td>
<td> <td>
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.vat" > <input class="form-control disabled_select" type="text" name="uscc" x-model="data.vat" >
<<<<<<< HEAD
<p class="alerttext" x-show="data.vat==''">未填寫</p> <p class="alerttext" x-show="data.vat==''">未填寫</p>
=======
<p class="alerttext" x-show="data.vat==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
<td style="vertical-align: middle">維修型態</td> <td style="vertical-align: middle">維修型態</td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
@ -301,6 +384,7 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
<option value="" >選擇維修型態</option> <option value="" >選擇維修型態</option>
<option value="A">定期保養</option> <option value="A">定期保養</option>
</select> </select>
<<<<<<< HEAD
<p class="alerttext" x-show="data.mtype==''">未填寫</p> <p class="alerttext" x-show="data.mtype==''">未填寫</p>
</td> </td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
@ -321,17 +405,31 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
</select> </select>
<p class="alerttext" x-show="data.opendoor==''">未填寫</p> <p class="alerttext" x-show="data.opendoor==''">未填寫</p>
</td> </td>
=======
<p class="alerttext" x-show="data.mtype==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td></td>
<td></td>
>>>>>>> yan
</tr> </tr>
<tr> <tr>
<td style="vertical-align: middle">客戶電話</td> <td style="vertical-align: middle">客戶電話</td>
<td> <td>
<input class="form-control disabled_select" type="text" name="tel" x-model="data.phone" > <input class="form-control disabled_select" type="text" name="tel" x-model="data.phone" >
<<<<<<< HEAD
<p class="alerttext" x-show="data.phone==''">未填寫</p> <p class="alerttext" x-show="data.phone==''">未填寫</p>
=======
<p class="alerttext" x-show="data.phone==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
<td style="vertical-align: middle">Email</td> <td style="vertical-align: middle">Email</td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
<input class="form-control disabled_select" type="text" name="email" x-model="data.email" > <input class="form-control disabled_select" type="text" name="email" x-model="data.email" >
<<<<<<< HEAD
<p class="alerttext" x-show="data.email==''">未填寫</p> <p class="alerttext" x-show="data.email==''">未填寫</p>
=======
<p class="alerttext" x-show="data.email==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
<td style="vertical-align: middle">保養員</td> <td style="vertical-align: middle">保養員</td>
<td> <td>
@ -341,7 +439,11 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
<option value="<?php echo $worker['accountid']; ?>"><?php echo $worker['name'] ?></option> <option value="<?php echo $worker['accountid']; ?>"><?php echo $worker['name'] ?></option>
<?php } ?> <?php } ?>
</select> </select>
<<<<<<< HEAD
<p class="alerttext" x-show="data.mworker==''">未填寫</p> <p class="alerttext" x-show="data.mworker==''">未填寫</p>
=======
<p class="alerttext" x-show="data.mworker==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
<td style="vertical-align: middle">保養頻率</td> <td style="vertical-align: middle">保養頻率</td>
<td> <td>
@ -350,28 +452,45 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
<option value="bw">雙週保</option> <option value="bw">雙週保</option>
<option value="em">月保</option> <option value="em">月保</option>
</select> </select>
<<<<<<< HEAD
<p class="alerttext" x-show="data.mcycle==''">未填寫</p> <p class="alerttext" x-show="data.mcycle==''">未填寫</p>
=======
<p class="alerttext" x-show="data.mcycle==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: middle">業務聯繫人</td> <td style="vertical-align: middle">業務聯繫人</td>
<td> <td>
<input type="text" x-model="data.partyA" name="partyA" /> <input type="text" x-model="data.partyA" name="partyA" />
<<<<<<< HEAD
<p class="alerttext" x-show="data.partyA==''">未填寫</p> <p class="alerttext" x-show="data.partyA==''">未填寫</p>
=======
<p class="alerttext" x-show="data.partyA==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
<td style="vertical-align: middle">業務聯繫人地址</td> <td style="vertical-align: middle">業務聯繫人地址</td>
<td> <td>
<input class="form-control disabled_select" x-model="data.partyAaddress" type="text" name="contractaddress" value="" > <input class="form-control disabled_select" x-model="data.partyAaddress" type="text" name="contractaddress" value="" >
<<<<<<< HEAD
<p class="alerttext" x-show="data.partyAaddress==''">未填寫</p> <p class="alerttext" x-show="data.partyAaddress==''">未填寫</p>
=======
<p class="alerttext" x-show="data.partyAaddress==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
<td style="vertical-align: middle">業務聯繫人電話</td> <td style="vertical-align: middle">業務聯繫人電話</td>
<td> <td>
<input class="form-control disabled_select" type="text" name="contracttel" x-model="data.partyAphone" > <input class="form-control disabled_select" type="text" name="contracttel" x-model="data.partyAphone" >
<<<<<<< HEAD
<p class="alerttext" x-show="data.partyAphone==''">未填寫</p> <p class="alerttext" x-show="data.partyAphone==''">未填寫</p>
=======
<p class="alerttext" x-show="data.partyAphone==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
>>>>>>> yan
</td> </td>
<td style="vertical-align: middle">業務聯繫人Email</td> <td style="vertical-align: middle">業務聯繫人Email</td>
<td> <td>
<input class="form-control disabled_select" type="text" name="contracttel" x-model="data.partyAemail" > <input class="form-control disabled_select" type="text" name="contracttel" x-model="data.partyAemail" >
<<<<<<< HEAD
<p class="alerttext" x-show="data.partyAemail==''">未填寫</p> <p class="alerttext" x-show="data.partyAemail==''">未填寫</p>
</td> </td>
</tr> </tr>
@ -486,6 +605,157 @@ $facilityno = $createFacilityNo->makeTFacilityNo("T", 'X', 5);
</td> </td>
</tr> </tr>
</tbody> </tbody>
=======
<p class="alerttext" x-show="data.partyAemail==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">區域</td>
<td>
<select class="ui search dropdown" x-model="data.area">
<option value="">選擇區域</option>
<template x-for="city in cities" :key="city.code">
<option x-bind:selected="city.name === data.area" x-text="city.name" :value="city.name"></option>
</template>
</select>
<p class="alerttext" x-show="data.area==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">詳細地址</td>
<td colspan="3">
<input type="text" x-model="data.address" />
<p class="alerttext" x-show="data.address==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">附件</td>
<td >
<input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" />
<p class="alerttext" x-show="data.files==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
</tr>
</tbody>
>>>>>>> yan
</template>
<template x-if="step==3">
<template x-for="(elevator, idx) in data.elevators" :key="elevator.apply_key + elevator.register_code">
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==3">
<tr>
<td colspan=8><p x-text="'電梯' + Number(idx+1)"></p></td>
</tr>
<tr>
<td style="vertical-align: middle">機種</td>
<td>
<select class="ui search dropdown" name="spec" x-model="data.elevators[idx].spec" >
<option value="">選擇規格</option>
<option value="MAE100">MAE100</option>
<option value="MAM200">MAM200</option>
<option value="MAH100">MAH100</option>
<option value="MAQ100">MAQ100</option>
<option value="MAF100">MAF100</option>
<option value="MAZ100">MAZ100</option>
</select>
<p class="alerttext" x-show="!(data.elevators[idx].spec=='MAE100' || data.elevators[idx].spec=='MAM200' || data.elevators[idx].spec=='MAH100' || data.elevators[idx].spec=='MAQ100' || data.elevators[idx].spec=='MAF100' || data.elevators[idx].spec=='MAZ100')"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">載重</td>
<td>
<input type="text" x-model="data.elevators[idx].weight" />
<p class="alerttext" x-show="data.elevators[idx].weight==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">速度</td>
<td>
<input type="text" x-model="data.elevators[idx].speed" />
<p class="alerttext" x-show="data.elevators[idx].speed==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">人乘</td>
<td>
<input type="text" x-model="data.elevators[idx].persons" />
<p class="alerttext" x-show="data.elevators[idx].persons==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">樓停</td>
<td>
<input type="number" class="form-control" x-model="data.elevators[idx].stop" />
<p class="alerttext" x-show="data.elevators[idx].stop==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">樓層</td>
<td>
<input type="text" x-model="data.elevators[idx].floors" />
<p class="alerttext" x-show="data.elevators[idx].floors==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">緯度</td>
<td>
<input type="text" x-model="data.elevators[idx].latitude" />
<p class="alerttext" x-show="data.elevators[idx].latitude=='' || !data.elevators[idx].latitude"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">經度</td>
<td>
<input type="text" x-model="data.elevators[idx].longitude" />
<p class="alerttext" x-show="data.elevators[idx].longitude=='' || !data.elevators[idx].longitude"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">廠牌</td>
<td>
<input type="text" x-model="data.elevators[idx].brand" class="form-control" />
<p class="alerttext" x-show="data.elevators[idx].brand==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">
開門方式
</td>
<td style="vertical-align: middle">
<select class="ui search dropdown" name="repairtype" x-model="data.elevators[idx].opendoor">
<option value="">選擇開門方式</option>
<option value="2PCO">2PCO</option>
<option value="2S">2S</option>
<option value="2SL">2SL</option>
<option value="2SR">2SR</option>
<option value="2U">2U</option>
<option value="3S">3S</option>
<option value="4PCO">4PCO</option>
<option value="6PCO">6PCO</option>
<option value="CO">CO</option>
</select>
<p class="alerttext" x-show="data.elevators[idx].opendoor==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">保養別</td>
<td>
<select class="ui search dropdown" x-model="data.elevators[idx].maintainance">
<option value="">選擇保養別</option>
<option value="A">全包</option>
<option value="B">半包</option>
<option value="C">清包</option>
</select>
<p class="alerttext" x-show="data.elevators[idx].maintainance==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">竣檢日</td>
<td>
<input class="form-control disabled_select" type="date" x-model="data.elevators[idx].takecertificatedate">
<p class="alerttext" x-show="data.elevators[idx].takecertificatedate==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">許可證有效時間</td>
<td>
<input class="form-control disabled_select" type="date" x-model="data.elevators[idx].licensedate">
<p class="alerttext" x-show="data.elevators[idx].licensedate==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr><td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td></tr>
</tbody>
</template>
</template> </template>
</table> </table>

7
wms/contract/export-pdf.php

@ -71,9 +71,9 @@ if(isset($_POST['html'])){
$this->Cell(0, 10, $pageNumText, 0, false, 'C', 0, '', 0, false, 'T', 'M'); $this->Cell(0, 10, $pageNumText, 0, false, 'C', 0, '', 0, false, 'T', 'M');
$this->SetTextColor(225, 225, 225); $this->SetTextColor(225, 225, 225);
$this->SetY(-23); // 设置Y坐标到页面底部 $this->SetY(-23); // 設定Y座標在頁面底部
$this->SetFont($customFont, '', 12); $this->SetFont($customFont, '', 12);
$this->Cell(0, 10, $token, 0, 0, 'R'); // 在右下角添加浮水印文本 $this->Cell(0, 10, $token, 0, 0, 'R'); // 在右下角添加浮水印
} }
} }
@ -100,7 +100,6 @@ if(isset($_POST['html'])){
// 加入 HTML 和 CSS // 加入 HTML 和 CSS
$html = $_POST['css'] . $_POST['html']; $html = $_POST['css'] . $_POST['html'];
// 使用正則表達式找到 <u>xxxx</u>
$footer = $_POST['footer']; $footer = $_POST['footer'];
@ -168,7 +167,7 @@ if(isset($_POST['html'])){
$width = $pdf->getPageWidth(); $width = $pdf->getPageWidth();
$height = $pdf->getPageHeight(); $height = $pdf->getPageHeight();
// 加入 HTML 和 CSS // 加入footer
$footer = $_POST['footer']; $footer = $_POST['footer'];
// 寫入 HTML 到 PDF // 寫入 HTML 到 PDF

BIN
wms/contract/images/contracts/c202311081429488338k8338202204260238d952-c57d-4306-98fc-2a0a92278382.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
wms/contract/images/contracts/c202311081434191255r1255202204260238d952-c57d-4306-98fc-2a0a92278382.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
wms/contract/images/contracts/c202311081434539019c9019202204260238d952-c57d-4306-98fc-2a0a92278382.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
wms/contract/images/contracts/c202311081435583265z3265202204260238d952-c57d-4306-98fc-2a0a92278382.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
wms/contract/images/contracts/c202311081438444055k4055202204260238d952-c57d-4306-98fc-2a0a92278382.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
wms/contract/images/contracts/c202311081438445230g52301697165865064.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

BIN
wms/contract/images/contracts/c202311081438448320u83201697599065970.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 KiB

BIN
wms/contract/images/contracts/c202311081444122858a28581697599065970.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 KiB

BIN
wms/contract/images/contracts/c202311081444124981q4981202204260238d952-c57d-4306-98fc-2a0a92278382.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
wms/contract/images/contracts/c202311081444126049x60491697165865064.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

BIN
wms/contract/images/contracts/c202311081444483652o3652202204260238d952-c57d-4306-98fc-2a0a92278382.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
wms/contract/images/contracts/c202311081444484116d41161697599065970.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 KiB

BIN
wms/contract/images/contracts/c202311081444489890p98901697165865064.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

BIN
wms/contract/images/contracts/c202311090947427180t71804OlaIEQjXAZDasK9Pd1Jxb.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
wms/contract/images/contracts/c202311090954176835l68354OlaIEQjXAZDasK9Pd1Jxb.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
wms/contract/images/contracts/c202311090954583134s31344OlaIEQjXAZDasK9Pd1Jxb.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
wms/contract/images/contracts/c202311091004414235g42354OlaIEQjXAZDasK9Pd1Jxb.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
wms/contract/images/contracts/c202311101747315948u59481697165865064.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

BIN
wms/contract/images/contracts/c202311101747319269t92691697599065970.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 KiB

BIN
wms/contract/images/contracts/c202311101747481959u19591697165865064.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

BIN
wms/contract/images/contracts/c202311101747483858a38581697599065970.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 KiB

BIN
wms/contract/images/contracts/c202311101750548465f84651697599065970.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 KiB

BIN
wms/contract/images/contracts/c202311101758595752g57521697599065970.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 KiB

4
wms/contract/prviewPdf.php

@ -61,7 +61,7 @@ function numberToChinese($num) {
} elseif ($num < 100) { } elseif ($num < 100) {
return $chineseNumbers[intval($num / 10)] . $units[1] . ($num % 10 > 0 ? $chineseNumbers[$num % 10] : ''); return $chineseNumbers[intval($num / 10)] . $units[1] . ($num % 10 > 0 ? $chineseNumbers[$num % 10] : '');
} else { } else {
// 处理大于 99 的数字 // 處理大於 99 的数字
$result = ''; $result = '';
$strNum = strval($num); $strNum = strval($num);
$length = strlen($strNum); $length = strlen($strNum);
@ -77,7 +77,7 @@ function numberToChinese($num) {
} }
} }
function removeTrailingBr($string) { function removeTrailingBr($string) {
//使用正則表達式刪除字串尾巴的<br><br /> //刪除字串尾巴的<br><br />
return preg_replace('/(<br\s*\/?>)+$/', '', $string); return preg_replace('/(<br\s*\/?>)+$/', '', $string);
} }

22
wms/contract/styles/style.css

@ -557,6 +557,28 @@ main table td, main table th {
height: 45px; height: 45px;
font-size: 15px; font-size: 15px;
} }
.contract-input-component .form table .alerttext {
font-size: 13px;
color: #a00;
font-weight: 500;
margin: 3px;
font-weight: 900;
padding: 0;
}
.contract-input-component .form input[type=file] {
padding: 12px 20px;
margin: 8px 0;
}
.contract-input-component .error {
display: flex;
flex-direction: column;
margin: 15px;
}
.contract-input-component .error .errortext {
font-size: 16px;
font-weight: 500;
color: #a00;
}
.contract-input-component .input-group-btn { .contract-input-component .input-group-btn {
font-size: 16px; font-size: 16px;
} }

2
wms/contract/styles/style.css.map

File diff suppressed because one or more lines are too long

25
wms/contract/styles/style.scss

@ -578,7 +578,32 @@ main{
height: 45px; height: 45px;
font-size: 15px; font-size: 15px;
} }
table{
.alerttext{
font-size: 13px;
color:#a00;
font-weight: 500;
margin: 3px;
font-weight: 900;
padding: 0;
}
} }
input[type="file"]{
padding: 12px 20px;
margin: 8px 0;
}
}
.error{
display: flex;
flex-direction: column;
margin:15px ;
.errortext{
font-size: 16px;
font-weight: 500;
color: #a00;
}
}
.input-group-btn{ .input-group-btn{
font-size: 16px; font-size: 16px;
} }

Loading…
Cancel
Save