26 changed files with 4557 additions and 0 deletions
@ -0,0 +1,15 @@ |
|||
<?php |
|||
require_once("../conn.php"); |
|||
|
|||
if(isset($_GET['contractid']) && $_GET['contractid']!=""){ |
|||
try{ |
|||
$id = $_GET["contractid"]; |
|||
$sql_str = "DELETE FROM contract_m_signed_back WHERE id = :contractid"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(":contractid", $id); |
|||
$stmt->execute(); |
|||
header("HTTP/1.1 204 No Content"); |
|||
}catch(PDOException $e){ |
|||
die("ERROR!!!: ". $e->getMessage()); |
|||
} |
|||
} |
@ -0,0 +1,59 @@ |
|||
<?php |
|||
|
|||
class CreateComboNo{ |
|||
private $comboarr = [ |
|||
'week'=>'BW002', |
|||
'month'=>'EM002', |
|||
'quarter'=>'EQ002', |
|||
'half'=>'HY002', |
|||
'year'=>'EY002' |
|||
]; |
|||
private $bwarr = [ |
|||
'week','month','week','month','week','quarter', |
|||
'week','month','week','month','week','half', |
|||
'week','month','week','month','week','quarter', |
|||
'week','month','week','month','week','year' |
|||
]; |
|||
private $emarr = [ |
|||
'month','month','quarter','month','month','half', |
|||
'month','month','quarter','month','month','year' |
|||
]; |
|||
private $combo; |
|||
private $startdate; |
|||
private $enddate; |
|||
public function __construct($combo, $startdate, $enddate){ |
|||
$this->combo = $combo; |
|||
$this->startdate = $startdate; |
|||
$this->enddate = $enddate; |
|||
} |
|||
public function getComboNo(){ |
|||
$comboarr = (array) $this->combo === 'bw' ? $this->bwarr : $this->emarr; |
|||
|
|||
$startdate = new DateTime($this->startdate); |
|||
$enddate = new DateTime($this->enddate); |
|||
|
|||
$interval = date_diff($startdate, $enddate); |
|||
|
|||
$months = $interval->y * 12 + $interval->m; |
|||
$months = $this->combo === 'bw' ? $months*2 : $months; |
|||
|
|||
$newarr = []; |
|||
$idx = 0; |
|||
$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 ++; |
|||
$scheduleDate = $startdate->modify("+1 month"); |
|||
if($idx >= count($comboarr)){ |
|||
$idx = 0; |
|||
} |
|||
} |
|||
return json_encode($newarr); |
|||
} |
|||
} |
@ -0,0 +1,60 @@ |
|||
<?php |
|||
require_once('../conn.php'); |
|||
if(isset($_GET['contractno']) && $_GET['contractno']!='' && isset($_GET['contracttype']) && $_GET['contracttype']=='b'){ |
|||
try{ |
|||
$contractno = $_GET['contractno']; |
|||
$sql_str = "SELECT con_maintance_examine_apply.*, con_maintance_examine_clear.* FROM con_maintance_examine_apply |
|||
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 ;"; |
|||
$sql_str = "SELECT * FROM con_maintance_examine_apply WHERE vol_no = :vol_no ORDER BY create_at DESC;"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':vol_no', $contractno); |
|||
$stmt->execute(); |
|||
$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); |
|||
|
|||
// 設定回應標頭為 JSON |
|||
header('Content-Type: application/json'); |
|||
|
|||
// 將 JSON 回應返回給客戶端 |
|||
echo $contractResponse; |
|||
// echo json_encode($contractResponse); |
|||
}catch (PDOException $e ){ |
|||
die("ERROR!!!: ". $e->getMessage()); |
|||
} |
|||
} |
|||
|
|||
if(isset($_GET['contractno']) && $_GET['contractno']!='' && isset($_GET['contracttype']) && $_GET['contracttype']=='m'){ |
|||
try{ |
|||
$contractno = $_GET['contractno']; |
|||
$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', $contractno); |
|||
$stmt->execute(); |
|||
$contract= $stmt->fetch(PDO::FETCH_ASSOC); |
|||
$contractResponse = json_encode($contract); |
|||
|
|||
// 設定回應標頭為 JSON |
|||
header('Content-Type: application/json'); |
|||
|
|||
// 將 JSON 回應返回給客戶端 |
|||
echo $contractResponse; |
|||
}catch (PDOException $e ){ |
|||
die("ERROR!!!: ". $e->getMessage()); |
|||
} |
|||
} |
@ -0,0 +1,518 @@ |
|||
<?php |
|||
//ini_set('display_errors', 'on'); |
|||
// 汰改 前三碼 流水號 + 後兩碼 號機 |
|||
// 新梯 流水號 |
|||
|
|||
// 新增 seq 的初始值 |
|||
// INSERT INTO `sequence` (`seq_name`, `current_val`, `increment_val`, `remark`, `yyyymm`, `prefix`, `creator`, `create_at`) VALUES ('bf_vol_no', '0', '1', '保養-作番編號', '202310', '', 'M0117', '2023-10-26 11:28:11'), ('mf_vol_no', '0', '1', '新梯-作番編號', '202310', '', 'M0117', '2023-10-26 11:28:11'), ('tf_vol_no', '0', '1', '汰改-作番編號', '202310', '', 'M0117', '2023-10-26 11:28:11') |
|||
|
|||
|
|||
class CreateFacilityNo |
|||
{ |
|||
/** |
|||
* 連接資料庫 |
|||
*/ |
|||
function connectionDB() |
|||
{ |
|||
$envFile = __DIR__ . '/../../../.env'; |
|||
if (file_exists($envFile)) { |
|||
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|||
if ($lines !== false) { |
|||
foreach ($lines as $line) { |
|||
list($key, $value) = explode('=', $line, 2); |
|||
$key = trim($key); |
|||
$value = trim($value); |
|||
putenv("$key=$value"); |
|||
} |
|||
} |
|||
} |
|||
date_default_timezone_set("Asia/Taipei"); |
|||
$host = getenv('DB_HOST'); |
|||
$dbport = getenv('DB_PORT'); |
|||
$dbuser = getenv('DB_USERNAME'); |
|||
$dbpassword = getenv('DB_PASSWORD'); |
|||
$dbname = getenv('DB_DATABASE'); |
|||
|
|||
try { |
|||
$options = [ |
|||
PDO::ATTR_PERSISTENT => false, |
|||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, |
|||
PDO::ATTR_EMULATE_PREPARES => false, |
|||
PDO::ATTR_STRINGIFY_FETCHES => false, |
|||
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', |
|||
]; |
|||
$pdo = new PDO('mysql:host=' . $host . ';port=' . $dbport . ';dbname=' . $dbname . '', $dbuser, $dbpassword, $options); |
|||
$pdo->exec('SET CHARACTER SET utf8mb4'); |
|||
return $pdo; |
|||
} catch (PDOException $e) { |
|||
die("Something wrong: {$e->getMessage()}"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 結束資料庫連線 |
|||
*/ |
|||
function endConnectionDB($pdo) |
|||
{ |
|||
unset($pdo); |
|||
} |
|||
|
|||
/** |
|||
* 取得下一個新的作番 |
|||
* @param string $facility_type : M:新梯 T:汰改 B:保養 |
|||
* @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品 |
|||
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正 |
|||
* @param int $num : 號機 |
|||
* @return array $new_facility_arr |
|||
*/ |
|||
function getNextFacilityNo($facility_type, $sale_type, $make_type, $num = 1) |
|||
{ |
|||
$this->checkYearAndResetAllSeq(); |
|||
$Y = substr(date("Y"), 3, 1); |
|||
|
|||
switch ($facility_type) { |
|||
case "M": |
|||
$next_seq = $this->getNextFacilitySeq("mf_vol_no") + 1; |
|||
$new_facility_arr = []; |
|||
for ($start_num = 1; $start_num <= $num; $start_num++) { |
|||
$facility_no_tmp = $Y . $sale_type . $make_type[$start_num - 1] |
|||
. str_pad($next_seq, 5, "0", STR_PAD_LEFT); |
|||
array_push($new_facility_arr, $facility_no_tmp); |
|||
$next_seq++; |
|||
} |
|||
return $new_facility_arr; |
|||
case "T": |
|||
$next_seq = $this->getNextFacilitySeq("tf_vol_no"); |
|||
$new_facility_arr = []; |
|||
for ($start_num = 1; $start_num <= $num; $start_num++) { |
|||
$facility_no_tmp = $Y . $sale_type . $make_type[$start_num - 1] |
|||
. str_pad($next_seq + 1, 3, "0", STR_PAD_LEFT) |
|||
. str_pad($start_num, 2, "0", STR_PAD_LEFT); |
|||
array_push($new_facility_arr, $facility_no_tmp); |
|||
} |
|||
return $new_facility_arr; |
|||
case "B": |
|||
$next_seq = $this->getNextFacilitySeq("bf_vol_no"); |
|||
$new_facility_arr = []; |
|||
for ($start_num = 1; $start_num <= $num; $start_num++) { |
|||
$facility_no_tmp = $Y . $sale_type . $make_type[$start_num - 1] |
|||
. str_pad($next_seq + 1, 3, "0", STR_PAD_LEFT) |
|||
. str_pad($start_num, 2, "0", STR_PAD_LEFT); |
|||
array_push($new_facility_arr, $facility_no_tmp); |
|||
} |
|||
return $new_facility_arr; |
|||
default: |
|||
return "不存在的作番類型"; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 建立新的作番 |
|||
* @param string $facility_type : M:新梯 T:汰改 B:保養 |
|||
* @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品 |
|||
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正 |
|||
* @param string $num : 號機 (非必填) |
|||
* @return string $new_facility_no |
|||
*/ |
|||
function makeFacilityNo($facility_type, $sale_type, $make_type, $num = null) |
|||
{ |
|||
|
|||
$this->checkYearAndResetAllSeq(); |
|||
|
|||
$faclikity_details = array( |
|||
'facility_type' => $facility_type, |
|||
'sale_type' => $sale_type, |
|||
'make_type' => $make_type, |
|||
'num' => $num |
|||
); |
|||
|
|||
switch ($facility_type) { |
|||
case "M": |
|||
return $this->makeNewMFacilityNo($faclikity_details); |
|||
break; |
|||
case "T": |
|||
return $this->makeNewTFacilityNo($faclikity_details); |
|||
break; |
|||
case "B": |
|||
return $this->makeNewBFacilityNo($faclikity_details); |
|||
break; |
|||
default: |
|||
return "不存在的作番類型"; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 建立作番 -- 新梯 |
|||
*/ |
|||
function makeNewMFacilityNo($faclikity_details) |
|||
{ |
|||
$Y = substr(date("Y"), 3, 1); |
|||
$sale_type = $faclikity_details['sale_type']; |
|||
$make_type = $faclikity_details['make_type']; |
|||
$num = $faclikity_details['num']; |
|||
$next_seq = $this->getNextFacilitySeq("mf_vol_no") + 1; |
|||
$new_facility_no_arr = []; |
|||
|
|||
for ($i = 1; $i <= $num; $i++) { |
|||
$new_facility_no = $Y . $sale_type . $make_type[$i - 1] |
|||
. str_pad($next_seq, 5, "0", STR_PAD_LEFT); |
|||
array_push($new_facility_no_arr, $new_facility_no); |
|||
$next_seq++; |
|||
} |
|||
|
|||
foreach ($new_facility_no_arr as $new_facility_no) { |
|||
if ($this->getMakeNewMFacilityNoStatus($faclikity_details) !== "1") { |
|||
return $new_facility_no . ":" . $this->getMakeNewTFacilityNoStatus($faclikity_details); |
|||
} |
|||
// seq +1 |
|||
$this->facilitySeqAddOne("M"); |
|||
} |
|||
return $new_facility_no_arr; |
|||
} |
|||
|
|||
/** |
|||
* 建立作番 -- 汰改 |
|||
*/ |
|||
function makeNewTFacilityNo($faclikity_details) |
|||
{ |
|||
|
|||
$Y = substr(date("Y"), 3, 1); |
|||
$sale_type = $faclikity_details['sale_type']; |
|||
$make_type = $faclikity_details['make_type']; |
|||
$num = $faclikity_details['num']; |
|||
$next_seq = $this->getNextFacilitySeq("tf_vol_no"); |
|||
$new_facility_no_arr = []; |
|||
|
|||
for ($i = 1; $i <= $num; $i++) { |
|||
$new_facility_no = $Y . $sale_type . $make_type[$i - 1] |
|||
. str_pad($next_seq + 1, 3, "0", STR_PAD_LEFT) |
|||
. str_pad($i, 2, "0", STR_PAD_LEFT); |
|||
array_push($new_facility_no_arr, $new_facility_no); |
|||
} |
|||
|
|||
foreach ($new_facility_no_arr as $new_facility_no) { |
|||
if ($this->getMakeNewTFacilityNoStatus($faclikity_details) !== "1") { |
|||
return $new_facility_no . ":" . $this->getMakeNewTFacilityNoStatus($faclikity_details); |
|||
} |
|||
// seq +1 |
|||
$this->facilitySeqAddOne("T"); |
|||
return $new_facility_no_arr; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 建立作番 -- 保養 |
|||
*/ |
|||
function makeNewBFacilityNo($faclikity_details) |
|||
{ |
|||
|
|||
$Y = substr(date("Y"), 3, 1); |
|||
$sale_type = $faclikity_details['sale_type']; |
|||
$make_type = $faclikity_details['make_type']; |
|||
$num = $faclikity_details['num']; |
|||
$next_seq = $this->getNextFacilitySeq("bf_vol_no"); |
|||
$new_facility_no_arr = []; |
|||
|
|||
for ($i = 1; $i <= $num; $i++) { |
|||
$new_facility_no = $Y . $sale_type . $make_type[$i - 1] |
|||
. str_pad($next_seq + 1, 3, "0", STR_PAD_LEFT) |
|||
. str_pad($i, 2, "0", STR_PAD_LEFT); |
|||
array_push($new_facility_no_arr, $new_facility_no); |
|||
} |
|||
|
|||
foreach ($new_facility_no_arr as $new_facility_no) { |
|||
if ($this->getMakeNewBFacilityNoStatus($faclikity_details) !== "1") { |
|||
return $new_facility_no . ":" . $this->getMakeNewBFacilityNoStatus($faclikity_details); |
|||
} |
|||
// seq +1 |
|||
$this->facilitySeqAddOne("B"); |
|||
return $new_facility_no_arr; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 檢查作番編列狀態 - 新梯 |
|||
* @param array $faclikity_details |
|||
* @return string $status : 1:正確 else:error message |
|||
*/ |
|||
function getMakeNewMFacilityNoStatus($faclikity_details) |
|||
{ |
|||
$sale_type = $faclikity_details['sale_type']; |
|||
$make_type = $faclikity_details['make_type']; |
|||
|
|||
if ($this->checkSaleTypeStatus($sale_type) == false) |
|||
return "銷售代號錯誤"; |
|||
if ($this->checkMakeTypeStatus($make_type) == false) |
|||
return "製造編號類型錯誤"; |
|||
return "1"; |
|||
} |
|||
|
|||
/** |
|||
* 檢查作番編列狀態 - 汰改 |
|||
* @param array $faclikity_details |
|||
* @return string $status : 1:正確 else:error message |
|||
*/ |
|||
function getMakeNewTFacilityNoStatus($faclikity_details) |
|||
{ |
|||
$sale_type = $faclikity_details['sale_type']; |
|||
$make_type = $faclikity_details['make_type']; |
|||
|
|||
if ($this->checkSaleTypeStatus($sale_type) == false) |
|||
return "銷售代號錯誤"; |
|||
if ($this->checkMakeTypeStatus($make_type) == false) |
|||
return "製造編號類型錯誤"; |
|||
return "1"; |
|||
} |
|||
|
|||
/** |
|||
* 檢查作番編列狀態 - 保養 |
|||
* @param array $faclikity_details |
|||
* @return string $status : 1:正確 else:error message |
|||
*/ |
|||
function getMakeNewBFacilityNoStatus($faclikity_details) |
|||
{ |
|||
$sale_type = $faclikity_details['sale_type']; |
|||
$make_type = $faclikity_details['make_type']; |
|||
|
|||
if ($this->checkSaleTypeStatus($sale_type) == false) |
|||
return "銷售代號錯誤"; |
|||
if ($this->checkMakeTypeStatus($make_type) == false) |
|||
return "製造編號類型錯誤"; |
|||
return "1"; |
|||
} |
|||
|
|||
/** |
|||
* seq 取號 |
|||
* @param string $type M:新梯 T:汰改 B:保養 |
|||
*/ |
|||
function facilitySeqAddOne($type) |
|||
{ |
|||
$type_arr = array( |
|||
"M" => "mf_vol_no", |
|||
"T" => "tf_vol_no", |
|||
"B" => "bf_vol_no", |
|||
); |
|||
if (!empty($type_arr[$type])) { |
|||
$pdo = $this->connectionDB(); |
|||
$pdo->exec('SET CHARACTER SET utf8mb4'); |
|||
$sth = $pdo->prepare('UPDATE sequence SET current_val = current_val + 1 WHERE `seq_name` = ?'); |
|||
$sth->bindValue(1, $type_arr[$type]); |
|||
$sth->execute(); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 修正 seq 取號 |
|||
* @param string $type M:新梯 T:汰改 B:保養 |
|||
*/ |
|||
function facilityFixSeq($type) |
|||
{ |
|||
$pdo = $this->connectionDB(); |
|||
$pdo->exec('SET CHARACTER SET utf8mb4'); |
|||
$type_arr = array( |
|||
"M" => "mf_vol_no", |
|||
"T" => "tf_vol_no", |
|||
"B" => "bf_vol_no", |
|||
); |
|||
$after_fix_seq = $this->getMaxSeq($type); |
|||
$sql = " |
|||
UPDATE sequence |
|||
SET current_val = ? |
|||
WHERE seq_name = ? |
|||
"; |
|||
$sth = $pdo->prepare($sql); |
|||
$sth->bindValue(1, $after_fix_seq); |
|||
$sth->bindValue(2, $type_arr[$type]); |
|||
$sth->execute(); |
|||
} |
|||
|
|||
function getMaxSeq($type) |
|||
{ |
|||
$pdo = $this->connectionDB(); |
|||
$pdo->exec('SET CHARACTER SET utf8mb4'); |
|||
$Y = substr(date("Y"), 3, 1); |
|||
$seq_num = $type == 'M' ? 5 : 3; |
|||
$sql = " |
|||
SELECT MAX(SUBSTR(f.facilityno,4,?))+1 AS seq |
|||
FROM facility AS f |
|||
WHERE 1=1 |
|||
AND SUBSTR(f.facilityno,1,1) = ? |
|||
AND f.define = ? |
|||
ORDER BY SUBSTR(f.facilityno,4,3) ASC |
|||
"; |
|||
$sth = $pdo->prepare($sql); |
|||
$sth->bindValue(1, $seq_num); |
|||
$sth->bindValue(2, $Y); |
|||
$sth->bindValue(3, $type); |
|||
$sth->execute(); |
|||
$result = $sth->fetch(); |
|||
return $result['seq']; |
|||
} |
|||
|
|||
/** |
|||
* 檢查年月後 新梯及汰改seq歸零 |
|||
*/ |
|||
function checkYearAndResetAllSeq() |
|||
{ |
|||
$pdo = $this->connectionDB(); |
|||
$pdo->exec('SET CHARACTER SET utf8mb4'); |
|||
$sth = $pdo->prepare('SELECT * FROM `sequence` WHERE `seq_name` = ?'); |
|||
$sth->bindValue(1, 'mf_vol_no'); |
|||
$sth->execute(); |
|||
$result = $sth->fetch(); |
|||
$yyyymm = $result['yyyymm']; |
|||
$dataY = substr($yyyymm, 0, 4); |
|||
$today_Y = date("Y"); |
|||
$today_Ym = date("Ym"); |
|||
if ($dataY != $today_Y) { |
|||
$sth = $pdo->prepare('UPDATE `sequence` SET `current_val` = ? , `yyyymm` = ? WHERE `seq_name` = ?'); |
|||
$sth->bindValue(1, '0'); |
|||
$sth->bindValue(2, $today_Ym); |
|||
$sth->bindValue(3, 'mf_vol_no'); |
|||
$sth->execute(); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 檢查作番在 facility table 中是否重複 |
|||
* @param string|array $facility_no |
|||
* @return boolean $status : true:沒重複 false:重複 |
|||
*/ |
|||
function checkFacilityRepeatStatus($facility_no) |
|||
{ |
|||
if (gettype($facility_no) == "string") { |
|||
$pdo = $this->connectionDB(); |
|||
$pdo->exec('SET CHARACTER SET utf8mb4'); |
|||
$sth = $pdo->prepare('SELECT * FROM `facility` WHERE `facilityno` = ?'); |
|||
$sth->bindValue(1, $facility_no); |
|||
$sth->execute(); |
|||
if ($sth->rowCount() == 0) |
|||
return true; |
|||
return false; |
|||
} |
|||
if (gettype($facility_no) == "array") { |
|||
$pdo = $this->connectionDB(); |
|||
$pdo->exec('SET CHARACTER SET utf8mb4'); |
|||
$status = true; |
|||
foreach ($facility_no as $row) { |
|||
$sth = $pdo->prepare('SELECT * FROM `facility` WHERE `facilityno` = ?'); |
|||
$sth->bindValue(1, $row); |
|||
$sth->execute(); |
|||
if ($sth->rowCount() !== 0) |
|||
$status = false; |
|||
} |
|||
return $status; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 檢查 $sale_type 是否有存在規則之中 |
|||
* @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品 |
|||
* @return boolean $status : true:合法代碼 false:非法代碼 |
|||
*/ |
|||
function checkSaleTypeStatus($sale_type) |
|||
{ |
|||
|
|||
if (!in_array($sale_type, ['M', 'E', 'T', 'J', 'X'])) |
|||
return false; |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 檢查 $sale_type 是否有存在規則之中 |
|||
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正 |
|||
* @return boolean $status : true:合法代碼 false:非法代碼 |
|||
*/ |
|||
function checkMakeTypeStatus($make_type) |
|||
{ |
|||
foreach ($make_type as $row) |
|||
if (!in_array($row, ['X', 'W', 'H', 'Z', 'F', 'B', 'Q', 'T', 'N', 'W', 'J', 'Y'])) |
|||
return false; |
|||
return true; |
|||
} |
|||
|
|||
/** |
|||
* 檢查 取得下個作番的 seq |
|||
* @param string $seq_name : 新梯:mf_vol_no 汰改:tf_vol_no 保養:bf_vol_no |
|||
* @return int $seq : 作番流水號 |
|||
*/ |
|||
function getNextFacilitySeq($seq_name) |
|||
{ |
|||
$pdo = $this->connectionDB(); |
|||
$pdo->exec('SET CHARACTER SET utf8mb4'); |
|||
$sth = $pdo->prepare('SELECT * FROM `sequence` WHERE `seq_name` = ?'); |
|||
$sth->bindValue(1, $seq_name); |
|||
$sth->execute(); |
|||
$result = $sth->fetch(); |
|||
return $result['current_val']; |
|||
} |
|||
|
|||
/** |
|||
* 建立新的新梯作番 |
|||
* @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品 |
|||
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正 |
|||
* @param int $seq_name : 幾個案場 0-99 |
|||
* @return array $new_facilityno : 作番號 |
|||
*/ |
|||
function makeMFacilityNo($sale_type, $make_type, $num) |
|||
{ |
|||
if (count($make_type) !== $num) |
|||
return "陣列數量不一致!"; |
|||
$new_facility_no = $this->getNextFacilityNo("M", $sale_type, $make_type, $num); |
|||
if ($this->checkFacilityRepeatStatus($new_facility_no) == false) { |
|||
// 如果作番號重複 使用此函數修正 |
|||
$this->facilityFixSeq("M"); |
|||
} |
|||
return $this->makeFacilityNo("M", $sale_type, $make_type, $num); |
|||
} |
|||
|
|||
/** |
|||
* 建立新的汰改作番 |
|||
* @param array $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品 |
|||
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正 |
|||
* @param int $seq_name : 幾個案場 0-99 |
|||
* @return array $new_facilityno : 作番號 |
|||
*/ |
|||
function makeTFacilityNo($sale_type, $make_type, $num) |
|||
{ |
|||
if (count($make_type) !== $num) |
|||
return "陣列數量不一致!"; |
|||
$new_facility_no = $this->getNextFacilityNo("T", $sale_type, $make_type, $num); |
|||
if ($this->checkFacilityRepeatStatus($new_facility_no) == false) { |
|||
// 如果作番號重複 使用此函數修正 |
|||
$this->facilityFixSeq("T"); |
|||
} |
|||
return $this->makeFacilityNo("T", $sale_type, $make_type, $num); |
|||
} |
|||
|
|||
/** |
|||
* 建立新的保養作番 |
|||
* @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品 |
|||
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正 |
|||
* @param int $seq_name : 幾個案場 0-99 |
|||
* @return array $new_facilityno : 作番號 |
|||
*/ |
|||
function makeBFacilityNo($sale_type, $make_type, $num = 1) |
|||
{ |
|||
if (count($make_type) !== $num) |
|||
return "陣列數量不一致!"; |
|||
$new_facility_no = $this->getNextFacilityNo("B", $sale_type, $make_type, $num); |
|||
if ($this->checkFacilityRepeatStatus($new_facility_no) == false) { |
|||
// 如果作番號重複 使用此函數修正 |
|||
$this->facilityFixSeq("B"); |
|||
} |
|||
return $this->makeFacilityNo("B", $sale_type, $make_type, $num); |
|||
} |
|||
} |
|||
|
|||
|
|||
// $cfn = new CreateFacilityNo; |
|||
// // 建立作番號 - 新梯 |
|||
// print_r($cfn->makeMFacilityNo("M", ["X", "W"], 2)); |
|||
// echo "<br/><br/>"; |
|||
// // 建立作番號 - 汰改 |
|||
// print_r($cfn->makeTFacilityNo("M", ["X", "W"], 2)); |
|||
// echo "<br/><br/>"; |
|||
// // 建立作番號 - 保養 |
|||
// print_r($cfn->makeBFacilityNo("M", ["X", "W"], 2)); |
|||
// echo "<br/><br/>"; |
@ -0,0 +1,16 @@ |
|||
<?php |
|||
require_once('../conn.php'); |
|||
try{ |
|||
$id = $_GET['id']; |
|||
$sql_str = "SELECT * FROM pricereview_main WHERE id = :id"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':id',$id); |
|||
$stmt->execute(); |
|||
$prices = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
header("Content-Type: application/json"); |
|||
|
|||
echo json_encode(['prices'=> $prices]); |
|||
|
|||
}catch (PDOException $e ){ |
|||
die("ERROR!!!: ". $e->getMessage()); |
|||
} |
@ -0,0 +1,319 @@ |
|||
<?php |
|||
require_once("../conn.php"); |
|||
include_once("./getFacilityNo.php"); |
|||
include_once("./getComboNo.php"); |
|||
include_once("./upload_chk.php"); |
|||
ini_set ( 'date.timezone' , 'Asia/Taipei' ); |
|||
//保養簽回 |
|||
if(isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['contracttype']) && $_POST['contracttype'] == 'b') { |
|||
try{ |
|||
$created_at = date('Y-m-d H:i:s'); |
|||
$contractno = !empty($_POST['contractno'])? $_POST['contractno'] : null; |
|||
$total_price = !empty($_POST['total_price']) ? $_POST['total_price'] : null; |
|||
$vat = !empty($_POST['vat']) ? $_POST['vat'] : null; |
|||
$mtype = !empty($_POST['mtype']) ? $_POST['mtype'] :null; |
|||
$opendoor = !empty($_POST['opendoor']) ? $_POST['opendoor']: null; |
|||
$phone = !empty($_POST['phone']) ? $_POST['phone'] : null; |
|||
$email = !empty($_POST['email']) ? $_POST['email'] : null; |
|||
$mworker = !empty($_POST['mworker']) ? $_POST['mworker'] : null; |
|||
$mcycle = !empty($_POST['mcycle']) ? $_POST['mcycle'] : null; |
|||
$salesman = !empty($_POST['salesman']) ?$_POST['salesman'] : null; |
|||
$contract_begin_date = !empty($_POST['contract_begin_date']) ? $_POST['contract_begin_date'] : null; |
|||
$contract_end_date = !empty($_POST['contract_end_date']) ? $_POST['contract_end_date'] : null; |
|||
$address = !empty($_POST['address']) ? $_POST['address'] : null; |
|||
$area = !empty($_POST['area']) ? $_POST['area'] : null; |
|||
$customer = !empty($_POST['customer']) ? $_POST['customer'] : null; |
|||
$partyA = !empty($_POST['partyA']) ? $_POST['partyA'] : null; |
|||
$partyAaddress = !empty($_POST['partyAaddress']) ? $_POST['partyAaddress'] : null; |
|||
$partyAphone = !empty($_POST['partyAphone']) ? $_POST['partyAphone'] : null; |
|||
$partyAemail = !empty($_POST['partyAemail']) ? $_POST['partyAemail'] : null; |
|||
$user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : null; |
|||
$user_name = !empty($_POST['user_name']) ? $_POST['user_name'] : null; |
|||
$num = !empty($_POST['num']) ? $_POST['num'] : null; |
|||
$files = !empty($_FILES['files']) ? $_FILES['files'] : null; |
|||
$elevators = !empty($_POST['elevators']) ? json_decode($_POST['elevators'], true) : []; |
|||
// validate |
|||
$fail_arr = []; |
|||
if($contractno === '') return $fail_arr[] = '合約號為必填'; |
|||
|
|||
if($total_price == '') $fail_arr[] = '合約總價為必填'; |
|||
if($vat == '') $fail_arr[] = '統一編號為必填'; |
|||
if($mtype == '') $fail_arr[] = '維修型態為必填'; |
|||
if($phone == '') $fail_arr[] = '客戶電話為必填'; |
|||
if($email == '') $fail_arr[] = 'Email為必填'; |
|||
if($mworker == '') $fail_arr[] = '保養員為必填'; |
|||
if($mcycle == '') $fail_arr[] = '保養頻率為必填'; |
|||
if($salesman == '') $fail_arr[] = '營業員為必填'; |
|||
if($contract_begin_date == '') $fail_arr[] = '合約開始時間為必填'; |
|||
if($contract_end_date == '') $fail_arr[] = '合約結束時間為必填'; |
|||
if($address == '') $fail_arr[] = '地址為必填'; |
|||
if($area == '') $fail_arr[] = '區域為必填'; |
|||
if($customer == '') $fail_arr[] = '客戶為必填'; |
|||
if($partyA == '') $fail_arr[] = '業務聯繫人為必填'; |
|||
if($partyAaddress == '') $fail_arr[] = '業務聯繫人地址為必填'; |
|||
if($partyAphone == '') $fail_arr[] = '業務聯繫人電話為必填'; |
|||
if($partyAemail == '') $fail_arr[] = '業務聯繫人Email為必填'; |
|||
if($num == '') $fail_arr[] = '電梯數量為必填'; |
|||
if(count($fail_arr) > 0) { |
|||
header("HTTP/1.1 422 Unprocessable Entity"); |
|||
echo json_encode($fail_arr); |
|||
exit(); |
|||
} |
|||
|
|||
//create account table |
|||
$accounttype = "A"; |
|||
$accountid = $vat; |
|||
$pwd = "123"; |
|||
$name = $partyA; |
|||
$tel = $phone ?? ''; |
|||
$repairerid = $mworker; |
|||
$creater = $user_id; |
|||
$create_at = date('Y-m-d H:i:s'); |
|||
|
|||
$conn->beginTransaction(); |
|||
|
|||
$sql_str = "INSERT INTO account (accounttype, accountid, pwd, name, tel, address, email, repairerid, creater, create_at) VALUES (:accounttype, :accountid, :pwd, :name, :tel, :address, :email, :repairerid, :creater, :create_at)"; |
|||
$stmt = $conn -> prepare($sql_str); |
|||
$stmt -> bindParam(':accounttype' ,$accounttype); |
|||
$stmt -> bindParam(':accountid' ,$accountid); |
|||
$stmt -> bindParam(':pwd' ,$pwd); |
|||
$stmt -> bindParam(':name' ,$name); |
|||
$stmt -> bindParam(':tel' ,$tel); |
|||
$stmt -> bindParam(':address' ,$address); |
|||
$stmt -> bindParam(':email' ,$email); |
|||
$stmt -> bindParam(':repairerid' ,$repairerid); |
|||
$stmt -> bindParam(':creater' ,$creater); |
|||
$stmt -> bindParam(':create_at' ,$create_at); |
|||
$stmt -> execute(); |
|||
|
|||
//create contract table |
|||
|
|||
$contracttype = $mtype; |
|||
$company = $partyA; |
|||
$taxid = $vat; |
|||
$tel = $phone; |
|||
$promiser = $partyA; |
|||
$contractperson = $partyA; |
|||
|
|||
$contractaddress = $address; |
|||
$contracttel = $phone; |
|||
$contractemail = $email; |
|||
$contract_employee = $salesman; |
|||
$start_date = $contract_begin_date; |
|||
$end_date = $contract_end_date; |
|||
|
|||
$sql_str = "INSERT INTO contract (contracttype, contractno, company, taxid, address, tel, promiser, contractperson, contractaddress, contracttel, contractemail, contract_employee, start_date, end_date, creater, create_at) VALUES (:contracttype, :contractno, :company, :taxid, :address, :tel, :promiser, :contractperson, :contractaddress, :contracttel, :contractemail, :contract_employee, :start_date, :end_date, :creater, :create_at)"; |
|||
$stmt = $conn -> prepare($sql_str); |
|||
$stmt -> bindParam(':contracttype' ,$contracttype); |
|||
$stmt -> bindParam(':contractno' ,$contractno); |
|||
$stmt -> bindParam(':company' ,$company); |
|||
$stmt -> bindParam(':taxid' ,$taxid); |
|||
$stmt -> bindParam(':address' ,$address); |
|||
$stmt -> bindParam(':tel' ,$tel); |
|||
$stmt -> bindParam(':promiser' ,$promiser); |
|||
$stmt -> bindParam(':contractperson' ,$contractperson); |
|||
$stmt -> bindParam(':contractaddress' ,$contractaddress); |
|||
$stmt -> bindParam(':contracttel' ,$contracttel); |
|||
$stmt -> bindParam(':contractemail' ,$contractemail); |
|||
$stmt -> bindParam(':contract_employee' ,$contract_employee); |
|||
$stmt -> bindParam(':start_date' ,$start_date); |
|||
$stmt -> bindParam(':end_date' ,$end_date); |
|||
$stmt -> bindParam(':creater' ,$creater); |
|||
$stmt -> bindParam(':create_at' ,$create_at); |
|||
$stmt -> execute(); |
|||
|
|||
//create facility table |
|||
$createFacilityNo = new CreateFacilityNo(); |
|||
$dailyNecessities = [ |
|||
'MAE100'=>'X', |
|||
'MAM200'=>'W', |
|||
'MAH100'=>'H', |
|||
'MAQ100'=>'Z', |
|||
'MAF100'=>'F', |
|||
'MAZ100'=>'B', |
|||
]; |
|||
$facility_arr = []; |
|||
foreach($elevators as $elevator){ |
|||
$facility_arr[] = $dailyNecessities[$elevator['spec']]; |
|||
} |
|||
echo json_encode($facility_arr); |
|||
$facilityno = $createFacilityNo->makeBFacilityNo("T", $facility_arr, (int)$num); |
|||
echo json_encode($facilityno); |
|||
echo '-------'; |
|||
$sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':accountid',$mworker); |
|||
$stmt->execute(); |
|||
$worker = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
$customerid = $vat; |
|||
$define = "B"; |
|||
$repairtype = $mtype; |
|||
$repairerid = $mworker; |
|||
$repairername = $worker['name']; |
|||
foreach($elevators as $idx=>$elevator){ |
|||
$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)"; |
|||
$stmt = $conn -> prepare($sql_str); |
|||
$stmt -> bindParam(':contractno' ,$contractno); |
|||
$stmt -> bindParam(':define' ,$define); |
|||
$stmt -> bindParam(':facilityno' ,$facilityno[$idx]); |
|||
$stmt -> bindParam(':latitude' ,$elevator['latitude']); |
|||
$stmt -> bindParam(':longitude' ,$elevator['longitude']); |
|||
$stmt -> bindParam(':customerid' ,$customerid); |
|||
$stmt -> bindParam(':weight' ,$elevator['weight']); |
|||
$stmt -> bindParam(':numberofpassenger' ,$elevator['persons']); |
|||
$stmt -> bindParam(':numberofstop' ,$elevator['stop']); |
|||
$stmt -> bindParam(':numberoffloor' ,$elevator['floors']); |
|||
$stmt -> bindParam(':opentype' ,$elevator['opendoor']); |
|||
$stmt -> bindParam(':speed' ,$elevator['speed']); |
|||
$stmt -> bindParam(':repairtype' ,$repairtype); |
|||
$stmt -> bindParam(':maintainance' ,$elevator['maintainance']); |
|||
$stmt -> bindParam(':facility_kind' ,$elevator['spec']); |
|||
$stmt -> bindParam(':address' ,$address); |
|||
$stmt -> bindParam(':repairerid' ,$repairerid); |
|||
$stmt -> bindParam(':repairername' ,$repairername); |
|||
$stmt -> bindParam(':creater' ,$creater); |
|||
$stmt -> bindParam(':create_at' ,$create_at); |
|||
$stmt -> bindParam(':area' ,$area); |
|||
$stmt -> bindParam(':takecertificatedate' ,$elevator['takecertificatedate']); |
|||
$stmt -> bindParam(':licensedate' ,$elevator['useful_date']); |
|||
$result = $stmt -> execute(); |
|||
} |
|||
|
|||
//create schedule table |
|||
|
|||
$comboNo = new CreateComboNo($mcycle, $contract_begin_date, $contract_end_date); |
|||
$comboArr = json_decode($comboNo->getComboNo(), true); |
|||
foreach($facilityno as $no){ |
|||
foreach($comboArr as $combo){ |
|||
$sql_str = 'INSERT INTO schedule (contractno, facilityno, combono, repairerid, repairername, duedate, creater, create_at) VALUES (:contractno, :facilityno, :combono, :repairerid, :repairername, :duedate, :creater, :create_at)'; |
|||
$stmt = $conn -> prepare($sql_str); |
|||
$stmt -> bindParam(':contractno' ,$contractno); |
|||
$stmt -> bindParam(':facilityno' ,$no); |
|||
$stmt -> bindParam(':combono' ,$combo[0]); |
|||
$stmt -> bindParam(':repairerid' ,$repairerid); |
|||
$stmt -> bindParam(':repairername' ,$repairername); |
|||
$stmt -> bindParam(':duedate' ,$combo[1]); |
|||
$stmt -> bindParam(':creater' ,$creater); |
|||
$stmt -> bindParam(':create_at' ,$create_at); |
|||
$result = $stmt -> execute(); |
|||
} |
|||
} |
|||
// create contract_b_signed_back table |
|||
$contract_type = $mtype; |
|||
$company = $customer; |
|||
$customer_no = $vat; |
|||
$salesperson = $salesman; |
|||
$customer_phone = $phone; |
|||
$customer_email = $email; |
|||
$repairman = $mworker; |
|||
$cycle = $mcycle; |
|||
$contact_person = $partyA; |
|||
$contact_address = $partyAaddress; |
|||
$contact_phone = $partyAphone; |
|||
$contract_email = $partyAemail; |
|||
$elevators_number = $num; |
|||
$bonus = 1000; |
|||
$max_bonus = 2000; |
|||
|
|||
if(!empty($files)){ |
|||
$englisharr = range('a', 'z'); |
|||
$file = $_FILES['files']; |
|||
$file_name = $file['name']; |
|||
$file_type = $file['type']; |
|||
$tmp_name = $file['tmp_name']; |
|||
$file_size = $file['size']; |
|||
$error = $file['error']; |
|||
$newfiles = []; |
|||
foreach( $files as $file ){ |
|||
$i = 0; //新陣列的索引編號 |
|||
foreach( $file as $key => $val ){ |
|||
$newfiles[$i]['name'] = $files['name'][$key]; |
|||
$newfiles[$i]['type'] = $files['type'][$key]; |
|||
$newfiles[$i]['tmp_name'] = $files['tmp_name'][$key]; |
|||
$newfiles[$i]['error'] = $files['error'][$key]; |
|||
$newfiles[$i]['size'] = $files['size'][$key]; |
|||
$i++; |
|||
} //foreach 第2層 end |
|||
} |
|||
$max_size = 4096*4096; //設定允許上傳檔案容量的最大值(1M) |
|||
$allow_ext = array('jpeg', 'jpg', 'png','JPG','JPEG','PNG','GIF'); //設定允許上傳檔案的類型 |
|||
$path = '../images/contracts/'; |
|||
if (!file_exists($path)) { mkdir($path); } |
|||
$msg_result = ''; //負責接收所有檔案檢測後的回傳訊息 |
|||
$datetime = (string)date('YmdHis'); |
|||
$files_id = 'b' . $datetime; // 保養=>b + 日期時間 |
|||
foreach( $newfiles as $key => $file ){ |
|||
$randNum = rand(1000,9999); |
|||
$randEnglish = $englisharr[rand(0,25)]; |
|||
$file_name = 'b' . (string)date('YmdHis') . $randNum . $randEnglish . $randNum.$file['name']; |
|||
$msg = upload_chk( $file,$path, $max_size, $allow_ext, $file_name ); |
|||
if($msg==1){ |
|||
$msg = '檔案傳送成功!'; |
|||
$sql_str = "INSERT INTO contract_back_files (files_id, file_name, file_mime, file_size, created_at, created_by) VALUES (:files_id, :file_name, :file_mime, :file_size, :created_at, :created_by)"; |
|||
$stmt = $conn -> prepare($sql_str); |
|||
$stmt -> bindParam(':files_id' ,$files_id); |
|||
$stmt -> bindParam(':file_name' ,$file_name); |
|||
$stmt -> bindParam(':file_mime' ,$file['type']); |
|||
$stmt -> bindParam(':file_size' ,$file['size']); |
|||
$stmt -> bindParam(':created_at' ,$created_at); |
|||
$stmt -> bindParam(':created_by' ,$user_id); |
|||
$stmt ->execute(); |
|||
} |
|||
$msg_result .= '第' . ($key+1) . '個上傳檔案的結果:' . $msg . '<br/>'; |
|||
$src_name = $path.$file['name']; |
|||
if( file_exists($src_name) ){ |
|||
//副檔名 |
|||
$extname = pathinfo($src_name, PATHINFO_EXTENSION); |
|||
//主檔名 |
|||
$basename = basename($src_name, '.'.$extname); |
|||
} |
|||
|
|||
} |
|||
}else{ |
|||
$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 -> bindParam(":contract_no",$contractno); |
|||
$stmt -> bindParam(":contract_type",$contract_type); |
|||
$stmt -> bindParam(":company",$company); |
|||
$stmt -> bindParam(":customer_no",$customer_no); |
|||
$stmt -> bindParam(":salesperson",$salesperson); |
|||
$stmt -> bindParam(":contract_start_date",$contract_begin_date); |
|||
$stmt -> bindParam(":contract_end_date",$contract_end_date); |
|||
$stmt -> bindParam(":total_price",$total_price); |
|||
$stmt -> bindParam(":customer_phone",$customer_phone); |
|||
$stmt -> bindParam(":customer_email",$customer_email); |
|||
$stmt -> bindParam(":repairman",$repairman); |
|||
$stmt -> bindParam(":cycle",$cycle); |
|||
$stmt -> bindParam(":contact_person",$contact_person); |
|||
$stmt -> bindParam(":contact_address",$contact_address); |
|||
$stmt -> bindParam(":contact_phone",$contact_phone); |
|||
$stmt -> bindParam(":contact_email",$contact_email); |
|||
$stmt -> bindParam(":elevators_number",$elevators_number); |
|||
$stmt -> bindParam(":area",$area); |
|||
$stmt -> bindParam(":address",$address); |
|||
$stmt -> bindParam(":files_id",$files_id); |
|||
$stmt -> bindParam(":bonus",$bonus); |
|||
$stmt -> bindParam(":max_bonus",$max_bonus); |
|||
$stmt -> bindParam(":created_at", $created_at); |
|||
$stmt -> bindParam(":created_by",$user_id); |
|||
|
|||
$stmt -> execute(); |
|||
|
|||
header('Content-Type: application/json'); |
|||
$jsonData = json_encode($files); |
|||
|
|||
$conn->commit(); |
|||
}catch(PDOException $e){ |
|||
$conn->rollback(); |
|||
echo $e->getMessage(); |
|||
die('Error!:'.$e->getMessage()); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,68 @@ |
|||
<?php |
|||
require_once("../conn.php"); |
|||
ini_set ( 'date.timezone' , 'Asia/Taipei' ); |
|||
if(isset($_POST['vol_no']) && !empty($_POST['vol_no'])){ |
|||
$mid = $_POST['mid']; |
|||
$vol_no = $_POST['vol_no']; |
|||
$salesman = $_POST['salesman']; |
|||
$apply_date = $_POST['apply_date']; |
|||
$apply_type = $_POST['apply_type']; |
|||
$case_name = $_POST['case_name']; |
|||
$customer = $_POST['company']; |
|||
$manager = $_POST['manager']; |
|||
$vat = $_POST['vat']; |
|||
$total_price = $_POST['total_price']; |
|||
$buy_fee = $_POST['price_a']; |
|||
$install_fee = $_POST['price_b']; |
|||
$contact_address = $_POST['address']; |
|||
$workdeadline_a = $_POST['workdeadline_a']; |
|||
$workdeadline_b = $_POST['workdeadline_b']; |
|||
$test_time = $_POST['regulations']; |
|||
$freedeadline = $_POST['freedeadline']; |
|||
$trade_address = $_POST['tradeaddress']; |
|||
$tradedeadline = $_POST['tradedeadline']; |
|||
$progress = 0; |
|||
$status = 0; |
|||
$created_at = date('Y-m-d H:i:s'); |
|||
$created_by = $_POST['user_id']; |
|||
$isFirst = $_POST['isFirst']; |
|||
$conn->beginTransaction(); |
|||
try{ |
|||
if($isFirst == 1){ |
|||
$sql_str = "INSERT INTO contract_new_apply (mid, contractno, sales_man, apply_date, apply_type, case_name, customer, manager, vat, total_price, buy_fee, install_fee, contact_address, workdeadline_a, workdeadline_b, test_time, freedeadline, trade_address, tradedeadline, progress, status, created_at, created_by) VALUES (:mid, :contractno, :sales_man, :apply_date, :apply_type, :case_name, :customer, :manager, :vat, :total_price, :buy_fee, :install_fee, :contact_address, :workdeadline_a, :workdeadline_b, :test_time, :freedeadline, :trade_address, :tradedeadline, :progress, :status, :created_at, :created_by)"; |
|||
$stmt = $conn -> prepare($sql_str); |
|||
$stmt ->bindParam(':mid', $mid); |
|||
$stmt ->bindParam(':contractno', $vol_no); |
|||
$stmt ->bindParam(':sales_man', $salesman); |
|||
$stmt ->bindParam(':apply_date', $apply_date); |
|||
$stmt ->bindParam(':apply_type', $apply_type); |
|||
$stmt ->bindParam(':case_name', $case_name); |
|||
$stmt ->bindParam(':customer', $customer); |
|||
$stmt ->bindParam(':manager', $manager); |
|||
$stmt ->bindParam(':vat', $vat); |
|||
$stmt ->bindParam(':total_price', $total_price); |
|||
$stmt ->bindParam(':buy_fee', $buy_fee); |
|||
$stmt ->bindParam(':install_fee', $install_fee); |
|||
$stmt ->bindParam(':contact_address', $contact_address); |
|||
$stmt ->bindParam(':workdeadline_a', $workdeadline_a); |
|||
$stmt ->bindParam(':workdeadline_b', $workdeadline_b); |
|||
$stmt ->bindParam(':test_time', $test_time); |
|||
$stmt ->bindParam(':freedeadline', $freedeadline); |
|||
$stmt ->bindParam(':trade_address', $trade_address); |
|||
$stmt ->bindParam(':tradedeadline', $tradedeadline); |
|||
$stmt ->bindParam(':progress', $progress); |
|||
$stmt ->bindParam(':status', $status); |
|||
$stmt ->bindParam(':created_at', $created_at); |
|||
$stmt ->bindParam(':created_by', $created_by); |
|||
$stmt ->execute(); |
|||
header("HTTP/1.1 201 success!"); |
|||
$conn->commit(); |
|||
} |
|||
}catch(PDOException $e){ |
|||
$conn->rollback(); |
|||
echo $e->getMessage(); |
|||
die('Error!:'.$e->getMessage()); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,139 @@ |
|||
<?php |
|||
require_once("../conn.php"); |
|||
include_once("./getFacilityNo.php"); |
|||
include_once("./getComboNo.php"); |
|||
include_once("./upload_chk.php"); |
|||
ini_set ( 'date.timezone' , 'Asia/Taipei' ); |
|||
|
|||
if($_SERVER['REQUEST_METHOD'] != 'POST'){ |
|||
exit(); |
|||
} |
|||
//新梯簽回 |
|||
if(isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['contracttype']) && $_POST['contracttype'] == 'm') { |
|||
try{ |
|||
$created_at = date('Y-m-d H:i:s'); |
|||
$created_by = $_POST["user_id"]; |
|||
$contractno = $_POST["contractno"]; |
|||
$customer = $_POST["customer"]; |
|||
$manager = $_POST["manager"]; |
|||
$vat = $_POST["vat"]; |
|||
$case_name = $_POST["case_name"]; |
|||
$linkman = $_POST["linkman"]; |
|||
$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; |
|||
|
|||
$fail_arr = []; |
|||
if(empty($contractno)) $fail_arr[] = '合約號為必填'; |
|||
if(empty($customer)) $fail_arr[] = '客戶名稱為必填'; |
|||
if(empty($manager)) $fail_arr[] = '負責人為必填'; |
|||
if(empty($vat)) $fail_arr[] = '統編/身分證為必填'; |
|||
if(empty($case_name)) $fail_arr[] = '案名為必填'; |
|||
if(empty($linkman)) $fail_arr[] = '聯絡人為必填'; |
|||
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); |
|||
exit(); |
|||
} |
|||
|
|||
|
|||
$conn->beginTransaction(); |
|||
|
|||
$sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid ORDER BY create_at DESC"; |
|||
$stmt = $conn -> prepare($sql_str); |
|||
$stmt -> bindParam(":accountid",$salesman); |
|||
$stmt -> execute(); |
|||
$saleman = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
$salesman_name = $saleman['name']; |
|||
if(!empty($files)){ |
|||
$englisharr = range('a', 'z'); |
|||
$files = $_FILES['files']; |
|||
$newfiles = []; |
|||
foreach( $files as $file ){ |
|||
$i = 0; //新陣列的索引編號 |
|||
foreach( $file as $key => $val ){ |
|||
$newfiles[$i]['name'] = $files['name'][$key]; |
|||
$newfiles[$i]['type'] = $files['type'][$key]; |
|||
$newfiles[$i]['tmp_name'] = $files['tmp_name'][$key]; |
|||
$newfiles[$i]['error'] = $files['error'][$key]; |
|||
$newfiles[$i]['size'] = $files['size'][$key]; |
|||
$i++; |
|||
} //foreach 第2層 end |
|||
} |
|||
$max_size = 4096*4096; //設定允許上傳檔案容量的最大值(1M) |
|||
$allow_ext = array('jpeg', 'jpg', 'png','JPG','JPEG','PNG','GIF'); //設定允許上傳檔案的類型 |
|||
$path = '../images/contracts/'; |
|||
if (!file_exists($path)) { mkdir($path); } |
|||
$msg_result = ''; //負責接收所有檔案檢測後的回傳訊息 |
|||
$datetime = (string)date('YmdHis'); |
|||
$files_id = 'm' . $datetime; // 保養=>b + 日期時間 |
|||
foreach( $newfiles as $key => $file ){ |
|||
$randNum = rand(1000,9999); |
|||
$randEnglish = $englisharr[rand(0,25)]; |
|||
$file_name = 'm' . (string)date('YmdHis') . $randNum . $randEnglish . $randNum.$file['name']; |
|||
$msg = upload_chk( $file,$path, $max_size, $allow_ext, $file_name ); |
|||
if($msg==1){ |
|||
$msg = '檔案傳送成功!'; |
|||
$sql_str = "INSERT INTO contract_back_files (files_id, file_name, file_mime, file_size, created_at, created_by) VALUES (:files_id, :file_name, :file_mime, :file_size, :created_at, :created_by)"; |
|||
$stmt = $conn -> prepare($sql_str); |
|||
$stmt -> bindParam(':files_id' ,$files_id); |
|||
$stmt -> bindParam(':file_name' ,$file_name); |
|||
$stmt -> bindParam(':file_mime' ,$file['type']); |
|||
$stmt -> bindParam(':file_size' ,$file['size']); |
|||
$stmt -> bindParam(':created_at' ,$created_at); |
|||
$stmt -> bindParam(':created_by' ,$created_by); |
|||
$stmt ->execute(); |
|||
}else{ |
|||
throw new PDOException('檔案上傳失敗:' . $msg); |
|||
} |
|||
$msg_result .= '第' . ($key+1) . '個上傳檔案的結果:' . $msg . '<br/>'; |
|||
$src_name = $path.$file['name']; |
|||
if( file_exists($src_name) ){ |
|||
//副檔名 |
|||
$extname = pathinfo($src_name, PATHINFO_EXTENSION); |
|||
//主檔名 |
|||
$basename = basename($src_name, '.'.$extname); |
|||
} |
|||
} |
|||
}else{ |
|||
$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, 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); |
|||
$stmt -> bindParam(":manager",$manager); |
|||
$stmt -> bindParam(":vat",$vat); |
|||
$stmt -> bindParam(":case_name",$case_name); |
|||
$stmt -> bindParam(":linkman",$linkman); |
|||
$stmt -> bindParam(":lm_tel",$lm_tel); |
|||
$stmt -> bindParam(":address",$address); |
|||
$stmt -> bindParam(":salesman",$salesman); |
|||
$stmt -> bindParam(":salesman_name",$salesman_name); |
|||
$stmt -> bindParam(":files_id",$files_id); |
|||
$stmt -> bindParam(":created_at",$created_at); |
|||
$stmt -> bindParam(":created_by",$created_by); |
|||
$stmt -> bindParam(":qc",$qc); |
|||
$stmt -> execute(); |
|||
|
|||
|
|||
$result = $conn->commit(); |
|||
if($result){ |
|||
header("HTTP/1.1 201 Created"); |
|||
} |
|||
|
|||
}catch(PDOException $e){ |
|||
$conn->rollback(); |
|||
header("HTTP/1.1 500 Internal Server Error"); |
|||
die('Error!:'.$e->getMessage()); |
|||
} |
|||
} |
@ -0,0 +1,135 @@ |
|||
<?php |
|||
require_once("../conn.php"); |
|||
include_once("./upload_chk.php"); |
|||
ini_set ( 'date.timezone' , 'Asia/Taipei' ); |
|||
// echo json_encode(explode(',', $_POST['deletefiles'])); |
|||
if(isset($_POST['contractno']) && $_POST['contractno']!="" && isset($_POST["id"]) && $_POST['id']!=""){ |
|||
try{ |
|||
$created_at = date('Y-m-d H:i:s'); |
|||
$created_by = $_POST['user_id']; |
|||
$id = $_POST["id"]; |
|||
$contract_no = !empty($_POST['contractno']) ? $_POST['contractno'] : null; |
|||
$customer = !empty($_POST['customer']) ? $_POST['customer'] : null; |
|||
$manager = !empty($_POST['manager']) ? $_POST['manager'] : null; |
|||
$vat = !empty($_POST['vat']) ? $_POST['vat'] : null; |
|||
$case_name = !empty($_POST['case_name']) ? $_POST['case_name'] : null; |
|||
$linkman = !empty($_POST['linkman']) ? $_POST['linkman'] : null; |
|||
$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; |
|||
|
|||
$deletefilesArr = explode(',', $_POST['deletefiles']); |
|||
|
|||
$fail_arr = []; |
|||
if(empty($contract_no)) $fail_arr[] = '合約號為必填'; |
|||
if(empty($customer)) $fail_arr[] = '客戶名稱為必填'; |
|||
if(empty($manager)) $fail_arr[] = '負責人為必填'; |
|||
if(empty($vat)) $fail_arr[] = '統編/身分證為必填'; |
|||
if(empty($case_name)) $fail_arr[] = '案名為必填'; |
|||
if(empty($linkman)) $fail_arr[] = '聯絡人為必填'; |
|||
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); |
|||
exit(); |
|||
} |
|||
|
|||
$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, qc_official_type=:qc WHERE id = :id"; |
|||
$stmt = $conn -> prepare($sql_str); |
|||
$stmt -> bindParam(':contract_no' ,$contract_no); |
|||
$stmt -> bindParam(':customer' ,$customer); |
|||
$stmt -> bindParam(':manager' ,$manager); |
|||
$stmt -> bindParam(':vat' ,$vat); |
|||
$stmt -> bindParam(':case_name' ,$case_name); |
|||
$stmt -> bindParam(':linkman' ,$linkman); |
|||
$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)){ |
|||
$sql_str = "DELETE FROM contract_back_files WHERE id IN ($deletefiles)"; |
|||
$stmt = $conn -> prepare($sql_str); |
|||
$stmt -> execute(); |
|||
} |
|||
|
|||
if(!empty($files)){ |
|||
$englisharr = range('a', 'z'); |
|||
$files = $_FILES['files']; |
|||
$newfiles = []; |
|||
foreach( $files as $file ){ |
|||
$i = 0; //新陣列的索引編號 |
|||
foreach( $file as $key => $val ){ |
|||
$newfiles[$i]['name'] = $files['name'][$key]; |
|||
$newfiles[$i]['type'] = $files['type'][$key]; |
|||
$newfiles[$i]['tmp_name'] = $files['tmp_name'][$key]; |
|||
$newfiles[$i]['error'] = $files['error'][$key]; |
|||
$newfiles[$i]['size'] = $files['size'][$key]; |
|||
$i++; |
|||
} //foreach 第2層 end |
|||
} |
|||
$max_size = 4096*4096; //設定允許上傳檔案容量的最大值(1M) |
|||
$allow_ext = array('jpeg', 'jpg', 'png','JPG','JPEG','PNG','GIF'); //設定允許上傳檔案的類型 |
|||
$path = '../images/contracts/'; |
|||
if (!file_exists($path)) { mkdir($path); } |
|||
$msg_result = ''; //負責接收所有檔案檢測後的回傳訊息 |
|||
$datetime = (string)date('YmdHis'); |
|||
$files_id = ($files_id !== null ) ? $files_id : 'm' . $datetime; // 新梯=>m + 日期時間 |
|||
foreach( $newfiles as $key => $file ){ |
|||
$randNum = rand(1000,9999); |
|||
$randEnglish = $englisharr[rand(0,25)]; |
|||
$file_name = 'm' . (string)date('YmdHis') . $randNum . $randEnglish . $randNum.$file['name']; |
|||
$msg = upload_chk( $file,$path, $max_size, $allow_ext, $file_name ); |
|||
if($msg==1){ |
|||
$msg = '檔案傳送成功!'; |
|||
$sql_str = "INSERT INTO contract_back_files (files_id, file_name, file_mime, file_size, created_at, created_by) VALUES (:files_id, :file_name, :file_mime, :file_size, :created_at, :created_by)"; |
|||
$stmt = $conn -> prepare($sql_str); |
|||
$stmt -> bindParam(':files_id' ,$files_id); |
|||
$stmt -> bindParam(':file_name' ,$file_name); |
|||
$stmt -> bindParam(':file_mime' ,$file['type']); |
|||
$stmt -> bindParam(':file_size' ,$file['size']); |
|||
$stmt -> bindParam(':created_at' ,$created_at); |
|||
$stmt -> bindParam(':created_by' ,$created_by); |
|||
$stmt ->execute(); |
|||
}else{ |
|||
throw new PDOException('檔案上傳失敗:' . $msg); |
|||
} |
|||
$msg_result .= '第' . ($key+1) . '個上傳檔案的結果:' . $msg . '<br/>'; |
|||
$src_name = $path.$file['name']; |
|||
if( file_exists($src_name) ){ |
|||
//副檔名 |
|||
$extname = pathinfo($src_name, PATHINFO_EXTENSION); |
|||
//主檔名 |
|||
$basename = basename($src_name, '.'.$extname); |
|||
} |
|||
} |
|||
}else{ |
|||
$files = null; |
|||
} |
|||
|
|||
$conn->commit(); |
|||
}catch(PDOException $e) { |
|||
$conn->rollback(); |
|||
header("HTTP/1.1 500 Internal Server Error"); |
|||
die('Error!:'.$e->getMessage()); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
<?php |
|||
|
|||
function upload_chk( $file, $path, $max_size, $allow_ext, $file_name ){ |
|||
|
|||
$source_file_name = $file['name']; //上傳檔案的原來檔案名稱 |
|||
$file_type = $file['type']; //上傳檔案的類型(副檔名) |
|||
$tmp_name = $file['tmp_name']; //上傳到暫存空間的路徑/檔名 |
|||
$file_size = $file['size']; //上傳檔案的檔案大小(容量) |
|||
$error = $file['error']; //上傳工作傳回的錯誤訊息編號 |
|||
$msg = ''; //負責記錄回傳的訊息 |
|||
|
|||
//1.判斷錯誤編號只有為0時表示沒有錯誤發生,才表示上傳成功 ================= |
|||
if( $error == 0 ){ |
|||
|
|||
//取得檔案延伸的副檔名, 以下函數可以取得檔案延伸的副檔名 |
|||
//pathinfo(上傳檔案的原來檔案名稱, PATHINFO_EXTENSION) |
|||
$ext = pathinfo($source_file_name, PATHINFO_EXTENSION); |
|||
$ext = strtolower($ext); //將延伸的副檔名轉小寫 |
|||
|
|||
//2.判斷上傳檔案的大小 ==================================== |
|||
if( $file_size > $max_size ){ |
|||
//當目前檔案容量超過容量限制時, 以下準備顯示的資訊 |
|||
if( $max_size >= 4096*4096 ){ |
|||
$max_size /= (4096*4096); |
|||
$max_size .= 'M'; |
|||
}elseif( $max_size >= 4096 ){ |
|||
$max_size /= 4096; |
|||
$max_size .= 'K'; |
|||
} |
|||
$msg ='上傳檔案過大,請選擇容量小於 '.$max_size.' 的檔案'; |
|||
|
|||
//3.判斷檔案類型 =========================================== |
|||
//in_array($ext, $allow_ext) 判斷 $ext變數的值 是否在 $allow_ext 這個陣列變數中 |
|||
}elseif( !in_array( $ext, $allow_ext ) ){ |
|||
$allow_str = ''; //準備將允許檔案類型的陣列內容, 組合成字串 |
|||
foreach( $allow_ext as $key=>$value ){ |
|||
//if的縮寫語法:條件?成立執行的工作:不成立執行的工作; |
|||
$key==0? $allow_str.= $value : $allow_str.=', '.$value; |
|||
} |
|||
$msg = '檔案類型不符合,請選擇 '.$allow_str.' 檔案'; |
|||
|
|||
//4.以上條件都沒問題的話, 則進行最後else中的工作=============== |
|||
}else{ |
|||
//搬移檔案 move_uploaded_file(要搬移的檔案, 目的地位置及目的檔案名稱), 成功傳回true(1) |
|||
$msg = @move_uploaded_file($tmp_name, $path.$file_name); |
|||
} |
|||
}else{ |
|||
//這裡表示上傳有錯誤, 匹配錯誤編號顯示對應的訊息 ====================================== |
|||
switch ($error) { |
|||
case 1: $msg = '上傳檔案超過 upload_max_filesize 容量最大值'; break; |
|||
case 2: $msg = '上傳檔案超過 post_max_size 總容量最大值'; break; |
|||
case 3: $msg = '檔案只有部份被上傳'; break; |
|||
case 4: $msg = '沒有檔案被上傳'; break; |
|||
case 6: $msg = '找不到主機端暫存檔案的目錄位置'; break; |
|||
case 7: $msg = '檔案寫入失敗'; break; |
|||
case 8: $msg = '上傳檔案被PHP程式中斷,表示主機端系統錯誤'; break; |
|||
} |
|||
} //if( $error == 0 ){ ..... end |
|||
|
|||
return $msg; //回傳$msg的結果 |
|||
} |
@ -0,0 +1,43 @@ |
|||
<?php |
|||
$envFile = __DIR__ . '/.env'; // .env 文件的路径 |
|||
|
|||
if (file_exists($envFile)) { |
|||
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|||
if ($lines !== false) { |
|||
foreach ($lines as $line) { |
|||
list($key, $value) = explode('=', $line, 2); |
|||
$key = trim($key); |
|||
$value = trim($value); |
|||
// 设置环境变量 |
|||
putenv("$key=$value"); |
|||
} |
|||
} |
|||
} |
|||
$db_hostname = getenv('DB_HOST'); //資料庫主機名稱 |
|||
$db_username = getenv('DB_USERNAME'); //登入資料庫的管理者的帳號 |
|||
$db_password = getenv('DB_PASSWORD'); //登入密碼 |
|||
$db_name = getenv('DB_DATABASE'); //使用的資料庫 |
|||
$db_charset = 'utf8'; //設定字元編碼 |
|||
|
|||
//建立PDO的指定工作 |
|||
$dsn = "mysql:host=$db_hostname;dbname=$db_name;charset=$db_charset"; |
|||
|
|||
try{ |
|||
//使用PDO連接到MySQL資料庫,建立PDO物件 |
|||
$conn = new PDO($dsn, $db_username, $db_password); |
|||
|
|||
//當錯誤發生時會將錯誤資訊放到一個類物件裡(PDOException) |
|||
//PDO異常處理,PDO::ATTR_ERRMODE,有以下三種值的設定 |
|||
//PDO::ERRMODE_SILENT: 預設模式,不主動報錯,需要以$conn->errorInfo()的形式獲取錯誤資訊 |
|||
//PDO::ERRMODE_WARNING: 引發 E_WARNING 錯誤,主動報錯 |
|||
//PDO::ERRMODE_EXCEPTION: 主動抛出 exceptions 異常,需要以try{}cath(){}輸出錯誤資訊。 |
|||
//設定主動以警告的形式報錯 |
|||
$conn->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); |
|||
//如果連接錯誤,將抛出一個PDOException異常對象 |
|||
} |
|||
catch ( PDOException $e ){ |
|||
//如果連結資料庫失敗則顯示錯誤訊並停止本頁的工作 |
|||
die("ERROR!!!: ". $e->getMessage()); |
|||
} |
|||
|
|||
//$conn = null; //關閉資料庫的連線 |
@ -0,0 +1,351 @@ |
|||
<?php |
|||
include("../header.php"); |
|||
require_once("./conn.php"); |
|||
include_once("./api/getFacilityNo.php"); |
|||
$accounttype = "B"; |
|||
$sql_str = "SELECT accountid, name FROM account WHERE accounttype = :accounttype"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':accounttype',$accounttype); |
|||
$stmt->execute(); |
|||
$workers = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
$accounttype = "M"; |
|||
$sql_str = "SELECT id,accountid, name FROM account WHERE accounttype = :accounttype"; |
|||
$stmt = $conn->prepare($sql_str); |
|||
$stmt->bindParam(':accounttype',$accounttype); |
|||
$stmt->execute(); |
|||
$contractpersons = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|||
?> |
|||
<link rel="stylesheet" href="./styles/style.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="./js/alpinejs/cdn.min.js"></script> |
|||
<script src="./js/axios/axios.min.js" ></script> |
|||
|
|||
<div class="contract-input-component" x-data="contractRepair"> |
|||
<div class="form" method="post" id="form" enctype="multipart/form-data" > |
|||
<input type="hidden" name='form_name' value="main_form" /> |
|||
<div> |
|||
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%"> |
|||
<thead> |
|||
<tr> |
|||
<td colspan="8"> |
|||
<h3 style='text-align:center'>合約入力(修理)</h3> |
|||
</td> |
|||
</tr> |
|||
</thead> |
|||
<template x-if="step==1"> |
|||
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==1"> |
|||
<tr> |
|||
<td style="vertical-align: middle">合約號</td> |
|||
<td colspan="5"> |
|||
<input class="form-control" @keyup="nextStepKeyupFn($event)" type="text" name="contractno" x-model="data.contractno" > |
|||
|
|||
</td> |
|||
<td colspan="2" style="vertical-align: middle"> |
|||
<label for="customize"> |
|||
<input type="checkbox" x-model="customize" id="customize" />自定義欄位 |
|||
</label> |
|||
</td> |
|||
|
|||
</tr> |
|||
</tbody> |
|||
</template> |
|||
<template x-if="step==2"> |
|||
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==2"> |
|||
<tr> |
|||
<td colspan="7" style='vertical-align: middle;border-right:0px;'> |
|||
<h4>業務確認項</h4> |
|||
</td> |
|||
<td class="text-right" style='border-left:0px;'> |
|||
<button type="button" id="btn_close" class="btn btn-default" onclick="window.history.back();">返回</button> |
|||
<button type="button" id="btn_close" class="btn btn-default" onclick="window.close();">關閉分頁</button> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="vertical-align: middle">立約人</td> |
|||
<td> |
|||
<input type="text" x-model="data.customer" /> |
|||
<p class="alerttext" x-show="data.customer==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">營業員</td> |
|||
<td> |
|||
<select class="ui fluid search dropdown" name="promiser" x-model="data.salesman"> |
|||
<option value="">選擇營業員</option> |
|||
<?php foreach($contractpersons as $person){ ?> |
|||
<option value="<?php echo $person['accountid'] ?>"><?php echo $person['name'] ?></option> |
|||
<?php } ?> |
|||
</select> |
|||
<p class="alerttext" x-show="data.salesman==''"><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" name="start_date" x-model="data.contract_begin_date" > |
|||
<p class="alerttext" x-show="data.contract_begin_date==''"><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" name="end_date" x-model="data.contract_end_date" > |
|||
<p class="alerttext" x-show="data.contract_end_date==''"><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="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> |
|||
</td> |
|||
|
|||
<td style="vertical-align: middle">統一編號/身分證</td> |
|||
<td> |
|||
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.vat" > |
|||
<p class="alerttext" x-show="data.vat==''"><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="" x-model="data.mtype"> |
|||
<option value="" >選擇維修型態</option> |
|||
<option value="A">定期保養</option> |
|||
</select> |
|||
<p class="alerttext" x-show="data.mtype==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td></td> |
|||
<td></td> |
|||
</tr> |
|||
<tr> |
|||
<td style="vertical-align: middle">客戶電話</td> |
|||
<td> |
|||
<input class="form-control disabled_select" type="text" name="tel" x-model="data.phone" > |
|||
<p class="alerttext" x-show="data.phone==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">Email</td> |
|||
<td style="vertical-align: middle"> |
|||
<input class="form-control disabled_select" type="email" name="email" x-model="data.email" > |
|||
<p class="alerttext" x-show="data.email==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">保養員</td> |
|||
<td> |
|||
<select class="ui search dropdown" name="repairer_name" x-model="data.mworker"> |
|||
<option value="">選擇保養員</option> |
|||
<?php foreach($workers as $worker){ ?> |
|||
<option value="<?php echo $worker['accountid']; ?>"><?php echo $worker['name'] ?></option> |
|||
<?php } ?> |
|||
</select> |
|||
<p class="alerttext" x-show="data.mworker==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">保養頻率</td> |
|||
<td> |
|||
<select class="ui search dropdown" name="repairer_name" x-model="data.mcycle"> |
|||
<option value="">選擇保養頻率</option> |
|||
<option value="bw">雙週保</option> |
|||
<option value="em">月保</option> |
|||
</select> |
|||
<p class="alerttext" x-show="data.mcycle==''"><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.partyA" name="partyA" /> |
|||
<p class="alerttext" x-show="data.partyA==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">業務聯繫人地址</td> |
|||
<td> |
|||
<input class="form-control disabled_select" x-model="data.partyAaddress" type="text" name="contractaddress" value="" > |
|||
<p class="alerttext" x-show="data.partyAaddress==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">業務聯繫人電話</td> |
|||
<td> |
|||
<input class="form-control disabled_select" type="text" name="contracttel" x-model="data.partyAphone" > |
|||
<p class="alerttext" x-show="data.partyAphone==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> |
|||
</td> |
|||
<td style="vertical-align: middle">業務聯繫人Email</td> |
|||
<td> |
|||
<input class="form-control disabled_select" type="email" name="contracttel" x-model="data.partyAemail" > |
|||
<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="2"> |
|||
<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 colspan="2"> |
|||
<input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" /> |
|||
</td> |
|||
</tr> |
|||
|
|||
<tr> |
|||
|
|||
</tr> |
|||
</tbody> |
|||
</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=='' || !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=='' || !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].elevator_brand" class="form-control" /> |
|||
<p class="alerttext" x-show="data.elevators[idx].elevator_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="" 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=='' || !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=='' || !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=='' || !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].useful_date"> |
|||
<p class="alerttext" x-show="data.elevators[idx].useful_date=='' || !data.elevators[idx].useful_date"><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> |
|||
</table> |
|||
|
|||
|
|||
<button x-show="step==3" @click="save()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn"> |
|||
<template x-if="!isLoading"> |
|||
<span>存檔</span> |
|||
</template> |
|||
<template x-if="isLoading"> |
|||
<div class="loader"></div> |
|||
</template> |
|||
</button> |
|||
<button x-show="step<=2" @click="nextStepFn()" type="button" class="btn btn-primary btn-lg pull-right savebtn" :disabled="isLoading"> |
|||
<template x-if="!isLoading"> |
|||
<span>下一步</span> |
|||
</template> |
|||
<template x-if="isLoading"> |
|||
<div class="loader"></div> |
|||
</template> |
|||
</button> |
|||
<button x-show="step>1" @click="preStepFn()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn"> |
|||
<template x-if="!isLoading"> |
|||
<span>上一步</span> |
|||
</template> |
|||
<template x-if="isLoading"> |
|||
<div class="loader"></div> |
|||
</template> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
<script src="./js/jquery/jquery-3.1.1.min.js"></script> |
|||
<script src="semantic/dist/semantic.min.js" ></script> |
|||
<script src="./js/alpine.js"></script> |
|||
<script> |
|||
const user_id = '<?php echo $user_id; ?>' |
|||
const user_name = '<?php echo $user_name; ?>' |
|||
</script> |
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
@ -0,0 +1,25 @@ |
|||
|
|||
const axiosClient = axios.create({ |
|||
baseURL : `${import.meta.env.VITE_API_BASE_URL}/api`, |
|||
}); |
|||
|
|||
|
|||
axiosClient.interceptors.request.use( (config)=> { |
|||
config.headers.Authorization = `Bearer ${store.state.user.token}` |
|||
return config; |
|||
}, (error)=> { |
|||
return Promise.reject(error); |
|||
}); |
|||
|
|||
axiosClient.interceptors.response.use( (response)=> { |
|||
return response; |
|||
}, (error)=>{ |
|||
if(error.response.status === 401){ |
|||
store.commit('setToken', null) |
|||
sessionStorage.removeItem('TOKEN') |
|||
router.push({name:'login'}) |
|||
} |
|||
throw error; |
|||
}); |
|||
|
|||
export default axiosClient; |
File diff suppressed because one or more lines are too long
@ -0,0 +1,48 @@ |
|||
export default { |
|||
data() { |
|||
return { |
|||
options: [], |
|||
value: [], |
|||
list: [], |
|||
loading: false, |
|||
states: ["Alabama", "Alaska", "Arizona", |
|||
"Arkansas", "California", "Colorado", |
|||
"Connecticut", "Delaware", "Florida", |
|||
"Georgia", "Hawaii", "Idaho", "Illinois", |
|||
"Indiana", "Iowa", "Kansas", "Kentucky", |
|||
"Louisiana", "Maine", "Maryland", |
|||
"Massachusetts", "Michigan", "Minnesota", |
|||
"Mississippi", "Missouri", "Montana", |
|||
"Nebraska", "Nevada", "New Hampshire", |
|||
"New Jersey", "New Mexico", "New York", |
|||
"North Carolina", "North Dakota", "Ohio", |
|||
"Oklahoma", "Oregon", "Pennsylvania", |
|||
"Rhode Island", "South Carolina", |
|||
"South Dakota", "Tennessee", "Texas", |
|||
"Utah", "Vermont", "Virginia", |
|||
"Washington", "West Virginia", "Wisconsin", |
|||
"Wyoming"] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.list = this.states.map(item => { |
|||
return { value: `value:${item}`, label: `label:${item}` }; |
|||
}); |
|||
}, |
|||
methods: { |
|||
remoteMethod(query) { |
|||
if (query !== '') { |
|||
this.loading = true; |
|||
setTimeout(() => { |
|||
this.loading = false; |
|||
this.options = this.list.filter(item => { |
|||
return item.label.toLowerCase() |
|||
.indexOf(query.toLowerCase()) > -1; |
|||
}); |
|||
}, 200); |
|||
} else { |
|||
this.options = []; |
|||
} |
|||
} |
|||
} |
|||
} |
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,692 @@ |
|||
@charset "UTF-8"; |
|||
main { |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
margin-top: -20px; |
|||
} |
|||
main [x-cloak] { |
|||
display: none !important; |
|||
} |
|||
main > .sidebar { |
|||
width: 300px; |
|||
min-height: 100vh; |
|||
border-right: 1px #ddd solid; |
|||
box-shadow: 0px 0px 5px #ddd; |
|||
padding: 50px 20px; |
|||
} |
|||
main > .sidebar button { |
|||
display: block; |
|||
outline: none; |
|||
border: none; |
|||
color: #1E74FD; |
|||
background-color: transparent; |
|||
margin-bottom: 20px; |
|||
border-bottom: 1px #ccc solid; |
|||
opacity: 0.65; |
|||
} |
|||
main > .sidebar button.active { |
|||
opacity: 1; |
|||
} |
|||
main > .sidebar button:hover { |
|||
opacity: 1; |
|||
} |
|||
main > .sidebar a { |
|||
display: block; |
|||
width: 120px; |
|||
height: 35px; |
|||
text-align: center; |
|||
line-height: 35px; |
|||
text-decoration: none; |
|||
background-color: #1E74FD; |
|||
color: #fff; |
|||
margin-top: 50px; |
|||
} |
|||
main .inputDiv { |
|||
padding: 30px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
} |
|||
main .inputDiv label { |
|||
margin-bottom: 10px; |
|||
} |
|||
main .inputDiv label input, main .inputDiv label select { |
|||
border: 1px #aaa solid; |
|||
outline: none; |
|||
border-radius: 5px; |
|||
width: 220px; |
|||
height: 32px; |
|||
padding: 0 10px; |
|||
} |
|||
main .inputDiv label button { |
|||
background-color: #1E74FD; |
|||
color: #fff; |
|||
outline: none; |
|||
border: none; |
|||
border: 1px #ccc solid; |
|||
width: 220px; |
|||
height: 32px; |
|||
font-weight: 6500; |
|||
margin-top: 15px; |
|||
} |
|||
main .contract-install-component, main .contract-material-component { |
|||
width: 100%; |
|||
max-width: 816px; |
|||
margin: 30px auto; |
|||
background-color: #f7f7f7 !important; |
|||
} |
|||
main .contract-install-component p, main .contract-material-component p { |
|||
margin: 0; |
|||
} |
|||
main .contract-install-component > .btn-list, main .contract-material-component > .btn-list { |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
main .contract-install-component > .btn-list > button, main .contract-material-component > .btn-list > button { |
|||
padding: 8px; |
|||
margin: 0 4px; |
|||
} |
|||
main .contract-install-component > .contract, main .contract-material-component > .contract { |
|||
background: #fff; |
|||
width: 100%; |
|||
margin-top: 15px; |
|||
padding: 20px; |
|||
font-family: "標楷體"; |
|||
} |
|||
main .contract-install-component > .contract > h2, main .contract-material-component > .contract > h2 { |
|||
font-size: 18pt; |
|||
text-align: center; |
|||
} |
|||
main .contract-install-component > .contract br, main .contract-material-component > .contract br { |
|||
line-height: 2.5; |
|||
} |
|||
main .contract-install-component > .contract .d-flex, main .contract-material-component > .contract .d-flex { |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
main .contract-install-component > .contract .mouseover, main .contract-material-component > .contract .mouseover { |
|||
background-color: #f1f1f1; |
|||
cursor: pointer; |
|||
} |
|||
main .contract-install-component > .contract div, main .contract-install-component > .contract section, main .contract-material-component > .contract div, main .contract-material-component > .contract section { |
|||
font-size: 12pt; |
|||
line-height: 2.5; |
|||
} |
|||
main .contract-install-component > .contract div.party, main .contract-install-component > .contract section.party, main .contract-material-component > .contract div.party, main .contract-material-component > .contract section.party { |
|||
width: 100%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
} |
|||
main .contract-install-component > .contract div.party .company-name, main .contract-install-component > .contract section.party .company-name, main .contract-material-component > .contract div.party .company-name, main .contract-material-component > .contract section.party .company-name { |
|||
text-indent: 80pt; |
|||
} |
|||
main .contract-install-component > .contract div.party .notes, main .contract-install-component > .contract section.party .notes, main .contract-material-component > .contract div.party .notes, main .contract-material-component > .contract section.party .notes { |
|||
margin-right: 25%; |
|||
white-space: nowrap; |
|||
} |
|||
main .contract-install-component > .contract div.list-content, main .contract-install-component > .contract section.list-content, main .contract-material-component > .contract div.list-content, main .contract-material-component > .contract section.list-content { |
|||
margin-left: 70px; |
|||
} |
|||
main .contract-install-component > .contract div.list-title, main .contract-install-component > .contract section.list-title, main .contract-material-component > .contract div.list-title, main .contract-material-component > .contract section.list-title { |
|||
display: flex; |
|||
align-items: flex-start; |
|||
} |
|||
main .contract-install-component > .contract div.list-title > strong, main .contract-install-component > .contract section.list-title > strong, main .contract-material-component > .contract div.list-title > strong, main .contract-material-component > .contract section.list-title > strong { |
|||
min-width: 70px; |
|||
} |
|||
main .contract-install-component > .contract p, main .contract-install-component > .contract article, main .contract-install-component > .contract div, main .contract-material-component > .contract p, main .contract-material-component > .contract article, main .contract-material-component > .contract div { |
|||
position: relative; |
|||
display: block; |
|||
} |
|||
main .contract-install-component > .contract .date, main .contract-material-component > .contract .date { |
|||
display: flex; |
|||
align-items: center; |
|||
width: 100%; |
|||
margin-top: 300px; |
|||
} |
|||
main .contract-install-component > .contract .date p, main .contract-material-component > .contract .date p { |
|||
width: 50%; |
|||
letter-spacing: 20px; |
|||
} |
|||
main .contract-install-component > .contract .date > .ml, main .contract-material-component > .contract .date > .ml { |
|||
width: 50%; |
|||
display: flex; |
|||
justify-content: space-between; |
|||
flex-direction: row-reverse; |
|||
} |
|||
main .contract-install-component > .contract .buttons, main .contract-material-component > .contract .buttons { |
|||
position: absolute; |
|||
top: 0; |
|||
right: 0; |
|||
display: flex; |
|||
z-index: 9; |
|||
} |
|||
main .contract-install-component > .contract .buttons > button, main .contract-material-component > .contract .buttons > button { |
|||
width: 30px; |
|||
height: 30px; |
|||
border-radius: 5px; |
|||
padding: 0; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
border: 2px #fff solid; |
|||
outline: none; |
|||
color: #fff; |
|||
margin: 0 1px; |
|||
} |
|||
main .contract-install-component > .contract .buttons > button > i, main .contract-material-component > .contract .buttons > button > i { |
|||
font-size: 12px; |
|||
} |
|||
main .contract-install-component > .contract .buttons > button.edit, main .contract-material-component > .contract .buttons > button.edit { |
|||
background-color: #5BC0DE; |
|||
} |
|||
main .contract-install-component > .contract .buttons > button.add, main .contract-material-component > .contract .buttons > button.add { |
|||
background-color: #F0AD4E; |
|||
} |
|||
main .contract-install-component > .contract .buttons > button.delete, main .contract-material-component > .contract .buttons > button.delete { |
|||
background-color: rgb(211, 0, 0); |
|||
} |
|||
main .contract-install-component > .contract table, main .contract-material-component > .contract table { |
|||
border: none; |
|||
margin-top: 30px; |
|||
font-family: "標楷體"; |
|||
width: 800px; |
|||
} |
|||
main .contract-install-component > .contract table tr:nth-child(even), main .contract-install-component > .contract table tr:nth-child(odd), main .contract-material-component > .contract table tr:nth-child(even), main .contract-material-component > .contract table tr:nth-child(odd) { |
|||
background-color: #fff; |
|||
} |
|||
main .contract-install-component > .contract table tr, main .contract-material-component > .contract table tr { |
|||
font-size: 12pt; |
|||
width: 100%; |
|||
position: relative; |
|||
} |
|||
main .contract-install-component > .contract table tr.mouseover, main .contract-material-component > .contract table tr.mouseover { |
|||
background-color: #f3f3f3; |
|||
} |
|||
main .contract-install-component > .contract table tr h2, main .contract-material-component > .contract table tr h2 { |
|||
font-size: 18pt; |
|||
} |
|||
main .contract-install-component > .contract table tr td, main .contract-material-component > .contract table tr td { |
|||
width: 100%; |
|||
height: 100%; |
|||
line-height: 2; |
|||
display: flex; |
|||
} |
|||
main .contract-install-component > .contract table tr td.center, main .contract-material-component > .contract table tr td.center { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
} |
|||
main .contract-install-component > .contract table tr td.list, main .contract-material-component > .contract table tr td.list { |
|||
width: 100%; |
|||
height: 100%; |
|||
white-space: nowrap; |
|||
display: flex; |
|||
} |
|||
main .contract-install-component > .contract table tr td.list span, main .contract-material-component > .contract table tr td.list span { |
|||
width: 100px; |
|||
min-height: 100%; |
|||
display: block; |
|||
} |
|||
main .contract-install-component > .contract table tr td.list > p, main .contract-material-component > .contract table tr td.list > p { |
|||
display: block; |
|||
text-align: justify; |
|||
} |
|||
main .contract-install-component > .contract table tr td.list div, main .contract-install-component > .contract table tr td.list article, main .contract-material-component > .contract table tr td.list div, main .contract-material-component > .contract table tr td.list article { |
|||
max-width: calc(100% - 100px); |
|||
white-space: normal; |
|||
} |
|||
main .contract-install-component > .contract table tr td.list div input[type=text], main .contract-install-component > .contract table tr td.list div input[type=number], main .contract-install-component > .contract table tr td.list div input, main .contract-install-component > .contract table tr td.list article input[type=text], main .contract-install-component > .contract table tr td.list article input[type=number], main .contract-install-component > .contract table tr td.list article input, main .contract-material-component > .contract table tr td.list div input[type=text], main .contract-material-component > .contract table tr td.list div input[type=number], main .contract-material-component > .contract table tr td.list div input, main .contract-material-component > .contract table tr td.list article input[type=text], main .contract-material-component > .contract table tr td.list article input[type=number], main .contract-material-component > .contract table tr td.list article input { |
|||
border: none !important; |
|||
border-bottom: 1px #222 solid !important; |
|||
width: 50px; |
|||
outline: none; |
|||
text-align: center; |
|||
} |
|||
main .contract-install-component > .contract table tr td.list div.text-justify, main .contract-install-component > .contract table tr td.list article.text-justify, main .contract-material-component > .contract table tr td.list div.text-justify, main .contract-material-component > .contract table tr td.list article.text-justify { |
|||
display: flex; |
|||
width: 100%; |
|||
justify-content: space-between; |
|||
} |
|||
main .contract-install-component > .contract table tr.date td > div, main .contract-material-component > .contract table tr.date td > div { |
|||
width: 100%; |
|||
text-align: right; |
|||
} |
|||
main .contract-install-component > .contract table tr.date td > div.text-justify, main .contract-material-component > .contract table tr.date td > div.text-justify { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
} |
|||
main .contract-install-component > .contract table td, main .contract-install-component > .contract table th, main .contract-material-component > .contract table td, main .contract-material-component > .contract table th { |
|||
padding: 8px; |
|||
} |
|||
@keyframes modelanim { |
|||
0% { |
|||
opacity: 0; |
|||
} |
|||
} |
|||
main .contract-model { |
|||
position: fixed; |
|||
top: 0; |
|||
left: 0; |
|||
width: 100%; |
|||
height: 100vh; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
z-index: 999; |
|||
animation: modelanim 0.2s linear; |
|||
} |
|||
main .contract-model > .contract-back { |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
width: 100%; |
|||
height: 100%; |
|||
background-color: rgba(0, 0, 0, 0.5); |
|||
} |
|||
main .contract-model > .contract-content { |
|||
z-index: 999; |
|||
max-width: 600px; |
|||
width: 100%; |
|||
border-radius: 6px; |
|||
overflow: hidden; |
|||
background-color: white; |
|||
} |
|||
main .contract-model > .contract-content > .model-header { |
|||
width: 100%; |
|||
background-color: #1E74FD; |
|||
height: 38px; |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
padding: 0 15px; |
|||
} |
|||
main .contract-model > .contract-content > .model-header > i { |
|||
float: right; |
|||
color: rgba(255, 255, 255, 0.7058823529); |
|||
cursor: pointer; |
|||
} |
|||
main .contract-model > .contract-content > .model-header > i:hover { |
|||
color: #fff; |
|||
} |
|||
main .contract-model > .contract-content > .model-header > span { |
|||
color: #fff; |
|||
} |
|||
main .contract-model > .contract-content > .content { |
|||
padding: 30px; |
|||
} |
|||
main .contract-model > .contract-content > .content textarea { |
|||
width: 100%; |
|||
resize: vertical; |
|||
height: 150px; |
|||
border: 1px #ccc solid; |
|||
outline: none; |
|||
border-radius: 6px; |
|||
} |
|||
main .rebtn, main .prviewbtn { |
|||
background-color: #5BC0DE; |
|||
color: #fff; |
|||
outline: none; |
|||
border: none; |
|||
border: 1px #ccc solid; |
|||
width: 100px; |
|||
height: 32px; |
|||
font-weight: 600; |
|||
border-radius: 6px; |
|||
margin-right: 5px; |
|||
} |
|||
main .prviewbtn { |
|||
background-color: #2E6DA4; |
|||
} |
|||
|
|||
input[type=checkbox].scorll, input[type=radio].scorll { |
|||
position: relative; |
|||
width: 50px; |
|||
height: 25px; |
|||
outline: none; |
|||
background: linear-gradient(to right, #bbb, #999); |
|||
-webkit-appearance: none; |
|||
cursor: pointer; |
|||
border-radius: 20px; |
|||
} |
|||
input[type=checkbox].scorll::before, input[type=radio].scorll::before { |
|||
content: ""; |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
width: 25px; |
|||
height: 25px; |
|||
background: #fff; |
|||
border-radius: 50%; |
|||
transform: scale(0.98, 0.96); |
|||
transition: 0.5s; |
|||
} |
|||
input[type=checkbox].scorll:checked, input[type=radio].scorll:checked { |
|||
background: linear-gradient(to right, #5BC0DE, #2E6DA4); |
|||
} |
|||
input[type=checkbox].scorll:checked::before, input[type=radio].scorll:checked::before { |
|||
left: 25px; |
|||
} |
|||
input[type=checkbox].scorll::after, input[type=radio].scorll::after { |
|||
content: ""; |
|||
} |
|||
|
|||
.prview table { |
|||
border: none; |
|||
margin-top: 30px; |
|||
font-family: "標楷體"; |
|||
width: 800px; |
|||
border: 1px #ccc solid; |
|||
} |
|||
.prview table tr:nth-child(even), .prview table tr:nth-child(odd) { |
|||
background-color: #fff; |
|||
} |
|||
.prview table tr { |
|||
font-size: 12pt; |
|||
width: 100%; |
|||
position: relative; |
|||
} |
|||
.prview table tr.mouseover { |
|||
background-color: #f3f3f3; |
|||
} |
|||
.prview table tr h2 { |
|||
font-size: 18pt; |
|||
} |
|||
.prview table tr td { |
|||
width: 100%; |
|||
height: 100%; |
|||
line-height: 2; |
|||
display: flex; |
|||
} |
|||
.prview table tr td.center { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
} |
|||
.prview table tr td.list { |
|||
width: 100%; |
|||
height: 100%; |
|||
white-space: nowrap; |
|||
display: flex; |
|||
} |
|||
.prview table tr td.list span { |
|||
width: 100px; |
|||
min-height: 100%; |
|||
display: block; |
|||
} |
|||
.prview table tr td.list > p { |
|||
display: block; |
|||
text-align: justify; |
|||
} |
|||
.prview table tr td.list div, .prview table tr td.list article { |
|||
max-width: calc(100% - 100px); |
|||
white-space: normal; |
|||
} |
|||
.prview table tr td.list div.text-justify, .prview table tr td.list article.text-justify { |
|||
display: flex; |
|||
width: 100%; |
|||
justify-content: space-between; |
|||
} |
|||
.prview table tr.date td > div { |
|||
width: 100%; |
|||
text-align: right; |
|||
} |
|||
.prview table tr.date td > div.text-justify { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
} |
|||
.prview table td, .prview table th { |
|||
padding: 8px; |
|||
} |
|||
|
|||
main table { |
|||
border: none; |
|||
margin-top: 30px; |
|||
font-family: "標楷體"; |
|||
width: 800px; |
|||
} |
|||
main table tr:nth-child(even), main table tr:nth-child(odd) { |
|||
background-color: #fff; |
|||
} |
|||
main table tr { |
|||
font-size: 12pt; |
|||
width: 100%; |
|||
position: relative; |
|||
} |
|||
main table tr.mouseover { |
|||
background-color: #ccc; |
|||
} |
|||
main table tr h2 { |
|||
font-size: 18pt; |
|||
} |
|||
main table tr td { |
|||
width: 100%; |
|||
height: 100%; |
|||
line-height: 2; |
|||
display: flex; |
|||
} |
|||
main table tr td.center { |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
} |
|||
main table tr td.list { |
|||
width: 100%; |
|||
height: 100%; |
|||
white-space: nowrap; |
|||
display: flex; |
|||
} |
|||
main table tr td.list span { |
|||
width: 60px; |
|||
min-height: 100%; |
|||
display: block; |
|||
} |
|||
main table tr td.list > p { |
|||
display: block; |
|||
text-align: justify; |
|||
} |
|||
main table tr td.list div { |
|||
max-width: calc(100% - 60px); |
|||
white-space: normal; |
|||
} |
|||
main table tr td.list div.text-justify { |
|||
display: flex; |
|||
width: 100%; |
|||
justify-content: space-between; |
|||
} |
|||
main table tr.date td > div { |
|||
width: 100%; |
|||
text-align: right; |
|||
} |
|||
main table tr.date td > div.text-justify { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
} |
|||
main table td, main table th { |
|||
padding: 8px; |
|||
} |
|||
|
|||
.prview { |
|||
width: 800px; |
|||
margin: 0 auto; |
|||
border: 1px #ccc solid; |
|||
padding: 20px; |
|||
font-family: "標楷體"; |
|||
} |
|||
.prview.none { |
|||
display: none; |
|||
} |
|||
.prview h2 { |
|||
font-size: 18pt; |
|||
text-align: center; |
|||
} |
|||
.prview p { |
|||
font-size: 12pt; |
|||
} |
|||
|
|||
.loader { |
|||
border: 4px solid #f3f3f3; /* Light grey */ |
|||
border-top: 4px solid #999; /* Blue */ |
|||
border-radius: 50%; |
|||
width: 20px; |
|||
height: 20px; |
|||
animation: spin 2s linear infinite; |
|||
} |
|||
|
|||
@keyframes spin { |
|||
0% { |
|||
transform: rotate(0deg); |
|||
} |
|||
100% { |
|||
transform: rotate(360deg); |
|||
} |
|||
} |
|||
.contract-input-component .contract-input-component .form, .contract-input-component .contract-management .form, .contract-input-component .contract-new-apply-component .form, .contract-management .contract-input-component .form, .contract-management .contract-management .form, .contract-management .contract-new-apply-component .form, .contract-new-apply-component .contract-input-component .form, .contract-new-apply-component .contract-management .form, .contract-new-apply-component .contract-new-apply-component .form { |
|||
margin: 0 auto; |
|||
} |
|||
.contract-input-component .contract-input-component .form .dropdown, .contract-input-component .contract-management .form .dropdown, .contract-input-component .contract-new-apply-component .form .dropdown, .contract-management .contract-input-component .form .dropdown, .contract-management .contract-management .form .dropdown, .contract-management .contract-new-apply-component .form .dropdown, .contract-new-apply-component .contract-input-component .form .dropdown, .contract-new-apply-component .contract-management .form .dropdown, .contract-new-apply-component .contract-new-apply-component .form .dropdown { |
|||
width: 100%; |
|||
margin-top: 7px; |
|||
} |
|||
.contract-input-component .contract-input-component .form .savebtn, .contract-input-component .contract-management .form .savebtn, .contract-input-component .contract-new-apply-component .form .savebtn, .contract-management .contract-input-component .form .savebtn, .contract-management .contract-management .form .savebtn, .contract-management .contract-new-apply-component .form .savebtn, .contract-new-apply-component .contract-input-component .form .savebtn, .contract-new-apply-component .contract-management .form .savebtn, .contract-new-apply-component .contract-new-apply-component .form .savebtn { |
|||
margin-right: 13px; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
width: 70px; |
|||
height: 45px; |
|||
font-size: 15px; |
|||
} |
|||
.contract-input-component .contract-input-component .form table .fixed, .contract-input-component .contract-management .form table .fixed, .contract-input-component .contract-new-apply-component .form table .fixed, .contract-management .contract-input-component .form table .fixed, .contract-management .contract-management .form table .fixed, .contract-management .contract-new-apply-component .form table .fixed, .contract-new-apply-component .contract-input-component .form table .fixed, .contract-new-apply-component .contract-management .form table .fixed, .contract-new-apply-component .contract-new-apply-component .form table .fixed { |
|||
padding: 8px 0; |
|||
cursor: not-allowed; |
|||
} |
|||
.contract-input-component .contract-input-component .form table .alerttext, .contract-input-component .contract-management .form table .alerttext, .contract-input-component .contract-new-apply-component .form table .alerttext, .contract-management .contract-input-component .form table .alerttext, .contract-management .contract-management .form table .alerttext, .contract-management .contract-new-apply-component .form table .alerttext, .contract-new-apply-component .contract-input-component .form table .alerttext, .contract-new-apply-component .contract-management .form table .alerttext, .contract-new-apply-component .contract-new-apply-component .form table .alerttext { |
|||
font-size: 13px; |
|||
color: #a00; |
|||
font-weight: 500; |
|||
margin: 3px; |
|||
font-weight: 900; |
|||
padding: 0; |
|||
} |
|||
.contract-input-component .contract-input-component .form input[type=file], .contract-input-component .contract-management .form input[type=file], .contract-input-component .contract-new-apply-component .form input[type=file], .contract-management .contract-input-component .form input[type=file], .contract-management .contract-management .form input[type=file], .contract-management .contract-new-apply-component .form input[type=file], .contract-new-apply-component .contract-input-component .form input[type=file], .contract-new-apply-component .contract-management .form input[type=file], .contract-new-apply-component .contract-new-apply-component .form input[type=file] { |
|||
padding: 12px 20px; |
|||
margin: 8px 0; |
|||
} |
|||
.contract-input-component .contract-input-component .form span, .contract-input-component .contract-management .form span, .contract-input-component .contract-new-apply-component .form span, .contract-management .contract-input-component .form span, .contract-management .contract-management .form span, .contract-management .contract-new-apply-component .form span, .contract-new-apply-component .contract-input-component .form span, .contract-new-apply-component .contract-management .form span, .contract-new-apply-component .contract-new-apply-component .form span { |
|||
font-weight: 900; |
|||
} |
|||
.contract-input-component .contract-input-component .form span.successtext, .contract-input-component .contract-management .form span.successtext, .contract-input-component .contract-new-apply-component .form span.successtext, .contract-management .contract-input-component .form span.successtext, .contract-management .contract-management .form span.successtext, .contract-management .contract-new-apply-component .form span.successtext, .contract-new-apply-component .contract-input-component .form span.successtext, .contract-new-apply-component .contract-management .form span.successtext, .contract-new-apply-component .contract-new-apply-component .form span.successtext { |
|||
color: #0a0; |
|||
} |
|||
.contract-input-component .contract-input-component .form span.failtext, .contract-input-component .contract-management .form span.failtext, .contract-input-component .contract-new-apply-component .form span.failtext, .contract-management .contract-input-component .form span.failtext, .contract-management .contract-management .form span.failtext, .contract-management .contract-new-apply-component .form span.failtext, .contract-new-apply-component .contract-input-component .form span.failtext, .contract-new-apply-component .contract-management .form span.failtext, .contract-new-apply-component .contract-new-apply-component .form span.failtext { |
|||
color: #a00; |
|||
} |
|||
.contract-input-component .contract-input-component .form span.readtext, .contract-input-component .contract-management .form span.readtext, .contract-input-component .contract-new-apply-component .form span.readtext, .contract-management .contract-input-component .form span.readtext, .contract-management .contract-management .form span.readtext, .contract-management .contract-new-apply-component .form span.readtext, .contract-new-apply-component .contract-input-component .form span.readtext, .contract-new-apply-component .contract-management .form span.readtext, .contract-new-apply-component .contract-new-apply-component .form span.readtext { |
|||
color: #aa0; |
|||
} |
|||
.contract-input-component .contract-input-component .form input[type=number]::-webkit-outer-spin-button, |
|||
.contract-input-component .contract-input-component .form input[type=number]::-webkit-inner-spin-button, .contract-input-component .contract-management .form input[type=number]::-webkit-outer-spin-button, |
|||
.contract-input-component .contract-management .form input[type=number]::-webkit-inner-spin-button, .contract-input-component .contract-new-apply-component .form input[type=number]::-webkit-outer-spin-button, |
|||
.contract-input-component .contract-new-apply-component .form input[type=number]::-webkit-inner-spin-button, .contract-management .contract-input-component .form input[type=number]::-webkit-outer-spin-button, |
|||
.contract-management .contract-input-component .form input[type=number]::-webkit-inner-spin-button, .contract-management .contract-management .form input[type=number]::-webkit-outer-spin-button, |
|||
.contract-management .contract-management .form input[type=number]::-webkit-inner-spin-button, .contract-management .contract-new-apply-component .form input[type=number]::-webkit-outer-spin-button, |
|||
.contract-management .contract-new-apply-component .form input[type=number]::-webkit-inner-spin-button, .contract-new-apply-component .contract-input-component .form input[type=number]::-webkit-outer-spin-button, |
|||
.contract-new-apply-component .contract-input-component .form input[type=number]::-webkit-inner-spin-button, .contract-new-apply-component .contract-management .form input[type=number]::-webkit-outer-spin-button, |
|||
.contract-new-apply-component .contract-management .form input[type=number]::-webkit-inner-spin-button, .contract-new-apply-component .contract-new-apply-component .form input[type=number]::-webkit-outer-spin-button, |
|||
.contract-new-apply-component .contract-new-apply-component .form input[type=number]::-webkit-inner-spin-button { |
|||
-webkit-appearance: none; |
|||
margin: 0; |
|||
} |
|||
.contract-input-component .contract-input-component .form input[type=number], .contract-input-component .contract-management .form input[type=number], .contract-input-component .contract-new-apply-component .form input[type=number], .contract-management .contract-input-component .form input[type=number], .contract-management .contract-management .form input[type=number], .contract-management .contract-new-apply-component .form input[type=number], .contract-new-apply-component .contract-input-component .form input[type=number], .contract-new-apply-component .contract-management .form input[type=number], .contract-new-apply-component .contract-new-apply-component .form input[type=number] { |
|||
-moz-appearance: textfield; |
|||
} |
|||
.contract-input-component .contract-input-component .error, .contract-input-component .contract-management .error, .contract-input-component .contract-new-apply-component .error, .contract-management .contract-input-component .error, .contract-management .contract-management .error, .contract-management .contract-new-apply-component .error, .contract-new-apply-component .contract-input-component .error, .contract-new-apply-component .contract-management .error, .contract-new-apply-component .contract-new-apply-component .error { |
|||
display: flex; |
|||
flex-direction: column; |
|||
margin: 15px; |
|||
} |
|||
.contract-input-component .contract-input-component .error .errortext, .contract-input-component .contract-management .error .errortext, .contract-input-component .contract-new-apply-component .error .errortext, .contract-management .contract-input-component .error .errortext, .contract-management .contract-management .error .errortext, .contract-management .contract-new-apply-component .error .errortext, .contract-new-apply-component .contract-input-component .error .errortext, .contract-new-apply-component .contract-management .error .errortext, .contract-new-apply-component .contract-new-apply-component .error .errortext { |
|||
font-size: 16px; |
|||
font-weight: 500; |
|||
color: #a00; |
|||
} |
|||
.contract-input-component .contract-input-component .input-group-btn, .contract-input-component .contract-management .input-group-btn, .contract-input-component .contract-new-apply-component .input-group-btn, .contract-management .contract-input-component .input-group-btn, .contract-management .contract-management .input-group-btn, .contract-management .contract-new-apply-component .input-group-btn, .contract-new-apply-component .contract-input-component .input-group-btn, .contract-new-apply-component .contract-management .input-group-btn, .contract-new-apply-component .contract-new-apply-component .input-group-btn { |
|||
font-size: 16px; |
|||
} |
|||
@media screen and (max-width: 600px) { |
|||
.contract-input-component .contract-input-component table, .contract-input-component .contract-management table, .contract-input-component .contract-new-apply-component table, .contract-management .contract-input-component table, .contract-management .contract-management table, .contract-management .contract-new-apply-component table, .contract-new-apply-component .contract-input-component table, .contract-new-apply-component .contract-management table, .contract-new-apply-component .contract-new-apply-component table { |
|||
border: 0; |
|||
} |
|||
.contract-input-component .contract-input-component table thead, .contract-input-component .contract-management table thead, .contract-input-component .contract-new-apply-component table thead, .contract-management .contract-input-component table thead, .contract-management .contract-management table thead, .contract-management .contract-new-apply-component table thead, .contract-new-apply-component .contract-input-component table thead, .contract-new-apply-component .contract-management table thead, .contract-new-apply-component .contract-new-apply-component table thead { |
|||
display: none; |
|||
} |
|||
.contract-input-component .contract-input-component table tr, .contract-input-component .contract-management table tr, .contract-input-component .contract-new-apply-component table tr, .contract-management .contract-input-component table tr, .contract-management .contract-management table tr, .contract-management .contract-new-apply-component table tr, .contract-new-apply-component .contract-input-component table tr, .contract-new-apply-component .contract-management table tr, .contract-new-apply-component .contract-new-apply-component table tr { |
|||
margin-bottom: 10px; |
|||
display: block; |
|||
border-bottom: 2px solid #ddd; |
|||
} |
|||
.contract-input-component .contract-input-component table td, .contract-input-component .contract-management table td, .contract-input-component .contract-new-apply-component table td, .contract-management .contract-input-component table td, .contract-management .contract-management table td, .contract-management .contract-new-apply-component table td, .contract-new-apply-component .contract-input-component table td, .contract-new-apply-component .contract-management table td, .contract-new-apply-component .contract-new-apply-component table td { |
|||
display: block; |
|||
text-align: left; |
|||
font-size: 14px; |
|||
border-bottom: 1px dotted #ccc; |
|||
} |
|||
.contract-input-component .contract-input-component table td:last-child, .contract-input-component .contract-management table td:last-child, .contract-input-component .contract-new-apply-component table td:last-child, .contract-management .contract-input-component table td:last-child, .contract-management .contract-management table td:last-child, .contract-management .contract-new-apply-component table td:last-child, .contract-new-apply-component .contract-input-component table td:last-child, .contract-new-apply-component .contract-management table td:last-child, .contract-new-apply-component .contract-new-apply-component table td:last-child { |
|||
border-bottom: 0; |
|||
} |
|||
.contract-input-component .contract-input-component table td:before, .contract-input-component .contract-management table td:before, .contract-input-component .contract-new-apply-component table td:before, .contract-management .contract-input-component table td:before, .contract-management .contract-management table td:before, .contract-management .contract-new-apply-component table td:before, .contract-new-apply-component .contract-input-component table td:before, .contract-new-apply-component .contract-management table td:before, .contract-new-apply-component .contract-new-apply-component table td:before { |
|||
content: attr(data-label); |
|||
float: left; |
|||
text-transform: uppercase; |
|||
font-weight: bold; |
|||
} |
|||
} |
|||
.contract-input-component .contract-input-component .images, .contract-input-component .contract-management .images, .contract-input-component .contract-new-apply-component .images, .contract-management .contract-input-component .images, .contract-management .contract-management .images, .contract-management .contract-new-apply-component .images, .contract-new-apply-component .contract-input-component .images, .contract-new-apply-component .contract-management .images, .contract-new-apply-component .contract-new-apply-component .images { |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
padding: 20px; |
|||
} |
|||
.contract-input-component .contract-input-component .images > .image, .contract-input-component .contract-management .images > .image, .contract-input-component .contract-new-apply-component .images > .image, .contract-management .contract-input-component .images > .image, .contract-management .contract-management .images > .image, .contract-management .contract-new-apply-component .images > .image, .contract-new-apply-component .contract-input-component .images > .image, .contract-new-apply-component .contract-management .images > .image, .contract-new-apply-component .contract-new-apply-component .images > .image { |
|||
position: relative; |
|||
margin: 10px; |
|||
} |
|||
.contract-input-component .contract-input-component .images > .image:hover > i, .contract-input-component .contract-management .images > .image:hover > i, .contract-input-component .contract-new-apply-component .images > .image:hover > i, .contract-management .contract-input-component .images > .image:hover > i, .contract-management .contract-management .images > .image:hover > i, .contract-management .contract-new-apply-component .images > .image:hover > i, .contract-new-apply-component .contract-input-component .images > .image:hover > i, .contract-new-apply-component .contract-management .images > .image:hover > i, .contract-new-apply-component .contract-new-apply-component .images > .image:hover > i { |
|||
opacity: 1; |
|||
} |
|||
.contract-input-component .contract-input-component .images > .image > i, .contract-input-component .contract-management .images > .image > i, .contract-input-component .contract-new-apply-component .images > .image > i, .contract-management .contract-input-component .images > .image > i, .contract-management .contract-management .images > .image > i, .contract-management .contract-new-apply-component .images > .image > i, .contract-new-apply-component .contract-input-component .images > .image > i, .contract-new-apply-component .contract-management .images > .image > i, .contract-new-apply-component .contract-new-apply-component .images > .image > i { |
|||
position: absolute; |
|||
top: -12px; |
|||
right: -12px; |
|||
color: #b00; |
|||
cursor: pointer; |
|||
opacity: 0; |
|||
transition: 0.3s; |
|||
} |
|||
.contract-input-component table, .contract-management table, .contract-new-apply-component table { |
|||
table-layout: fixed; |
|||
width: 100%; |
|||
} |
|||
.contract-input-component td, .contract-management td, .contract-new-apply-component td { |
|||
word-wrap: break-word; |
|||
} |
|||
.contract-input-component img, .contract-management img, .contract-new-apply-component img { |
|||
width: 125px; |
|||
} |
|||
.contract-input-component .width_style_1, .contract-management .width_style_1, .contract-new-apply-component .width_style_1 { |
|||
width: 125px; |
|||
} |
|||
.contract-input-component table, .contract-management table, .contract-new-apply-component table { |
|||
width: 100%; |
|||
} |
|||
.contract-input-component #table_index_filter, .contract-management #table_index_filter, .contract-new-apply-component #table_index_filter { |
|||
float: right; |
|||
} |
|||
.contract-input-component #table_index_paginate, .contract-management #table_index_paginate, .contract-new-apply-component #table_index_paginate { |
|||
float: right; |
|||
} |
|||
.contract-input-component label, .contract-management label, .contract-new-apply-component label { |
|||
display: inline-flex; |
|||
margin-bottom: 0.5rem; |
|||
margin-top: 0.5rem; |
|||
}/*# sourceMappingURL=style.css.map */ |
File diff suppressed because one or more lines are too long
@ -0,0 +1,722 @@ |
|||
|
|||
|
|||
main{ |
|||
[x-cloak] { display: none !important; } |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
margin-top: -20px; |
|||
>.sidebar{ |
|||
width:300px; |
|||
min-height: 100vh; |
|||
border-right:1px #ddd solid; |
|||
box-shadow: 0px 0px 5px #ddd; |
|||
padding: 50px 20px; |
|||
button { |
|||
display: block; |
|||
outline: none; |
|||
border:none; |
|||
color:#1E74FD; |
|||
background-color: transparent; |
|||
margin-bottom: 20px; |
|||
border-bottom: 1px #ccc solid; |
|||
opacity: .65; |
|||
&.active{ |
|||
opacity: 1; |
|||
} |
|||
&:hover{ |
|||
opacity: 1; |
|||
} |
|||
} |
|||
a{ |
|||
display: block; |
|||
width: 120px; |
|||
height: 35px; |
|||
text-align: center; |
|||
line-height: 35px; |
|||
text-decoration: none; |
|||
background-color: #1E74FD; |
|||
color:#fff; |
|||
margin-top: 50px; |
|||
} |
|||
} |
|||
.inputDiv{ |
|||
padding: 30px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
label{ |
|||
margin-bottom: 10px; |
|||
input, select{ |
|||
border:1px #aaa solid; |
|||
outline: none; |
|||
border-radius: 5px; |
|||
width: 220px; |
|||
height: 32px; |
|||
padding: 0 10px; |
|||
} |
|||
button{ |
|||
background-color:#1E74FD ; |
|||
color:#fff; |
|||
outline: none; |
|||
border:none; |
|||
border:1px #ccc solid; |
|||
width: 220px; |
|||
height: 32px; |
|||
font-weight: 6500; |
|||
margin-top: 15px; |
|||
} |
|||
} |
|||
} |
|||
.contract-install-component, .contract-material-component{ |
|||
p{ |
|||
margin:0; |
|||
} |
|||
|
|||
width: 100%; |
|||
max-width: 816px; |
|||
margin:30px auto; |
|||
background-color: #f7f7f7 !important; |
|||
>.btn-list{ |
|||
display: flex; |
|||
align-items: center; |
|||
>button{ |
|||
padding: 8px; |
|||
margin: 0 4px; |
|||
} |
|||
} |
|||
>.contract{ |
|||
background: #fff; |
|||
width: 100%; |
|||
margin-top: 15px; |
|||
padding: 20px ; |
|||
font-family:'標楷體'; |
|||
>h2{ |
|||
font-size: 18pt; |
|||
text-align: center; |
|||
} |
|||
br{ |
|||
line-height: 2.5; |
|||
} |
|||
.d-flex{ |
|||
display: flex; |
|||
align-items: center; |
|||
} |
|||
.mouseover{ |
|||
background-color: #f1f1f1; |
|||
cursor: pointer; |
|||
} |
|||
div, section{ |
|||
font-size: 12pt; |
|||
line-height: 2.5; |
|||
|
|||
&.party{ |
|||
width: 100%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
.company-name{ |
|||
text-indent:80pt; |
|||
} |
|||
.notes{ |
|||
margin-right: 25%; |
|||
white-space:nowrap |
|||
} |
|||
} |
|||
&.list-content{ |
|||
margin-left:70px; |
|||
|
|||
} |
|||
&.list-title{ |
|||
display: flex; |
|||
align-items: flex-start; |
|||
>strong{ |
|||
min-width: 70px; |
|||
} |
|||
} |
|||
} |
|||
p, article, div{ |
|||
position: relative; |
|||
display: block; |
|||
|
|||
|
|||
} |
|||
.date{ |
|||
display: flex; |
|||
align-items: center; |
|||
width: 100%; |
|||
margin-top: 300px; |
|||
p{ |
|||
width: 50%; |
|||
letter-spacing: 20px; |
|||
} |
|||
>.ml{ |
|||
width: 50%; |
|||
display: flex; |
|||
justify-content: space-between; |
|||
flex-direction: row-reverse; |
|||
} |
|||
} |
|||
.buttons{ |
|||
position: absolute; |
|||
top: 0; |
|||
right:0; |
|||
display: flex; |
|||
z-index: 9; |
|||
>button{ |
|||
width: 30px; |
|||
height: 30px; |
|||
border-radius: 5px; |
|||
padding: 0; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
border:2px #fff solid; |
|||
outline: none; |
|||
color:#fff; |
|||
margin: 0 1px; |
|||
>i{ |
|||
font-size: 12px; |
|||
} |
|||
&.edit{ |
|||
background-color: #5BC0DE; |
|||
} |
|||
&.add{ |
|||
background-color: #F0AD4E; |
|||
} |
|||
&.delete{ |
|||
background-color: rgb(211, 0, 0); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
>.contract table{ |
|||
border:none; |
|||
margin-top: 30px; |
|||
font-family:'標楷體'; |
|||
width: 800px; |
|||
tr:nth-child(even), tr:nth-child(odd) { |
|||
background-color: #fff; |
|||
} |
|||
tr{ |
|||
font-size: 12pt; |
|||
width: 100%; |
|||
position: relative; |
|||
&.mouseover{ |
|||
background-color: #f3f3f3; |
|||
} |
|||
h2{ |
|||
font-size: 18pt; |
|||
} |
|||
td{ |
|||
width: 100%; |
|||
height: 100%; |
|||
line-height: 2; |
|||
&.center{ |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
} |
|||
display: flex; |
|||
&.list{ |
|||
width: 100%; |
|||
height: 100%; |
|||
white-space: nowrap; |
|||
display: flex; |
|||
span{ |
|||
width: 100px; |
|||
min-height: 100%; |
|||
display: block; |
|||
} |
|||
>p{ |
|||
display: block; |
|||
text-align: justify ; |
|||
} |
|||
div, article{ |
|||
max-width:calc(100% - 100px); |
|||
white-space: normal; |
|||
input[type='text'], input[type='number'], input{ |
|||
border:none !important; |
|||
border-bottom: 1px #222 solid !important; |
|||
width:50px; |
|||
outline: none; |
|||
text-align: center; |
|||
} |
|||
&.text-justify{ |
|||
display: flex; |
|||
width: 100%; |
|||
justify-content: space-between; |
|||
} |
|||
|
|||
} |
|||
} |
|||
|
|||
} |
|||
&.date{ |
|||
td{ |
|||
>div{ |
|||
width: 100%; |
|||
text-align: right; |
|||
&.text-justify{ |
|||
display: flex; |
|||
justify-content: space-between; |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
td, th{ |
|||
padding: 8px; |
|||
} |
|||
} |
|||
|
|||
@keyframes modelanim { |
|||
0%{ |
|||
opacity: 0; |
|||
} |
|||
} |
|||
} |
|||
.contract-model{ |
|||
position: fixed; |
|||
top: 0; |
|||
left:0; |
|||
width: 100%; |
|||
height: 100vh; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
z-index: 999; |
|||
animation: modelanim .2s linear; |
|||
>.contract-back{ |
|||
position: absolute; |
|||
top:0; |
|||
left:0; |
|||
width: 100%; |
|||
height: 100%; |
|||
background-color: rgba($color: #000000, $alpha: .5); |
|||
} |
|||
>.contract-content{ |
|||
z-index: 999; |
|||
max-width: 600px; |
|||
width: 100%; |
|||
border-radius: 6px; |
|||
overflow: hidden; |
|||
background-color: rgba($color: #fff, $alpha: 1.0); |
|||
>.model-header{ |
|||
width: 100%; |
|||
background-color: #1E74FD; |
|||
height: 38px; |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
padding: 0 15px; |
|||
>i{ |
|||
float: right; |
|||
color:#ffffffb4; |
|||
cursor: pointer; |
|||
&:hover{ |
|||
color:#fff; |
|||
} |
|||
} |
|||
>span{ |
|||
color:#fff; |
|||
} |
|||
} |
|||
>.content{ |
|||
padding: 30px; |
|||
textarea{ |
|||
width: 100%; |
|||
resize: vertical; |
|||
height: 150px; |
|||
border:1px #ccc solid; |
|||
outline: none; |
|||
border-radius: 6px; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
.rebtn, .prviewbtn{ |
|||
background-color : #5BC0DE ; |
|||
color:#fff; |
|||
outline: none; |
|||
border:none; |
|||
border:1px #ccc solid; |
|||
width: 100px; |
|||
height: 32px; |
|||
font-weight: 600; |
|||
border-radius: 6px; |
|||
margin-right: 5px; |
|||
} |
|||
.prviewbtn{ |
|||
background-color: #2E6DA4; |
|||
} |
|||
} |
|||
input[type="checkbox"].scorll ,input[type="radio"].scorll{ |
|||
position: relative; |
|||
width:50px; |
|||
height: 25px; |
|||
outline: none; |
|||
background:linear-gradient(to right,#bbb ,#999); |
|||
-webkit-appearance: none; |
|||
cursor: pointer; |
|||
border-radius: 20px; |
|||
&::before{ |
|||
content: ''; |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
width:25px; |
|||
height: 25px; |
|||
background: #fff; |
|||
border-radius: 50%; |
|||
transform: scale(0.98,0.96); |
|||
transition: .5s; |
|||
} |
|||
&:checked{ |
|||
background: linear-gradient(to right, #5BC0DE,#2E6DA4); |
|||
&::before{ |
|||
left:25px; |
|||
} |
|||
|
|||
} |
|||
&::after{ |
|||
content:''; |
|||
} |
|||
|
|||
} |
|||
|
|||
.prview table{ |
|||
border:none; |
|||
margin-top: 30px; |
|||
font-family:'標楷體'; |
|||
width: 800px; |
|||
border:1px #ccc solid; |
|||
tr:nth-child(even), tr:nth-child(odd) { |
|||
background-color: #fff; |
|||
} |
|||
tr{ |
|||
font-size: 12pt; |
|||
width: 100%; |
|||
position: relative; |
|||
&.mouseover{ |
|||
background-color: #f3f3f3; |
|||
} |
|||
h2{ |
|||
font-size: 18pt; |
|||
} |
|||
td{ |
|||
width: 100%; |
|||
height: 100%; |
|||
line-height: 2; |
|||
&.center{ |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
} |
|||
display: flex; |
|||
&.list{ |
|||
width: 100%; |
|||
height: 100%; |
|||
white-space: nowrap; |
|||
display: flex; |
|||
span{ |
|||
width: 100px; |
|||
min-height: 100%; |
|||
display: block; |
|||
} |
|||
>p{ |
|||
display: block; |
|||
text-align: justify ; |
|||
} |
|||
div, article{ |
|||
max-width:calc(100% - 100px); |
|||
white-space: normal; |
|||
&.text-justify{ |
|||
display: flex; |
|||
width: 100%; |
|||
justify-content: space-between; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
&.date{ |
|||
td{ |
|||
>div{ |
|||
width: 100%; |
|||
text-align: right; |
|||
&.text-justify{ |
|||
display: flex; |
|||
justify-content: space-between; |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
td, th{ |
|||
padding: 8px; |
|||
} |
|||
} |
|||
main{ |
|||
table{ |
|||
border:none; |
|||
margin-top: 30px; |
|||
font-family:'標楷體'; |
|||
width: 800px; |
|||
tr:nth-child(even), tr:nth-child(odd) { |
|||
background-color: #fff; |
|||
} |
|||
tr{ |
|||
font-size: 12pt; |
|||
width: 100%; |
|||
position: relative; |
|||
&.mouseover{ |
|||
background-color: #ccc; |
|||
} |
|||
h2{ |
|||
font-size: 18pt; |
|||
} |
|||
td{ |
|||
width: 100%; |
|||
height: 100%; |
|||
line-height: 2; |
|||
&.center{ |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
} |
|||
display: flex; |
|||
&.list{ |
|||
width: 100%; |
|||
height: 100%; |
|||
white-space: nowrap; |
|||
display: flex; |
|||
span{ |
|||
width: 60px; |
|||
min-height: 100%; |
|||
display: block; |
|||
} |
|||
>p{ |
|||
display: block; |
|||
text-align: justify ; |
|||
} |
|||
div{ |
|||
max-width:calc(100% - 60px); |
|||
white-space: normal; |
|||
&.text-justify{ |
|||
display: flex; |
|||
width: 100%; |
|||
justify-content: space-between; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
} |
|||
&.date{ |
|||
td{ |
|||
>div{ |
|||
width: 100%; |
|||
text-align: right; |
|||
&.text-justify{ |
|||
display: flex; |
|||
justify-content: space-between; |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
td, th{ |
|||
padding: 8px; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.prview{ |
|||
width: 800px; |
|||
margin:0 auto; |
|||
border:1px #ccc solid; |
|||
padding: 20px; |
|||
font-family:'標楷體'; |
|||
&.none{ |
|||
display: none; |
|||
} |
|||
h2{ |
|||
font-size: 18pt; |
|||
text-align: center; |
|||
} |
|||
p{ |
|||
font-size: 12pt; |
|||
} |
|||
} |
|||
.loader { |
|||
border: 4px solid #f3f3f3; /* Light grey */ |
|||
border-top: 4px solid #999; /* Blue */ |
|||
border-radius: 50%; |
|||
width: 20px; |
|||
height: 20px; |
|||
animation: spin 2s linear infinite; |
|||
} |
|||
|
|||
@keyframes spin { |
|||
0% { transform: rotate(0deg); } |
|||
100% { transform: rotate(360deg); } |
|||
} |
|||
.contract-input-component, .contract-management, .contract-new-apply-component{ |
|||
.contract-input-component, .contract-management, .contract-new-apply-component{ |
|||
.form{ |
|||
margin:0 auto; |
|||
.dropdown{ |
|||
width:100%; |
|||
margin-top: 7px; |
|||
} |
|||
.savebtn{ |
|||
margin-right: 13px; |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
width:70px; |
|||
height: 45px; |
|||
font-size: 15px; |
|||
} |
|||
table{ |
|||
.fixed{ |
|||
padding: 8px 0; |
|||
cursor: not-allowed; |
|||
} |
|||
.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; |
|||
} |
|||
span{ |
|||
font-weight: 900; |
|||
&.successtext{ |
|||
color:#0a0; |
|||
} |
|||
&.failtext{ |
|||
color:#a00; |
|||
} |
|||
&.readtext{ |
|||
color:#aa0; |
|||
} |
|||
} |
|||
input[type=number]::-webkit-outer-spin-button, |
|||
input[type=number]::-webkit-inner-spin-button { |
|||
-webkit-appearance: none; |
|||
margin: 0; |
|||
} |
|||
input[type=number] { |
|||
-moz-appearance: textfield; |
|||
} |
|||
} |
|||
.error{ |
|||
display: flex; |
|||
flex-direction: column; |
|||
margin:15px ; |
|||
.errortext{ |
|||
font-size: 16px; |
|||
font-weight: 500; |
|||
color: #a00; |
|||
} |
|||
} |
|||
|
|||
.input-group-btn{ |
|||
font-size: 16px; |
|||
} |
|||
@media screen and (max-width: 600px) { |
|||
table { |
|||
border: 0; |
|||
} |
|||
|
|||
table thead { |
|||
display: none; |
|||
} |
|||
|
|||
table tr { |
|||
margin-bottom: 10px; |
|||
display: block; |
|||
border-bottom: 2px solid #ddd; |
|||
} |
|||
|
|||
table td { |
|||
display: block; |
|||
text-align: left; |
|||
font-size: 14px; |
|||
border-bottom: 1px dotted #ccc; |
|||
} |
|||
|
|||
table td:last-child { |
|||
border-bottom: 0; |
|||
} |
|||
|
|||
table td:before { |
|||
content: attr(data-label); |
|||
float: left; |
|||
text-transform: uppercase; |
|||
font-weight: bold; |
|||
} |
|||
} |
|||
.images{ |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
padding: 20px; |
|||
>.image{ |
|||
position: relative; |
|||
margin:10px; |
|||
&:hover > i{ |
|||
opacity: 1; |
|||
} |
|||
>i{ |
|||
position: absolute; |
|||
top: -12px; |
|||
right:-12px; |
|||
color:#b00; |
|||
cursor: pointer; |
|||
opacity: 0; |
|||
transition: .3s; |
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
|||
table { |
|||
table-layout:fixed; |
|||
width: 100%; |
|||
} |
|||
|
|||
td { |
|||
word-wrap:break-word; |
|||
} |
|||
|
|||
img { |
|||
width:125px; |
|||
} |
|||
|
|||
.width_style_1 { |
|||
width:125px; |
|||
} |
|||
|
|||
table{ |
|||
width:100%; |
|||
} |
|||
#table_index_filter{ |
|||
float:right; |
|||
} |
|||
#table_index_paginate{ |
|||
float:right; |
|||
} |
|||
label { |
|||
display: inline-flex; |
|||
margin-bottom: .5rem; |
|||
margin-top: .5rem; |
|||
} |
|||
} |
@ -0,0 +1,4 @@ |
|||
<!-- 價格審查(修理) --> |
|||
<?php |
|||
|
|||
?> |
Loading…
Reference in new issue