Ellin 1 year ago
parent
commit
9400da8ae0
  1. 68
      wms/contract/api/postContractNewApplyData.php
  2. 5
      wms/contract/api/postNewContractData.php
  3. 5
      wms/contract/api/putContractData.php
  4. 3
      wms/contract/composer.json
  5. 567
      wms/contract/composer.lock
  6. 476
      wms/contract/contract-new-apply.php
  7. 34
      wms/contract/contract-newelevator-edit.php
  8. 17
      wms/contract/contract-newelevator-input.php
  9. 168
      wms/contract/insertData.php
  10. 92
      wms/contract/js/alpine.js
  11. 62
      wms/contract/styles/style.css
  12. 2
      wms/contract/styles/style.css.map
  13. 26
      wms/contract/styles/style.scss
  14. BIN
      wms/mkt/assets/img/1.jpg
  15. BIN
      wms/mkt/assets/img/2.jpg
  16. BIN
      wms/mkt/assets/img/3.jpg
  17. BIN
      wms/mkt/assets/img/4.jpg
  18. BIN
      wms/mkt/assets/img/5.jpg
  19. BIN
      wms/mkt/assets/img/S__14541066.jpg
  20. BIN
      wms/mkt/assets/img/curry.jpg
  21. 193
      wms/mkt/assets/js/alpine.js
  22. 49
      wms/mkt/conn.php
  23. 122
      wms/mkt/css/style.css
  24. 1
      wms/mkt/css/style.css.map
  25. 115
      wms/mkt/css/style.scss
  26. 160
      wms/mkt/price_option-index.php
  27. 87
      wms/mkt/price_option-index2.php
  28. 106
      wms/mkt/price_option-select.php
  29. 10
      wms/mkt/pricereview-index.php

68
wms/contract/api/postContractNewApplyData.php

@ -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());
}
}

5
wms/contract/api/postNewContractData.php

@ -22,6 +22,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['co
$lm_tel = $_POST["lm_tel"]; $lm_tel = $_POST["lm_tel"];
$address = $_POST["address"]; $address = $_POST["address"];
$salesman = $_POST["salesman"]; $salesman = $_POST["salesman"];
$qc = $_POST["qc"];
$contracttype = $_POST["contracttype"]; $contracttype = $_POST["contracttype"];
$files = !empty($_FILES['files']) ? $_FILES['files'] : null; $files = !empty($_FILES['files']) ? $_FILES['files'] : null;
$files_id = null; $files_id = null;
@ -36,6 +37,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['co
if(empty($lm_tel)) $fail_arr[] = '聯絡人電話為必填'; if(empty($lm_tel)) $fail_arr[] = '聯絡人電話為必填';
if(empty($address)) $fail_arr[] = '地址為必填'; if(empty($address)) $fail_arr[] = '地址為必填';
if(empty($salesman)) $fail_arr[] = '營業員為必填'; if(empty($salesman)) $fail_arr[] = '營業員為必填';
if(empty($qc)) $fail_arr[] = '請選擇QC或官檢';
if(count($fail_arr) > 0) { if(count($fail_arr) > 0) {
header("HTTP/1.1 422 Unprocessable Entity"); header("HTTP/1.1 422 Unprocessable Entity");
echo json_encode($fail_arr); echo json_encode($fail_arr);
@ -105,7 +107,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['co
$files = null; $files = null;
} }
$sql_str = "INSERT INTO contract_m_signed_back (contract_no, customer, manager, vat, case_name, linkman, lm_tel, address, salesman, salesman_name, files_id, created_at, created_by) VALUES (:contract_no, :customer, :manager, :vat, :case_name, :linkman, :lm_tel, :address, :salesman, :salesman_name, :files_id, :created_at, :created_by)"; $sql_str = "INSERT INTO contract_m_signed_back (contract_no, customer, manager, vat, case_name, linkman, lm_tel, address, salesman, salesman_name, files_id, created_at, created_by, qc_official_type) VALUES (:contract_no, :customer, :manager, :vat, :case_name, :linkman, :lm_tel, :address, :salesman, :salesman_name, :files_id, :created_at, :created_by, :qc)";
$stmt = $conn -> prepare($sql_str); $stmt = $conn -> prepare($sql_str);
$stmt -> bindParam(":contract_no",$contractno); $stmt -> bindParam(":contract_no",$contractno);
$stmt -> bindParam(":customer",$customer); $stmt -> bindParam(":customer",$customer);
@ -120,6 +122,7 @@ if(isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['co
$stmt -> bindParam(":files_id",$files_id); $stmt -> bindParam(":files_id",$files_id);
$stmt -> bindParam(":created_at",$created_at); $stmt -> bindParam(":created_at",$created_at);
$stmt -> bindParam(":created_by",$created_by); $stmt -> bindParam(":created_by",$created_by);
$stmt -> bindParam(":qc",$qc);
$stmt -> execute(); $stmt -> execute();

5
wms/contract/api/putContractData.php

@ -17,6 +17,7 @@ if(isset($_POST['contractno']) && $_POST['contractno']!="" && isset($_POST["id"]
$lm_tel = !empty($_POST['lm_tel']) ? $_POST['lm_tel'] : null; $lm_tel = !empty($_POST['lm_tel']) ? $_POST['lm_tel'] : null;
$address = !empty($_POST['address']) ? $_POST['address'] : null; $address = !empty($_POST['address']) ? $_POST['address'] : null;
$salesman = !empty($_POST['salesman']) ? $_POST['salesman'] : null; $salesman = !empty($_POST['salesman']) ? $_POST['salesman'] : null;
$qc = !empty($_POST['qc']) ? $_POST['qc'] : null;
$deletefiles = !empty($_POST['deletefiles']) ? $_POST['deletefiles'] : null; $deletefiles = !empty($_POST['deletefiles']) ? $_POST['deletefiles'] : null;
$files_id = !empty($_POST['files_id']) ? $_POST['files_id'] : null; $files_id = !empty($_POST['files_id']) ? $_POST['files_id'] : null;
$files = !empty($_FILES['files']) ? $_FILES['files'] : null; $files = !empty($_FILES['files']) ? $_FILES['files'] : null;
@ -33,6 +34,7 @@ if(isset($_POST['contractno']) && $_POST['contractno']!="" && isset($_POST["id"]
if(empty($lm_tel)) $fail_arr[] = '聯絡人電話為必填'; if(empty($lm_tel)) $fail_arr[] = '聯絡人電話為必填';
if(empty($address)) $fail_arr[] = '地址為必填'; if(empty($address)) $fail_arr[] = '地址為必填';
if(empty($salesman)) $fail_arr[] = '營業員為必填'; if(empty($salesman)) $fail_arr[] = '營業員為必填';
if(empty($qc)) $fail_arr[] = '請選擇QC或管檢';
if(count($fail_arr) > 0) { if(count($fail_arr) > 0) {
header("HTTP/1.1 422 Unprocessable Entity"); header("HTTP/1.1 422 Unprocessable Entity");
echo json_encode($fail_arr); echo json_encode($fail_arr);
@ -41,7 +43,7 @@ if(isset($_POST['contractno']) && $_POST['contractno']!="" && isset($_POST["id"]
$conn->beginTransaction(); $conn->beginTransaction();
$sql_str = "UPDATE contract_m_signed_back SET contract_no=:contract_no, customer=:customer, manager=:manager, vat=:vat, case_name=:case_name, linkman=:linkman, lm_tel=:lm_tel, address=:address, salesman=:salesman WHERE id = :id"; $sql_str = "UPDATE contract_m_signed_back SET contract_no=:contract_no, customer=:customer, manager=:manager, vat=:vat, case_name=:case_name, linkman=:linkman, lm_tel=:lm_tel, address=:address, salesman=:salesman, qc_official_type=:qc WHERE id = :id";
$stmt = $conn -> prepare($sql_str); $stmt = $conn -> prepare($sql_str);
$stmt -> bindParam(':contract_no' ,$contract_no); $stmt -> bindParam(':contract_no' ,$contract_no);
$stmt -> bindParam(':customer' ,$customer); $stmt -> bindParam(':customer' ,$customer);
@ -52,6 +54,7 @@ if(isset($_POST['contractno']) && $_POST['contractno']!="" && isset($_POST["id"]
$stmt -> bindParam(':lm_tel' ,$lm_tel); $stmt -> bindParam(':lm_tel' ,$lm_tel);
$stmt -> bindParam(':address' ,$address); $stmt -> bindParam(':address' ,$address);
$stmt -> bindParam(':salesman' ,$salesman); $stmt -> bindParam(':salesman' ,$salesman);
$stmt -> bindParam(':qc' ,$qc);
$stmt -> bindParam(':id' ,$id); $stmt -> bindParam(':id' ,$id);
$stmt -> execute(); $stmt -> execute();
if(!empty($deletefiles)){ if(!empty($deletefiles)){

3
wms/contract/composer.json

@ -12,6 +12,7 @@
} }
], ],
"require": { "require": {
"tecnickcom/tcpdf": "^6.6" "tecnickcom/tcpdf": "^6.6",
"phpoffice/phpspreadsheet": "^1.29"
} }
} }

567
wms/contract/composer.lock

@ -4,8 +4,573 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "c5a277735def820cc2b17b4a2b30976d", "content-hash": "f9ceea0f00278e84ee8bc939092d4886",
"packages": [ "packages": [
{
"name": "ezyang/htmlpurifier",
"version": "v4.17.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/bbc513d79acf6691fa9cf10f192c90dd2957f18c",
"reference": "bbc513d79acf6691fa9cf10f192c90dd2957f18c",
"shasum": ""
},
"require": {
"php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0"
},
"require-dev": {
"cerdic/css-tidy": "^1.7 || ^2.0",
"simpletest/simpletest": "dev-master"
},
"suggest": {
"cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
"ext-bcmath": "Used for unit conversion and imagecrash protection",
"ext-iconv": "Converts text to and from non-UTF-8 encodings",
"ext-tidy": "Used for pretty-printing HTML"
},
"type": "library",
"autoload": {
"files": [
"library/HTMLPurifier.composer.php"
],
"psr-0": {
"HTMLPurifier": "library/"
},
"exclude-from-classmap": [
"/library/HTMLPurifier/Language/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"support": {
"issues": "https://github.com/ezyang/htmlpurifier/issues",
"source": "https://github.com/ezyang/htmlpurifier/tree/v4.17.0"
},
"time": "2023-11-17T15:01:25+00:00"
},
{
"name": "maennchen/zipstream-php",
"version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
"reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/b8174494eda667f7d13876b4a7bfef0f62a7c0d1",
"reference": "b8174494eda667f7d13876b4a7bfef0f62a7c0d1",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-zlib": "*",
"php-64bit": "^8.1"
},
"require-dev": {
"ext-zip": "*",
"friendsofphp/php-cs-fixer": "^3.16",
"guzzlehttp/guzzle": "^7.5",
"mikey179/vfsstream": "^1.6",
"php-coveralls/php-coveralls": "^2.5",
"phpunit/phpunit": "^10.0",
"vimeo/psalm": "^5.0"
},
"suggest": {
"guzzlehttp/psr7": "^2.4",
"psr/http-message": "^2.0"
},
"type": "library",
"autoload": {
"psr-4": {
"ZipStream\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paul Duncan",
"email": "pabs@pablotron.org"
},
{
"name": "Jonatan Männchen",
"email": "jonatan@maennchen.ch"
},
{
"name": "Jesse Donat",
"email": "donatj@gmail.com"
},
{
"name": "András Kolesár",
"email": "kolesar@kolesar.hu"
}
],
"description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
"keywords": [
"stream",
"zip"
],
"support": {
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
"source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.0"
},
"funding": [
{
"url": "https://github.com/maennchen",
"type": "github"
},
{
"url": "https://opencollective.com/zipstream",
"type": "open_collective"
}
],
"time": "2023-06-21T14:59:35+00:00"
},
{
"name": "markbaker/complex",
"version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
"psr-4": {
"Complex\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with complex numbers",
"homepage": "https://github.com/MarkBaker/PHPComplex",
"keywords": [
"complex",
"mathematics"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPComplex/issues",
"source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
},
"time": "2022-12-06T16:21:08+00:00"
},
{
"name": "markbaker/matrix",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
"reference": "728434227fe21be27ff6d86621a1b13107a2562c",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
"phpcompatibility/php-compatibility": "^9.3",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "^4.0",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.7"
},
"type": "library",
"autoload": {
"psr-4": {
"Matrix\\": "classes/src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@demon-angel.eu"
}
],
"description": "PHP Class for working with matrices",
"homepage": "https://github.com/MarkBaker/PHPMatrix",
"keywords": [
"mathematics",
"matrix",
"vector"
],
"support": {
"issues": "https://github.com/MarkBaker/PHPMatrix/issues",
"source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
},
"time": "2022-12-02T22:17:43+00:00"
},
{
"name": "phpoffice/phpspreadsheet",
"version": "1.29.0",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/fde2ccf55eaef7e86021ff1acce26479160a0fa0",
"reference": "fde2ccf55eaef7e86021ff1acce26479160a0fa0",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"ezyang/htmlpurifier": "^4.15",
"maennchen/zipstream-php": "^2.1 || ^3.0",
"markbaker/complex": "^3.0",
"markbaker/matrix": "^3.0",
"php": "^7.4 || ^8.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
"dompdf/dompdf": "^1.0 || ^2.0",
"friendsofphp/php-cs-fixer": "^3.2",
"mitoteam/jpgraph": "^10.3",
"mpdf/mpdf": "^8.1.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.0 || ^10.0",
"squizlabs/php_codesniffer": "^3.7",
"tecnickcom/tcpdf": "^6.5"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"ext-intl": "PHP Internationalization Functions",
"mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Maarten Balliauw",
"homepage": "https://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "https://markbakeruk.net"
},
{
"name": "Franck Lefevre",
"homepage": "https://rootslabs.net"
},
{
"name": "Erik Tilt"
},
{
"name": "Adrien Crivelli"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"keywords": [
"OpenXML",
"excel",
"gnumeric",
"ods",
"php",
"spreadsheet",
"xls",
"xlsx"
],
"support": {
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.29.0"
},
"time": "2023-06-14T22:48:31+00:00"
},
{
"name": "psr/http-client",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-client.git",
"reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
"reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0",
"psr/http-message": "^1.0 || ^2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Client\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP clients",
"homepage": "https://github.com/php-fig/http-client",
"keywords": [
"http",
"http-client",
"psr",
"psr-18"
],
"support": {
"source": "https://github.com/php-fig/http-client"
},
"time": "2023-09-23T14:17:50+00:00"
},
{
"name": "psr/http-factory",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-factory.git",
"reference": "e616d01114759c4c489f93b099585439f795fe35"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35",
"reference": "e616d01114759c4c489f93b099585439f795fe35",
"shasum": ""
},
"require": {
"php": ">=7.0.0",
"psr/http-message": "^1.0 || ^2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interfaces for PSR-7 HTTP message factories",
"keywords": [
"factory",
"http",
"message",
"psr",
"psr-17",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-factory/tree/1.0.2"
},
"time": "2023-04-10T20:10:41+00:00"
},
{
"name": "psr/http-message",
"version": "2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/2.0"
},
"time": "2023-04-04T09:54:51+00:00"
},
{
"name": "psr/simple-cache",
"version": "3.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
"reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865",
"reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865",
"shasum": ""
},
"require": {
"php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\SimpleCache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
"keywords": [
"cache",
"caching",
"psr",
"psr-16",
"simple-cache"
],
"support": {
"source": "https://github.com/php-fig/simple-cache/tree/3.0.0"
},
"time": "2021-10-29T13:26:27+00:00"
},
{ {
"name": "tecnickcom/tcpdf", "name": "tecnickcom/tcpdf",
"version": "6.6.5", "version": "6.6.5",

476
wms/contract/contract-new-apply.php

@ -0,0 +1,476 @@
<?php
include_once("../header.php");
require_once("./conn.php");
if(!(isset($_GET['id']) && !empty($_GET['id']))){
$para = "function_name=pricereview&".$token_link;
echo "<script>alert('非法訪問!!!');</script>";
echo "<script>window.history.go(-1);</script>";
exit;
}
$id = $_GET["id"];
$sql_str = "SELECT * FROM contract_new_apply WHERE mid = :mid";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid',$id);
$stmt->execute();
$contract_new_apply = $stmt->fetch(PDO::FETCH_ASSOC);
if(empty($contract_new_apply)){
$sql_str = "SELECT pricereview_main.*, pricereview_main.id as mainid, account.name as accountname
FROM pricereview_main
JOIN account ON pricereview_main.person = account.accountid
WHERE pricereview_main.id = :id";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':id',$id);
$stmt->execute();
$contract = $stmt->fetch(PDO::FETCH_ASSOC);
$accounttype = "M";
$sql_str = "SELECT * FROM account WHERE accounttype = :accounttype";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':accounttype',$accounttype);
$stmt->execute();
$persons = $stmt->fetchAll(PDO::FETCH_ASSOC);
$sql_str = "SELECT * FROM hope_elevator_customer WHERE vol_no = :vol_no ORDER BY created_at DESC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':vol_no', $contract['contractno']);
$stmt->execute();
$customer = $stmt->fetch(PDO::FETCH_ASSOC);
$mid = $contract['mainid'];
$sql_str = "SELECT * FROM pricereview_pay WHERE mid = :mid ORDER BY pay_kind ASC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $mid);
$stmt->execute();
$pays = $stmt->fetchAll(PDO::FETCH_ASSOC);
$price_a = 0;
$price_b = 0;
foreach($pays as $pay){
if($pay['pay_kind'] <= 4){
$price_a = $price_a + $pay['pay_amount'];
}else{
$price_b = $price_b + $pay['pay_amount'];
}
}
$sql_str = "SELECT * FROM pricereview_item WHERE mid = :mid AND item_group = 'A'";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $mid);
$stmt->execute();
$items = $stmt->fetchAll(PDO::FETCH_ASSOC);
}
?>
<link rel="stylesheet" href="./styles/style.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" />
<link rel="stylesheet" href="semantic/dist/semantic.min.css">
<script defer src="./js/alpinejs/cdn.min.js"></script>
<script src="./js/axios/axios.min.js"></script>
<div class="contract-new-apply-component" x-data="contractNewApply">
<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>
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==1">
<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>
<div class="fixed" x-text="data.vol_no"></div>
<!-- <input class="form-control disabled_select" type="text" x-model="data.vol_no" > -->
<!-- <p class="alerttext" x-show="data.vol_no==''"><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" x-model="data.vat" >
<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" x-model="data.apply_date" >
<p class="alerttext" x-show="data.apply_date==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">申請類別</td>
<td style="vertical-align: middle">
<select class="" id="apply_type" x-model="data.apply_type">
<option value="A">制式新合約</option>
</select>
<p class="alerttext" x-show="data.apply_type==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">案件名稱</td>
<td style="vertical-align: middle" colspan="3">
<input class="form-control disabled_select" type="text" x-model="data.case_name" >
<p class="alerttext" x-show="data.case_name==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">立約人</td>
<td style="vertical-align: middle">
<input class="form-control disabled_select" type="text" x-model="data.company" >
<p class="alerttext" x-show="data.company==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">負責人</td>
<td style="vertical-align: middle">
<input class="form-control disabled_select" type="text" x-model="data.manager" >
<p class="alerttext" x-show="data.manager==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">含稅給約總價</td>
<td colspan="3" style="vertical-align: middle">
<input class="form-control disabled_select" type="number" x-model="data.total_price" >
<p class="alerttext" x-show="data.total_price==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">含稅貸款(A)</td>
<td style="vertical-align: middle">
<input class="form-control disabled_select" type="number" x-model="data.price_a" >
<p class="alerttext" x-show="data.price_a==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">含稅安裝款(A)</td>
<td style="vertical-align: middle">
<input class="form-control disabled_select" type="number" x-model="data.price_b" >
<p class="alerttext" x-show="data.price_b==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">聯絡地址</td>
<td style="vertical-align: middle" colspan=3>
<input class="form-control disabled_select" 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 style="vertical-align: middle" colspan=3>
<div class="ui labeled input">
<div class="ui label">
貨抵工地
</div>
<input type="text" placeholder="30" style="width:45px;padding:0 12px;" x-model="data.workdeadline_a">
<div class="ui label">
天內安裝完成,甲方應於貨底工地前
</div>
<input type="text" placeholder="7" style="width:45px;padding:0 12px;" x-model="data.workdeadline_b">
<div class="ui label">
天完成並整理完善。
</div>
</div>
<!-- <input class="form-control disabled_select" type="text" x-model="data.deadline" > -->
<p class="alerttext" x-show="data.deadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">附則</td>
<td style="vertical-align: middle" colspan=3>
<div class="ui labeled input">
<div class="ui label">
乙方應於
</div>
<input type="text" placeholder="10" style="width:45px;padding:0 12px;" x-model="data.regulations">
<div class="ui label">
天內試車完成
</div>
</div>
<p class="alerttext" x-show="data.regulations==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">免保期限</td>
<td style="vertical-align: middle" colspan=3>
<div class="ui labeled input">
<input type="text" placeholder="18" style="width:45px;padding:0 12px;" x-model="data.freedeadline">
<div class="ui label">
個月
</div>
</div>
<p class="alerttext" x-show="data.freedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">交貨地點</td>
<td style="vertical-align: middle" colspan=3>
<input class="form-control disabled_select" type="text" x-model="data.tradeaddress" >
<p class="alerttext" x-show="data.tradeaddress==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">交貨期限</td>
<td style="vertical-align: middle" colspan=3>
<div class="ui labeled input">
<div class="ui label">
圖色確認第
</div>
<input type="text" placeholder="90" style="width:45px;padding:0 12px;" x-model="data.tradedeadline">
<div class="ui label">
天出貨
</div>
</div>
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
</tbody>
</table>
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%">
<thead style="font-weight: bolder;margin-bottom: 20px">
<tr>
<td colspan="1">
<p style='text-align:center'>項次</p>
</td>
<td colspan="3">
<p style='text-align:center'>規格</p>
</td>
<td colspan="1">
<p style='text-align:center'>數量</p>
</td>
<td colspan="3">
<p style='text-align:center'>金額</p>
</td>
</tr>
</thead>
<tbody style="font-weight: bolder;margin-bottom: 20px">
<template x-for="(item, idx) in data.items">
<tr>
<td style="vertical-align: middle"><p x-text="idx+1"></p></td>
<td colspan="3" style="vertical-align: middle">
<input class="form-control disabled_select" type="text" x-model="item.item_spec" >
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">
<input class="form-control disabled_select" type="number" x-model="item.item_qty" >
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td colspan="3" style="vertical-align: middle">
<input class="form-control disabled_select" type="number" x-model="item.item_price_ct" >
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
</template>
</tbody>
</table>
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%">
<thead style="font-weight: bolder;margin-bottom: 20px">
<tr>
<td>
<p style='text-align:center'>合約類別</p>
</td>
<td>
<p style='text-align:center'>款別</p>
</td>
<td>
<p style='text-align:center'>條件名稱</p>
</td>
<td>
<p style='text-align:center'>收款條件日期區分</p>
</td>
<td>
<p style='text-align:center'>條件日期</p>
</td>
<td>
<p style='text-align:center'>票期</p>
</td>
<td>
<p style='text-align:center'>付款比率</p>
</td>
<td>
<p style='text-align:center'>金額</p>
</td>
</tr>
</thead>
<tbody style="font-weight: bolder;margin-bottom: 20px" >
<?php
$day = 0;
$styles = [
1=> "訂金",
2=> "二次款",
3=>"貨到款",
4=>"",
5=>"安裝款",
6=>"尾款",
7=>"",
];
$paydate = [
1=>"合約日",
2=>"合約日",
3=>"出貨日",
4=>"",
5=>"竣檢日",
6=>"交車日",
7=>""
];
?>
<?php foreach($pays as $pay):
if($pay['pay_scale'] == 0) continue;
?>
<tr>
<td>
<p style='text-align:center'><?php echo ($pay['pay_kind'] <=4) ? "銷售" : "按裝"; ?></p>
</td>
<td>
<p style='text-align:center'><?php echo $styles[$pay['pay_kind']]; ?></p>
</td>
<td>
<?php if($pay['pay_kind'] == 1){ ?>
<template x-if="pays[1] > 0">
<p style='text-align:center'>簽約後<span x-text="pays[1]"></span>天付訂金</p>
</template>
<template x-if="pays[1] <= 0">
<p style='text-align:center'>簽約後付訂金</p>
</template>
<?php } elseif($pay['pay_kind'] == 2){ ?>
<template x-if="pays[2] > 0">
<p style='text-align:center'>簽約後<span x-text="pays[2]"></span>天付二次款</p>
</template>
<template x-if="pays[2] <= 0">
<p style='text-align:center'>簽約後付二次款</p>
</template>
<?php } elseif($pay['pay_kind'] == 3){ ?>
<p style='text-align:center'>貨抵工地付貨到款</p>
<?php } elseif($pay['pay_kind'] == 5){ ?>
<template x-if="pays[5] > 0">
<p style='text-align:center'>安裝完成後<span x-text="pays[5]"></span>天收款</p>
</template>
<template x-if="pays[5] <= 0">
<p style='text-align:center'>安裝完成後收款</p>
</template>
<?php } elseif($pay['pay_kind'] == 6){ ?>
<template x-if="pays[6] > 0">
<p style='text-align:center'>交車後<span x-text="pays[6]"></span>天付尾款</p>
</template>
<template x-if="pays[6] <= 0">
<p style='text-align:center'>交車後付尾款</p>
</template>
<?php } else{ ?>
<p style='text-align:center'>-</p>
<?php } ?>
</td>
<td>
<p style='text-align:center'><?php echo $paydate[$pay['pay_kind']]; ?></p>
</td>
<td>
<div class="ui labeled input">
<input type="number" placeholder="90" style="width:45px;padding:0 12px;" x-model="pays[<?php echo $pay['pay_kind'];?>]">
<div class="ui label">
</div>
</div>
</td>
<td>
<div class="ui labeled input">
<input type="number" placeholder="90" style="width:45px;padding:0 12px;" x-model="tickets[<?php echo $pay['pay_kind'];?>]">
<div class="ui label">
</div>
</div>
</td>
<td>
<p style='text-align:center'><?php echo $pay['pay_scale'] ?>%</p>
</td>
<td>
<p style='text-align:center' x-text="localnumber(data.total_price * <?php echo $pay['pay_scale']/100 ?>)"></p>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%">
<thead style="font-weight: bolder;margin-bottom: 20px;">
<tr>
<td colspan=8>
<h4 style='text-align:center;font-weight: bolder'>簽核流程</h4>
</td>
</tr>
</thead>
<tbody>
<tr>
<td style="font-weight:bold">業務部協理</td>
<td>
<template x-if="false">
<span class="failtext">已退件</span>
</template>
<template x-if="false">
<span class="readtext">審核中</span>
</template>
<template x-if="false">
<span class="successtext">已通過</span>
</template>
</td>
<td style="font-weight:bold">業務部承辦人</td>
<td>
<template x-if="false">
<span class="failtext">已退件</span>
</template>
<template x-if="false">
<span class="readtext">審核中</span>
</template>
<template x-if="false">
<span class="successtext">已通過</span>
</template>
</td>
<td style="font-weight:bold">營業經理</td>
<td>
<template x-if="false">
<span class="failtext">已退件</span>
</template>
<template x-if="false">
<span class="readtext">審核中</span>
</template>
<template x-if="false">
<span class="successtext">已通過</span>
</template>
</td>
<td style="font-weight:bold">營業員</td>
<td><span x-text="data.salesmanname + '(' + data.salesman + ')'"></span></td>
</tr>
</tbody>
</table>
<button x-show="true" x-on:click="" :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="true" x-on:click="storageFn()" :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 contractno = '<?php echo $contract['contractno'] ?>';
const salesman = '<?php echo $contract['person'] ?>';
const salesmanname = '<?php echo $contract['accountname'] ?>';
const apply_date = '<?php echo date('Y-m-d') ?>';
const case_name = '<?php echo $contract['case_name'] ?>';
const company = '<?php echo $contract['company'] ?>';
const manager = '<?php echo $customer['manager'] ?>';
const vat = '<?php echo $customer['uscc'] ?>';
const price_total = <?php echo $contract['price_total'] ?>;
const address = '<?php echo $contract['address'] ?>';
const price_a = <?php echo $price_a; ?>;
const price_b = <?php echo $price_b; ?>;
const items = [...<?php echo json_encode($items); ?>];
const user_id = '<?php echo $user_id ?>';
const mid = '<?php echo $_GET['id']; ?>';
console.log(items)
</script>

34
wms/contract/contract-newelevator-edit.php

@ -54,6 +54,7 @@ $persons = array_map(function($person){
files:<?php echo $files; ?>, files:<?php echo $files; ?>,
newfiles:[], newfiles:[],
deletefiles:[], deletefiles:[],
qc:"<?php echo $contract["qc_official_type"]; ?>",
files_id: "<?php echo $contract["files_id"]; ?>", files_id: "<?php echo $contract["files_id"]; ?>",
}, },
fail_arr:[], fail_arr:[],
@ -74,11 +75,13 @@ $persons = array_map(function($person){
form.append("case_name", this.data.case_name); form.append("case_name", this.data.case_name);
form.append("linkman", this.data.linkman); form.append("linkman", this.data.linkman);
form.append("lm_tel", this.data.lm_tel); form.append("lm_tel", this.data.lm_tel);
form.append("address", this.data.address); form.append("address", this.data.address);user_id
form.append("salesman", this.data.salesman); form.append("salesman", this.data.salesman);
form.append("qc", this.data.qc);
form.append("deletefiles", this.data.deletefiles); form.append("deletefiles", this.data.deletefiles);
form.append("files_id", this.data.files_id); form.append("files_id", this.data.files_id);
form.append("user_id", "<?php echo $user_id; ?>"); form.append("user_id", "<?php echo $user_id; ?>");
form.append("", "<?php echo $user_id; ?>");
for (var i = 0; i < this.data.newfiles.length; i++) { for (var i = 0; i < this.data.newfiles.length; i++) {
form.append("files[]", this.data.newfiles[i]); form.append("files[]", this.data.newfiles[i]);
@ -87,19 +90,8 @@ $persons = array_map(function($person){
axios.post("./api/putContractData.php", form).then(res=>{ axios.post("./api/putContractData.php", form).then(res=>{
console.log(res.data) console.log(res.data)
if(res.status === 200){ if(res.status === 200){
alert("更新成功") alert("更新成功");
this.step = 1 window.location.reload();
this.data.contractno=""
this.data.customer=""
this.data.manager=""
this.data.vat=""
this.data.case_name=""
this.data.linkman=""
this.data.lm_tel=""
this.data.address=""
this.data.salesman=""
this.data.files=[]
this.customize = false
} }
this.isLoading = false this.isLoading = false
}).catch(error=>{ }).catch(error=>{
@ -186,8 +178,18 @@ $persons = array_map(function($person){
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.lm_tel" > <input class="form-control disabled_select" type="text" name="uscc" x-model="data.lm_tel" >
<p class="alerttext" x-show="data.lm_tel==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> <p class="alerttext" x-show="data.lm_tel==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td> </td>
<td style="vertical-align: middle">QC和官檢</td>
<td>
<select class="" id="qc" x-model="data.qc">
<option value="">請選擇QC或官檢</option>
<option value="Q">只需QC</option>
<option value="O">只需官檢</option>
<option value="QO">QC和官檢</option>
</select>
<p class="alerttext" x-show="data.qc==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">案件名稱</td> <td style="vertical-align: middle">案件名稱</td>
<td colspan=3> <td>
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.case_name" > <input class="form-control disabled_select" type="text" name="uscc" x-model="data.case_name" >
<p class="alerttext" x-show="data.case_name==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> <p class="alerttext" x-show="data.case_name==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td> </td>
@ -239,6 +241,8 @@ $persons = array_map(function($person){
<script src="semantic/dist/semantic.min.js" ></script> <script src="semantic/dist/semantic.min.js" ></script>
<script> <script>
const user_id = '<?php echo $user_id; ?>';
const user_name = '<?php echo $user_name; ?>';
$('#table_index').DataTable( $('#table_index').DataTable(
{ {
"order": [ "order": [

17
wms/contract/contract-newelevator-input.php

@ -1,5 +1,5 @@
<?php <?php
include("../header.php"); include_once("../header.php");
require_once("./conn.php"); require_once("./conn.php");
$accounttype = "M"; $accounttype = "M";
$sql_str = "SELECT accountid, name FROM account WHERE accounttype = :accounttype"; $sql_str = "SELECT accountid, name FROM account WHERE accounttype = :accounttype";
@ -99,8 +99,18 @@ $persons = array_map(function($person){
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.lm_tel" > <input class="form-control disabled_select" type="text" name="uscc" x-model="data.lm_tel" >
<p class="alerttext" x-show="data.lm_tel==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> <p class="alerttext" x-show="data.lm_tel==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td> </td>
<td style="vertical-align: middle">QC和官檢</td>
<td>
<select class="" id="qc" x-model="data.qc">
<option value="">請選擇QC或官檢</option>
<option value="Q">只需QC</option>
<option value="O">只需官檢</option>
<option value="QO">QC和官檢</option>
</select>
<p class="alerttext" x-show="data.qc==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">案件名稱</td> <td style="vertical-align: middle">案件名稱</td>
<td colspan=3> <td >
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.case_name" > <input class="form-control disabled_select" type="text" name="uscc" x-model="data.case_name" >
<p class="alerttext" x-show="data.case_name==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> <p class="alerttext" x-show="data.case_name==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td> </td>
@ -111,8 +121,9 @@ $persons = array_map(function($person){
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.address" > <input class="form-control disabled_select" type="text" name="uscc" x-model="data.address" >
<p class="alerttext" x-show="data.address==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> <p class="alerttext" x-show="data.address==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td> </td>
<td style="vertical-align: middle">附件上傳</td> <td style="vertical-align: middle">附件上傳</td>
<td colspan=3> <td colspan="3">
<input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" /> <input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" />
</td> </td>
</tr> </tr>

168
wms/contract/insertData.php

@ -0,0 +1,168 @@
<?php
require_once('./conn.php');
require 'vendor/autoload.php';
ini_set ( 'date.timezone' , 'Asia/Taipei' );
$id = $_GET['id'];
use PhpOffice\PhpSpreadsheet\IOFactory;
// 指定要讀取的 Excel 文件
$filePath = './option/option'.$id.'.xlsx';
// 嘗試讀取文件
try {
$spreadsheet = IOFactory::load($filePath);
} catch (\PhpOffice\PhpSpreadsheet\Reader\Exception $e) {
die('Error loading file: ' . $e->getMessage());
}
// 獲取活動工作表
$sheet = $spreadsheet->getActiveSheet();
$create_at = date('Y-m-d H:i:s');
$sql_str = "INSERT INTO option_price (kind, subkind, group_name, spec, memo, optional, unit, price, status, create_at) VALUES (:kind, :subkind, :group_name, :spec, :memo, :optional, :unit, :price, :status, :create_at)";
$sql_str_mi = "INSERT INTO option_mi (option_price_id, min_weight, max_weight, open_kind, base_floor, base_floor_plus, price, quotation_no, create_at) VALUES (:option_price_id, :min_weight, :max_weight, :open_kind, :base_floor, :base_floor_plus, :price, :quotation_no, :create_at)";
$open_kind_arr = ['CO', '2S'];
// 遍歷工作表中的每一行
foreach ($sheet->getRowIterator() as $key=>$row) {
// 獲得單元格迭代器
$cellIterator = $row->getCellIterator();
$cellIterator->setIterateOnlyExistingCells(false); // This loops through all cells,
// even if a cell value is not set.
// By default, only cells that have a value set will be iterated.
foreach ($cellIterator as $idx=>$cell) {
if ($cell !== null) {
// 打印單元格數據
// echo $cell->getValue() . '///';
}
if($idx == 'B'){
$group_name = $cell->getValue();
echo $group_name;
}elseif($idx == 'C'){
$spec = $cell->getValue();
echo $spec;
}elseif($idx == 'D'){
$memo = $cell->getValue();
echo $memo;
}elseif($idx == 'E'){
if($cell->getValue() == "標配"){
$optional = 1;
}else{
$optional = 2;
}
echo $optional;
}elseif($idx == 'F'){
$cost = $cell->getValue();
}
elseif($idx == 'G'){
$price = $cell->getValue();
echo $price;
}elseif($idx == 'H'){
$unit = $cell->getValue();
echo $unit;
}
}
echo "<br>"; // 換行,以分隔不同的行
$status = "Y";
$kindArr = ['A', 'B','C', 'D'];
if($id == 1){
$kind = 'A';
$subkind = 'A1';
}elseif($id == 2){
$kind = 'B';
$subkind = 'B1';
}elseif($id == 3){
$kind = 'B';
$subkind = 'B2';
}elseif($id == 4){
$kind ='B';
$subkind = 'B3';
}elseif($id == 5){
$kind ='B';
$subkind = 'B4';
}elseif($id == 6){
$kind ='B';
$subkind = 'B5';
}elseif($id == 7){
$kind ='B';
$subkind = 'B6';
}elseif($id == 8){
$kind ='B';
$subkind = 'B7';
}elseif($id == 9){
$kind ='C';
$subkind = 'C1';
}elseif($id == 10){
$kind ='C';
$subkind = 'C2';
}elseif($id == 11){
$kind ='C';
$subkind = 'C3';
}elseif($id == 12){
$kind ='C';
$subkind = 'C4';
}elseif($id == 13){
$kind ='D';
$subkind = 'D1';
}elseif($id == 14){
$kind ='D';
$subkind = 'D2';
}elseif($id == 15){
$kind ='B';
$subkind = 'B1';
}
if(isset($_GET['id'])){
try{
$stmt = $conn -> prepare($sql_str);
$stmt ->bindParam(':kind', $kind);
$stmt ->bindParam(':subkind', $subkind);
$stmt ->bindParam(':group_name', $group_name);
$stmt ->bindParam(':spec', $spec);
$stmt ->bindParam(':memo', $memo);
$stmt ->bindParam(':optional', $optional);
$stmt ->bindParam(':unit', $unit);
$stmt ->bindParam(':price', $price);
$stmt ->bindParam(':status', $status);
$stmt ->bindParam(':create_at', $create_at);
// 遍歷當前行的每一個單元格
$stmt ->execute();
$last_id = $conn->lastInsertId();
$option_price_id = $last_id;
$option_price = $cost;
$quotation_no = 'Q2311001';
foreach($open_kind_arr as $kind){
$min_weight = 1;
$max_weight = 1600;
$open_kind = $kind;
$base_floor = 0;
$base_floor_plus = 0;
$sale_price = $option_price;
$stmt = $conn -> prepare($sql_str_mi);
$stmt ->bindParam(':option_price_id', $option_price_id);
$stmt ->bindParam(':min_weight', $min_weight);
$stmt ->bindParam(':max_weight', $max_weight);
$stmt ->bindParam(':open_kind', $open_kind);
$stmt ->bindParam(':base_floor', $base_floor);
$stmt ->bindParam(':base_floor_plus', $base_floor_plus);
$stmt ->bindParam(':price', $sale_price);
$stmt ->bindParam(':quotation_no', $quotation_no);
$stmt ->bindParam(':create_at', $create_at);
$stmt ->execute();
}
}catch(PDOException $e){
echo $e->getMessage();
die('Error!:'.$e->getMessage());
}
}
}
?>

92
wms/contract/js/alpine.js

@ -812,6 +812,7 @@ const contractNewInput =()=> {
lm_tel:'', lm_tel:'',
address:'', address:'',
salesman:'', salesman:'',
qc:'',
files:[], files:[],
}, },
step:1, step:1,
@ -853,6 +854,7 @@ const contractNewInput =()=> {
this.data.lm_tel = res.data.lm_tel this.data.lm_tel = res.data.lm_tel
this.data.address = res.data.address this.data.address = res.data.address
this.data.salesman = res.data.salesman this.data.salesman = res.data.salesman
this.data.qc = res.data.qc
} }
this.step = 2 this.step = 2
this.isLoading = false this.isLoading = false
@ -873,6 +875,7 @@ const contractNewInput =()=> {
form.append('lm_tel', this.data.lm_tel); form.append('lm_tel', this.data.lm_tel);
form.append('address', this.data.address); form.append('address', this.data.address);
form.append('salesman', this.data.salesman); form.append('salesman', this.data.salesman);
form.append('qc', this.data.qc);
form.append('contracttype', 'm'); form.append('contracttype', 'm');
form.append('user_id', user_id); form.append('user_id', user_id);
for (var i = 0; i < this.data.files.length; i++) { for (var i = 0; i < this.data.files.length; i++) {
@ -892,6 +895,7 @@ const contractNewInput =()=> {
this.data.lm_tel='' this.data.lm_tel=''
this.data.address='' this.data.address=''
this.data.salesman='' this.data.salesman=''
this.data.qc=''
this.data.files=[] this.data.files=[]
this.customize = false this.customize = false
@ -1165,5 +1169,91 @@ const contractInput =()=> {
this.data.files = e.target.files this.data.files = e.target.files
}, },
} }
}; };
const contractNewApply = ()=>{
return {
step:1,
isLoading:false,
data:{
mid: mid,
vol_no: contractno,
salesman: salesman,
salesmanname:salesmanname,
apply_date: apply_date,
apply_type:'A',
case_name: case_name,
company: company,
manager: manager,
vat: vat,
total_price: price_total,
price_a: price_a,
price_b: price_b,
address: address,
workdeadline_a:30, //完工期限: 幾天內安裝完成,預設30
workdeadline_b:7, //完工期限: 幾天內整理完善,預設7
regulations:10, //附則
freedeadline:18, //免保期限(月)
tradeaddress:'', //交貨地點
tradedeadline: 90, //交貨期限
items: items,
},
pays:{
1:0,
2:0,
3:0,
4:0,
5:0,
6:0,
7:0,
},
tickets:{
1:0,
2:0,
3:0,
4:0,
5:0,
6:0,
7:0,
},
localnumber(num){
return num.toLocaleString();
},
storageFn(){
this.isLoading = true
const isFirst = 1;
const form = new FormData();
form.append('mid', this.data.mid);
form.append('vol_no', this.data.vol_no);
form.append('salesman', this.data.salesman);
form.append('apply_date', this.data.apply_date);
form.append('apply_type', this.data.apply_type);
form.append('case_name', this.data.case_name);
form.append('company', this.data.company);
form.append('manager', this.data.manager);
form.append('vat', this.data.vat);
form.append('total_price', this.data.total_price);
form.append('price_a', this.data.price_a);
form.append('price_b', this.data.price_b);
form.append('address', this.data.address);
form.append('workdeadline_a', this.data.workdeadline_a);
form.append('workdeadline_b', this.data.workdeadline_b);
form.append('regulations', this.data.regulations);
form.append('freedeadline', this.data.freedeadline);
form.append('tradeaddress', this.data.tradeaddress);
form.append('tradedeadline', this.data.tradedeadline);
form.append('isFirst', isFirst);
form.append('user_id', user_id);
axios.post('./api/postContractNewApplyData.php', form).then(res=>{
if(res.status === 200){
alert('暫存成功');
console.log(res.data);
}
this.isLoading = false
}).catch(error=>{
alert('儲存失敗!可能為以下錯誤:\n' + error.response.data)
this.isLoading = false
})
}
}
}

62
wms/contract/styles/style.css

@ -541,14 +541,14 @@ main table td, main table th {
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.contract-input-component .form, .contract-management .form { .contract-input-component .form, .contract-management .form, .contract-new-apply-component .form {
margin: 0 auto; margin: 0 auto;
} }
.contract-input-component .form .dropdown, .contract-management .form .dropdown { .contract-input-component .form .dropdown, .contract-management .form .dropdown, .contract-new-apply-component .form .dropdown {
width: 100%; width: 100%;
margin-top: 7px; margin-top: 7px;
} }
.contract-input-component .form .savebtn, .contract-management .form .savebtn { .contract-input-component .form .savebtn, .contract-management .form .savebtn, .contract-new-apply-component .form .savebtn {
margin-right: 13px; margin-right: 13px;
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -557,7 +557,11 @@ main table td, main table th {
height: 45px; height: 45px;
font-size: 15px; font-size: 15px;
} }
.contract-input-component .form table .alerttext, .contract-management .form table .alerttext { .contract-input-component .form table .fixed, .contract-management .form table .fixed, .contract-new-apply-component .form table .fixed {
padding: 8px 0;
cursor: not-allowed;
}
.contract-input-component .form table .alerttext, .contract-management .form table .alerttext, .contract-new-apply-component .form table .alerttext {
font-size: 13px; font-size: 13px;
color: #a00; color: #a00;
font-weight: 500; font-weight: 500;
@ -565,64 +569,86 @@ main table td, main table th {
font-weight: 900; font-weight: 900;
padding: 0; padding: 0;
} }
.contract-input-component .form input[type=file], .contract-management .form input[type=file] { .contract-input-component .form input[type=file], .contract-management .form input[type=file], .contract-new-apply-component .form input[type=file] {
padding: 12px 20px; padding: 12px 20px;
margin: 8px 0; margin: 8px 0;
} }
.contract-input-component .error, .contract-management .error { .contract-input-component .form span, .contract-management .form span, .contract-new-apply-component .form span {
font-weight: 900;
}
.contract-input-component .form span.successtext, .contract-management .form span.successtext, .contract-new-apply-component .form span.successtext {
color: #0a0;
}
.contract-input-component .form span.failtext, .contract-management .form span.failtext, .contract-new-apply-component .form span.failtext {
color: #a00;
}
.contract-input-component .form span.readtext, .contract-management .form span.readtext, .contract-new-apply-component .form span.readtext {
color: #aa0;
}
.contract-input-component .form input[type=number]::-webkit-outer-spin-button,
.contract-input-component .form input[type=number]::-webkit-inner-spin-button, .contract-management .form input[type=number]::-webkit-outer-spin-button,
.contract-management .form input[type=number]::-webkit-inner-spin-button, .contract-new-apply-component .form input[type=number]::-webkit-outer-spin-button,
.contract-new-apply-component .form input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.contract-input-component .form input[type=number], .contract-management .form input[type=number], .contract-new-apply-component .form input[type=number] {
-moz-appearance: textfield;
}
.contract-input-component .error, .contract-management .error, .contract-new-apply-component .error {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 15px; margin: 15px;
} }
.contract-input-component .error .errortext, .contract-management .error .errortext { .contract-input-component .error .errortext, .contract-management .error .errortext, .contract-new-apply-component .error .errortext {
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
color: #a00; color: #a00;
} }
.contract-input-component .input-group-btn, .contract-management .input-group-btn { .contract-input-component .input-group-btn, .contract-management .input-group-btn, .contract-new-apply-component .input-group-btn {
font-size: 16px; font-size: 16px;
} }
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
.contract-input-component table, .contract-management table { .contract-input-component table, .contract-management table, .contract-new-apply-component table {
border: 0; border: 0;
} }
.contract-input-component table thead, .contract-management table thead { .contract-input-component table thead, .contract-management table thead, .contract-new-apply-component table thead {
display: none; display: none;
} }
.contract-input-component table tr, .contract-management table tr { .contract-input-component table tr, .contract-management table tr, .contract-new-apply-component table tr {
margin-bottom: 10px; margin-bottom: 10px;
display: block; display: block;
border-bottom: 2px solid #ddd; border-bottom: 2px solid #ddd;
} }
.contract-input-component table td, .contract-management table td { .contract-input-component table td, .contract-management table td, .contract-new-apply-component table td {
display: block; display: block;
text-align: left; text-align: left;
font-size: 14px; font-size: 14px;
border-bottom: 1px dotted #ccc; border-bottom: 1px dotted #ccc;
} }
.contract-input-component table td:last-child, .contract-management table td:last-child { .contract-input-component table td:last-child, .contract-management table td:last-child, .contract-new-apply-component table td:last-child {
border-bottom: 0; border-bottom: 0;
} }
.contract-input-component table td:before, .contract-management table td:before { .contract-input-component table td:before, .contract-management table td:before, .contract-new-apply-component table td:before {
content: attr(data-label); content: attr(data-label);
float: left; float: left;
text-transform: uppercase; text-transform: uppercase;
font-weight: bold; font-weight: bold;
} }
} }
.contract-input-component .images, .contract-management .images { .contract-input-component .images, .contract-management .images, .contract-new-apply-component .images {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
padding: 20px; padding: 20px;
} }
.contract-input-component .images > .image, .contract-management .images > .image { .contract-input-component .images > .image, .contract-management .images > .image, .contract-new-apply-component .images > .image {
position: relative; position: relative;
margin: 10px; margin: 10px;
} }
.contract-input-component .images > .image:hover > i, .contract-management .images > .image:hover > i { .contract-input-component .images > .image:hover > i, .contract-management .images > .image:hover > i, .contract-new-apply-component .images > .image:hover > i {
opacity: 1; opacity: 1;
} }
.contract-input-component .images > .image > i, .contract-management .images > .image > i { .contract-input-component .images > .image > i, .contract-management .images > .image > i, .contract-new-apply-component .images > .image > i {
position: absolute; position: absolute;
top: -12px; top: -12px;
right: -12px; right: -12px;

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

File diff suppressed because one or more lines are too long

26
wms/contract/styles/style.scss

@ -562,7 +562,7 @@ main{
0% { transform: rotate(0deg); } 0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); } 100% { transform: rotate(360deg); }
} }
.contract-input-component, .contract-management{ .contract-input-component, .contract-management, .contract-new-apply-component{
.form{ .form{
margin:0 auto; margin:0 auto;
.dropdown{ .dropdown{
@ -579,6 +579,10 @@ main{
font-size: 15px; font-size: 15px;
} }
table{ table{
.fixed{
padding: 8px 0;
cursor: not-allowed;
}
.alerttext{ .alerttext{
font-size: 13px; font-size: 13px;
color:#a00; color:#a00;
@ -592,6 +596,26 @@ main{
padding: 12px 20px; padding: 12px 20px;
margin: 8px 0; 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{ .error{
display: flex; display: flex;

BIN
wms/mkt/assets/img/1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

BIN
wms/mkt/assets/img/2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
wms/mkt/assets/img/3.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
wms/mkt/assets/img/4.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
wms/mkt/assets/img/5.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

BIN
wms/mkt/assets/img/S__14541066.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

BIN
wms/mkt/assets/img/curry.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

193
wms/mkt/assets/js/alpine.js

@ -0,0 +1,193 @@
const priceOptionIndex = ()=>{
return {
init(){
this.renderPagination();
this.initButtons(this.kind);
this.options = this.options.slice(0, this.pageLength)
},
kind: kind,
pageLength: 50,
search: '',
orioptions: options,
options: options,
options_arr: {
1:'標',
2:'選',
},
btntype:1,
buttons:[],
pageLength: 50,
currentpage:1,
dataLangth:options.length,
search: '',
pageNumber:1,
initButtons(kind){
if(kind == 'A'){
this.buttons = [
{name: '車廂意匠', type: 'A1'}
]
}else if(kind == 'B'){
this.buttons = [
{name: '天井', type: 'B1'},
{name: '地板', type: 'B2'},
{name: '操縱盤', type: 'B3'},
{name: '扶手', type: 'B4'},
{name: '車廂門與層門(轎門/層門)', type: 'B5'},
{name: '轎壁(車廂側板)', type: 'B6'},
{name: '其他車廂內裝配件', type: 'B7'},
]
}else if(kind == 'C'){
this.buttons = [
{name: '框', type: 'C1'},
{name: '乘場指示器', type: 'C2'},
{name: '燈', type: 'C3'},
{name: '方式與門', type: 'C4'},
]
}else if(kind == 'D'){
this.buttons = [
{name: '功能與配置', type: 'D1'},
{name: 'OH與樓高', type: 'D2'},
]
}else if(kind == 'E'){
this.buttons = [
{name: '平台梯', type: 'E1'},
]
}
this.buttons.unshift({
name:'顯示全部',type:'1',
})
this.btntype = this.buttons[0].type;
},
changeType(type=this.btntype){
this.currentpage = 1
this.btntype = type;
this.options = this.orioptions;
this.options = this.getOptions();
this.inputSearch()
},
getOptions(start=0, end=this.pageLength){
if(this.btntype != 1){
return this.options.filter(item=>(item.subkind == this.btntype)).slice(start, end)
}
return this.options.slice(start, end);
},
inputSearch(e=null){
let text = e!=null ? e.target.value : this.search;
this.search = text.toLowerCase();
if(text != ''){
this.currentpage = 1;
this.options = this.orioptions
this.options = this.options.filter(item=>{
if(item.subkind == this.btntype || this.btntype == 1){
if(item.group_name == null) item.group_name = ''
if(item.spec == null) item.spec = ''
if(item.memo == null) item.memo = ''
if(item.price == null) item.price = 0
return (item.group_name.toLowerCase().includes(text.toLowerCase()) || item.spec.toLowerCase().includes(text.toLowerCase()) || item.memo.toLowerCase().includes(text.toLowerCase()) || String(item.price).includes(text.toLowerCase())) ;
}
}).slice((Number(this.currentpage)-1)*Number(this.pageLength), (Number(this.currentpage)-1)*Number(this.pageLength) + Number(this.pageLength))
this.dataLangth = this.options.length
}else{
this.options = this.orioptions
if(this.btntype == 1){
this.options = this.options.filter(item=> item.kind == this.kind)
}else{
this.options = this.options.filter(item=> (item.subkind == this.btntype))
}
if(this.btntype == 1){
this.dataLangth = this.orioptions.filter(item=> (item.kind == this.kind)).length
}else{
this.dataLangth = this.orioptions.filter(item=> (item.subkind == this.btntype)).length
}
this.options = this.options.slice((Number(this.currentpage)-1)*Number(this.pageLength), (Number(this.currentpage)-1)*Number(this.pageLength) + Number(this.pageLength))
}
this.pageNumber = Math.ceil(Number(this.dataLangth)/Number(this.pageLength))
this.pageNumberArr = []
for(let i=0;i<this.pageNumber;i++){
this.pageNumberArr.push({page:i+1, disabled:false})
}
},
renderPagination(){
this.inputSearch();
},
switchPage(page){
if(page == '...') return
this.currentpage = page
this.renderPagination()
},
selectPage(e){
this.currentpage = e.target.value
this.renderPagination()
}
}
}
const priceOptionSelect = ()=>{
return {
init(){
this.renderPagination();
this.options = this.options.slice(0, this.pageLength)
},
orioptions: options,
options: options,
options_arr: {
1:'標',
2:'選',
},
btntype:1,
buttons:[],
pageLength: 50,
currentpage:1,
dataLangth:options.length,
search: '',
pageNumber:1,
startpage:0,
endpage:this.startpage + this.pageLength,
pageNumberArr:[],
changeType(){
this.options = this.orioptions;
this.options = this.getOptions();
this.inputSearch()
},
getOptions(start=0, end=this.pageLength){
return this.options.slice(start, end);
},
inputSearch(e=null){
let text = e!=null ? e.target.value : this.search;
this.search = text.toLowerCase();
if(text != ''){
this.currentpage = 1;
this.options = this.orioptions
this.options = this.options.filter(item=>{
if(item.group_name == null) item.group_name = ''
if(item.spec == null) item.spec = ''
if(item.memo == null) item.memo = ''
if(item.price == null) item.price = 0
return (item.group_name.toLowerCase().includes(text.toLowerCase()) || item.spec.toLowerCase().includes(text.toLowerCase()) || item.memo.toLowerCase().includes(text.toLowerCase()) || String(item.price).includes(text.toLowerCase())) ;
}).slice((Number(this.currentpage)-1)*Number(this.pageLength), (Number(this.currentpage)-1)*Number(this.pageLength) + Number(this.pageLength))
this.dataLangth = this.options.length
}else{
this.options = this.orioptions
this.options = this.options.slice((Number(this.currentpage)-1)*Number(this.pageLength), (Number(this.currentpage)-1)*Number(this.pageLength) + Number(this.pageLength))
this.dataLangth = this.orioptions.length
}
this.pageNumber = Math.ceil(Number(this.dataLangth)/Number(this.pageLength))
this.pageNumberArr = []
for(let i=0;i<this.pageNumber;i++){
this.pageNumberArr.push({page:i+1, disabled:false})
}
},
renderPagination(){
this.inputSearch();
},
switchPage(page){
if(page == '...') return
this.currentpage = page
this.renderPagination()
},
selectPage(e){
this.currentpage = e.target.value
this.renderPagination()
}
}
}

49
wms/mkt/conn.php

@ -0,0 +1,49 @@
<?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'; //設定字元編碼
// $db_hostname = 'localhost'; //資料庫主機名稱
// $db_username = 'masadaroot'; //登入資料庫的管理者的帳號
// $db_password = 'x6h5E5p#u8y'; //登入密碼
// $db_name = 'appwms'; //使用的資料庫
// $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; //關閉資料庫的連線

122
wms/mkt/css/style.css

@ -0,0 +1,122 @@
.price_option-select {
width: 100%;
margin: 0 auto;
display: flex;
}
.price_option-select > .sidebar {
padding: 20px;
width: 15%;
min-width: 180px;
height: auto;
min-height: 80vh;
display: flex;
flex-direction: column;
border-right: 1px #ccc solid;
}
.price_option-select > .sidebar > a {
margin: 6px 0;
transition: 0.3s;
color: #666;
}
.price_option-select > .sidebar > a:hover {
color: #000;
}
.price_option-select > .sidebar > a.active {
color: #000;
font-weight: 700;
}
.price_option-select > .options {
width: 85%;
}
.price_option-select > .options > div {
width: 80%;
margin: 0 auto;
}
.price_option-select > .options > div.container {
margin-bottom: 16px;
}
.price_option-index {
width: 100%;
margin: 0 auto;
width: 100%;
margin: 0 auto;
display: flex;
}
.price_option-index > .sidebar {
padding: 20px;
width: 15%;
min-width: 180px;
height: auto;
min-height: 80vh;
display: flex;
flex-direction: column;
border-right: 1px #ccc solid;
}
.price_option-index > .sidebar > a {
margin: 6px 0;
transition: 0.3s;
color: #666;
}
.price_option-index > .sidebar > a:hover {
color: #000;
}
.price_option-index > .sidebar > a.active {
color: #000;
font-weight: 700;
}
.price_option-index > .options {
width: 85%;
}
.price_option-index > .options > div {
width: 80%;
margin: 0 auto;
}
.price_option-index > .options > div.container {
margin-bottom: 16px;
}
.btn-secondary {
background-color: #6C757D;
}
.text-light {
color: #fff;
}
.pagination {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 15px;
}
.pagination small {
color: #111;
font-size: 13px;
}
.pagination .links {
display: flex;
align-items: center;
justify-content: center;
}
.pagination a {
color: black;
float: left;
padding: 8px 16px;
text-decoration: none;
transition: background-color 0.3s;
}
.pagination a.active {
background-color: #1E74FD;
color: white;
border-radius: 5px;
}
.pagination a:hover:not(.active) {
background-color: #ddd;
}
.pagination a.disabled {
cursor: not-allowed;
}
.pagination a.disabled:hover:not(.active) {
background-color: transparent;
}/*# sourceMappingURL=style.css.map */

1
wms/mkt/css/style.css.map

@ -0,0 +1 @@
{"version":3,"sources":["style.scss","style.css"],"names":[],"mappings":"AAAA;EACI,WAAA;EACA,cAAA;EACA,aAAA;ACCJ;ADAI;EACI,aAAA;EACA,UAAA;EACA,gBAAA;EACA,YAAA;EACA,gBAAA;EACA,aAAA;EACA,sBAAA;EACA,4BAAA;ACER;ADDQ;EACI,aAAA;EACA,gBAAA;EACA,WAAA;ACGZ;ADFY;EACI,WAAA;ACIhB;ADFY;EACI,WAAA;EACA,gBAAA;ACIhB;ADAI;EACI,UAAA;ACER;ADDQ;EACI,UAAA;EACA,cAAA;ACGZ;ADFY;EACI,mBAAA;ACIhB;;ADCA;EACI,WAAA;EACA,cAAA;EACA,WAAA;EACA,cAAA;EACA,aAAA;ACEJ;ADDI;EACI,aAAA;EACA,UAAA;EACA,gBAAA;EACA,YAAA;EACA,gBAAA;EACA,aAAA;EACA,sBAAA;EACA,4BAAA;ACGR;ADFQ;EACI,aAAA;EACA,gBAAA;EACA,WAAA;ACIZ;ADHY;EACI,WAAA;ACKhB;ADHY;EACI,WAAA;EACA,gBAAA;ACKhB;ADDI;EACI,UAAA;ACGR;ADFQ;EACI,UAAA;EACA,cAAA;ACIZ;ADHY;EACI,mBAAA;ACKhB;;ADAA;EACI,yBAAA;ACGJ;;ADDA;EACI,WAAA;ACIJ;;ADFA;EACI,aAAA;EACA,mBAAA;EACA,8BAAA;EACA,gBAAA;ACKJ;ADJI;EACI,WAAA;EACA,eAAA;ACMR;ADJI;EACI,aAAA;EACA,mBAAA;EACA,uBAAA;ACMR;ADJI;EACI,YAAA;EACA,WAAA;EACA,iBAAA;EACA,qBAAA;EACA,iCAAA;ACMR;ADLQ;EACI,yBAAA;EACA,YAAA;EACA,kBAAA;ACOZ;ADLQ;EAAsB,sBAAA;ACQ9B;ADPQ;EACI,mBAAA;ACSZ;ADRY;EAAsB,6BAAA;ACWlC","file":"style.css"}

115
wms/mkt/css/style.scss

@ -0,0 +1,115 @@
.price_option-select{
width: 100%;
margin: 0 auto;
display: flex;
>.sidebar{
padding: 20px;
width: 15%;
min-width: 180px;
height: auto;
min-height: 80vh;
display: flex;
flex-direction: column;
border-right:1px #ccc solid;
>a{
margin:6px 0;
transition: .3s;
color:#666;
&:hover{
color:#000;
}
&.active{
color:#000;
font-weight: 700;
}
}
}
>.options{
width: 85%;
>div{
width: 80%;
margin:0 auto;
&.container{
margin-bottom: 16px;
}
}
}
}
.price_option-index{
width: 100%;
margin: 0 auto;
width: 100%;
margin: 0 auto;
display: flex;
>.sidebar{
padding: 20px;
width: 15%;
min-width: 180px;
height: auto;
min-height: 80vh;
display: flex;
flex-direction: column;
border-right:1px #ccc solid;
>a{
margin:6px 0;
transition: .3s;
color:#666;
&:hover{
color:#000;
}
&.active{
color:#000;
font-weight: 700;
}
}
}
>.options{
width: 85%;
>div{
width: 80%;
margin:0 auto;
&.container{
margin-bottom: 16px;
}
}
}
}
.btn-secondary{
background-color: #6C757D;
}
.text-light{
color:#fff;
}
.pagination {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 15px;
small{
color:#111;
font-size: 13px;
}
.links{
display: flex;
align-items: center;
justify-content: center;
}
a {
color: black;
float: left;
padding: 8px 16px;
text-decoration: none;
transition: background-color .3s;
&.active {
background-color: #1E74FD;
color: white;
border-radius: 5px;
}
&:hover:not(.active) {background-color: #ddd;}
&.disabled{
cursor:not-allowed;
&:hover:not(.active) {background-color: transparent;}
}
}
}

160
wms/mkt/price_option-index.php

@ -1,52 +1,53 @@
<?php <?php
include "../header.php"; include '../header.php';
require_once './conn.php';
$opt_data_arr = []; $kind = $_GET['kind'];
$sql = "select * from option_price where status = 'Y' order by kind, id"; $sql_str = "SELECT * FROM option_price WHERE kind = :kind AND status ='Y'";
$res = mysqli_query($link, $sql); $stmt = $conn->prepare($sql_str);
while ($row = mysqli_fetch_assoc($res)) { $stmt->bindParam(':kind', $kind);
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["spec"] = $row["spec"]; $stmt->execute();
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["memo"] = $row["memo"]; $options = $stmt->fetchAll(PDO::FETCH_ASSOC);
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["optional"] = $row["optional"]; $optional_arr = [1=>'標', 2=>'選'];
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["unit"] = $row["unit"];
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["price"] = $row["price"];
}
mysqli_free_result($res);
?> ?>
<style> <link rel="stylesheet" href="./css/style.css">
.container { <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" />
padding-top: 10px !important; <link rel="stylesheet" href="../contract/semantic/dist/semantic.min.css">
} <script defer src="../contract/js/alpinejs/cdn.min.js"></script>
#exTab1 table { <script src="../contract/js/axios/axios.min.js"></script>
background-color : white; <div class="price_option-index" x-data="priceOptionIndex">
padding : 5px 15px; <div class="sidebar">
} <a href="./price_option-select.php?<?php echo $token_link; ?> ">全部顯示</a>
.kind-col { <a <?php if($kind == 'A'){echo 'class="active"';} ?> href="./price_option-index.php?kind=A&<?php echo $token_link; ?>">A-1車廂意匠</a>
color:brown; <a <?php if($kind == 'B'){echo 'class="active"';} ?> href="./price_option-index.php?kind=B&<?php echo $token_link; ?>">A-2車廂內裝</a>
} <a <?php if($kind == 'C'){echo 'class="active"';} ?> href="./price_option-index.php?kind=C&<?php echo $token_link; ?>">A-3車廂外部</a>
</style> <a <?php if($kind == 'D'){echo 'class="active"';} ?> href="./price_option-index.php?kind=D&<?php echo $token_link; ?>">A-4控制與其他</a>
<script> <a <?php if($kind == 'E'){echo 'class="active"';} ?> href="./price_option-index.php?kind=E&<?php echo $token_link; ?>">B-1平台梯</a>
$(function(){ <a <?php if($kind == 'F'){echo 'class="active"';} ?> href="./price_option-index.php?kind=F&<?php echo $token_link; ?>">C-1汰改</a>
$('#table_index2').DataTable({ </div>
"language": { <div class="options">
"zeroRecords": "沒有符合的結果",
"search": "搜尋",
"lengthMenu": "顯示 _MENU_ 項結果",
"info": "顯示第 _START_ 至 _END_ 項結果,共 _TOTAL_ 項",
"infoEmpty": "顯示第 0 至 0 項結果,共 0 項",
"infoFiltered": "(從 _MAX_ 項結果中過濾)",
},
"searching": true,
"pageLength": 50
});
//$('#table_index2_length').hide();
//$("#table_index2_paginate").hide();
})
</script>
<div style="overflow-x:auto;">
<div class="container"><h2>OPTION價格查詢</h2></div> <div class="container"><h2>OPTION價格查詢</h2></div>
<div id="exTab1" class="container"> <div id="exTab1" class="container">
<div class="toolbar">
<label for="">
顯示
<select x-model="pageLength" @change="changeType()">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="999999">顯示全部</option>
</select>
</label>
<label for="">
<template x-for="btn in buttons">
<button style="margin-right:4px" :class="['btn', (btn.type == btntype) ? 'btn-primary' : 'btn-secondary text-light']" x-text="btn.name" @click="changeType(btn.type)"></button>
</template>
</label>
<label for="">
搜尋
<input type="text" @keyup="inputSearch($event)" />
</label>
</div>
<table id="table_index2" class="table table-striped table-bordered" style="width:100%"> <table id="table_index2" class="table table-striped table-bordered" style="width:100%">
<thead> <thead>
<tr class="kind-col"> <tr class="kind-col">
@ -59,29 +60,52 @@ $(function(){
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <template x-if="options.length <= 0">
foreach ($opt_data_arr as $k => $v) { <tr>
foreach ($v as $k2 => $v2) { <td colspan="6"><p style="font-size:13px;color:#a00">沒有符合的結果。</p></td>
foreach ($v2 as $k3 => $v3) { </tr>
if ($v3["optional"] == "1") $optional = "標"; </template>
elseif ($v3["optional"] == "2") $optional = "選"; <template x-for="option in options">
echo "<tr>"; <tr>
echo "<td>".$k2."</td>"; <td x-text="option.group_name"></td>
echo "<td>".$v3["spec"]."</td>"; <td x-text="option.spec"></td>
echo "<td>".$v3["memo"]."</td>"; <td x-text="option.memo"></td>
echo "<td>".$optional."</td>"; <td x-text="options_arr[option.optional]"></td>
echo "<td>".$v3["unit"]."<input type='hidden' name='option_id' value='".$k3."'></td>"; <td x-text="option.unit"></td>
echo "<td>".number_format($v3["price"])."</td>"; <td x-html="option.price!=null ? Number(option.price).toLocaleString() : ''"></td>
echo "</tr>"; </tr>
} </template>
}
}
?>
</tbody>
</table> </table>
<div class="pagination">
<small x-text="'顯示第'+((Number(currentpage)-1)*Number(pageLength)+1)+' 至 '+((((Number(currentpage)-1)*Number(pageLength) +Number(pageLength))< dataLangth) ? ((Number(currentpage)-1)*Number(pageLength) +Number(pageLength)) : dataLangth )+' 項結果,共 '+dataLangth+' 項'"></small>
<div class="links">
<template x-if="currentpage>1">
<a href="###" @click="switchPage(currentpage-1)">&laquo;</a>
</template>
<template x-if="pageNumber <= 10">
<template x-for="page in pageNumber">
<a href="javascript:;" @click="switchPage(page)" :class="[(page == currentpage) ? 'active' : '']" x-text="page" ></a>
</template>
</template>
<template x-if="pageNumber > 10">
<select @change="selectPage($event)" style="width:66px;padding:8px 2px" x-model="currentpage">
<template x-for="page in pageNumber">
<option :value="page" x-text="page"></option>
</template>
</select>
</template>
<template x-if="currentpage<pageNumber">
<a href="###" @click="switchPage(currentpage+1)">&raquo;</a>
</template>
</div> </div>
</div> </div>
<?php </div>
mysqli_close($link); </div>
include "../footer.php"; </div>
?>
<script src="./assets/js/alpine.js"></script>
<script>
const options = [...<?php echo json_encode($options); ?>];
console.log(options);
const kind = '<?php echo $kind; ?>';
</script>

87
wms/mkt/price_option-index2.php

@ -0,0 +1,87 @@
<?php
include "../header.php";
$opt_data_arr = [];
$sql = "select * from option_price where status = 'Y' order by kind, id";
$res = mysqli_query($link, $sql);
while ($row = mysqli_fetch_assoc($res)) {
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["spec"] = $row["spec"];
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["memo"] = $row["memo"];
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["optional"] = $row["optional"];
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["unit"] = $row["unit"];
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["price"] = $row["price"];
}
mysqli_free_result($res);
?>
<style>
.container {
padding-top: 10px !important;
}
#exTab1 table {
background-color : white;
padding : 5px 15px;
}
.kind-col {
color:brown;
}
</style>
<script>
$(function(){
$('#table_index2').DataTable({
"language": {
"zeroRecords": "沒有符合的結果",
"search": "搜尋",
"lengthMenu": "顯示 _MENU_ 項結果",
"info": "顯示第 _START_ 至 _END_ 項結果,共 _TOTAL_ 項",
"infoEmpty": "顯示第 0 至 0 項結果,共 0 項",
"infoFiltered": "(從 _MAX_ 項結果中過濾)",
},
"searching": true,
"pageLength": 50
});
//$('#table_index2_length').hide();
//$("#table_index2_paginate").hide();
})
</script>
<div style="overflow-x:auto;">
<div class="container"><h2>OPTION價格查詢</h2></div>
<div id="exTab1" class="container">
<table id="table_index2" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr class="kind-col">
<th scope="col" nowrap>名稱</th>
<th scope="col" nowrap>規格</th>
<th scope="col" nowrap>備註</th>
<th scope="col" nowrap>配置</th>
<th scope="col" nowrap>單位</th>
<th scope="col" nowrap>定價</th>
</tr>
</thead>
<tbody>
<?php
foreach ($opt_data_arr as $k => $v) {
foreach ($v as $k2 => $v2) {
foreach ($v2 as $k3 => $v3) {
if ($v3["optional"] == "1") $optional = "標";
elseif ($v3["optional"] == "2") $optional = "選";
echo "<tr>";
echo "<td>".$k2."</td>";
echo "<td>".$v3["spec"]."</td>";
echo "<td>".$v3["memo"]."</td>";
echo "<td>".$optional."</td>";
echo "<td>".$v3["unit"]."<input type='hidden' name='option_id' value='".$k3."'></td>";
echo "<td>".number_format($v3["price"])."</td>";
echo "</tr>";
}
}
}
?>
</tbody>
</table>
</div>
</div>
<?php
mysqli_close($link);
include "../footer.php";
?>

106
wms/mkt/price_option-select.php

@ -0,0 +1,106 @@
<?php
include "../header.php";
require_once('./conn.php');
$sql_str = "SELECT * FROM option_price WHERE status = 'Y' ORDER BY kind, id";
$stmt = $conn->prepare($sql_str);
$stmt->execute();
$options = $stmt->fetchAll(PDO::FETCH_ASSOC);
$optional_arr = [1=>'標', 2=>'選'];
?>
<link rel="stylesheet" href="./css/style.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" />
<link rel="stylesheet" href="../contract/semantic/dist/semantic.min.css">
<script defer src="../contract/js/alpinejs/cdn.min.js"></script>
<script src="../contract/js/axios/axios.min.js"></script>
<div class="price_option-select" x-data="priceOptionSelect">
<div class="sidebar">
<a class="active" href="./price_option-select.php?<?php echo $token_link; ?> ">全部顯示</a>
<a href="./price_option-index.php?kind=A&<?php echo $token_link; ?>">A-1車廂意匠</a>
<a href="./price_option-index.php?kind=B&<?php echo $token_link; ?>">A-2車廂內裝</a>
<a href="./price_option-index.php?kind=C&<?php echo $token_link; ?>">A-3車廂外部</a>
<a href="./price_option-index.php?kind=D&<?php echo $token_link; ?>">A-4控制與其他</a>
<a href="./price_option-index.php?kind=E&<?php echo $token_link; ?>">B-1平台梯</a>
<a href="./price_option-index.php?kind=F&<?php echo $token_link; ?>">C-1汰改</a>
</div>
<div class="options">
<div class="container"><h2>OPTION價格查詢</h2></div>
<div id="exTab1" class="container">
<div class="toolbar">
<label for="">
顯示
<select x-model="pageLength" @change="changeType()">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="999999">顯示全部</option>
</select>
</label>
<label for="">
</label>
<label for="">
搜尋
<input type="text" @keyup="inputSearch($event)" />
</label>
</div>
<table id="table_index2" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr class="kind-col">
<th scope="col" nowrap>名稱</th>
<th scope="col" nowrap>規格</th>
<th scope="col" nowrap>備註</th>
<th scope="col" nowrap>配置</th>
<th scope="col" nowrap>單位</th>
<th scope="col" nowrap>定價</th>
</tr>
</thead>
<tbody>
<template x-if="options.length <= 0">
<tr>
<td colspan="6"><p style="font-size:13px;color:#a00">沒有符合的結果。</p></td>
</tr>
</template>
<template x-for="option in options">
<tr>
<td x-text="option.group_name"></td>
<td x-text="option.spec"></td>
<td x-text="option.memo"></td>
<td x-text="options_arr[option.optional]"></td>
<td x-text="option.unit"></td>
<td x-html="option.price!=null ? Number(option.price).toLocaleString() : ''"></td>
</tr>
</template>
</table>
<div class="pagination">
<small x-text="'顯示第'+((Number(currentpage)-1)*Number(pageLength)+1)+' 至 '+((((Number(currentpage)-1)*Number(pageLength) +Number(pageLength))< dataLangth) ? ((Number(currentpage)-1)*Number(pageLength) +Number(pageLength)) : dataLangth )+' 項結果,共 '+dataLangth+' 項'"></small>
<div class="links">
<template x-if="currentpage>1">
<a href="###" @click="switchPage(currentpage-1)">&laquo;</a>
</template>
<template x-if="pageNumber <= 10">
<template x-for="page in pageNumber">
<a href="javascript:;" @click="switchPage(page)" :class="[(page == currentpage) ? 'active' : '']" x-text="page" ></a>
</template>
</template>
<template x-if="pageNumber > 10">
<select @change="selectPage($event)" style="width:66px;padding:8px 2px" x-model="currentpage">
<template x-for="page in pageNumber">
<option :value="page" x-text="page"></option>
</template>
</select>
</template>
<template x-if="currentpage<pageNumber">
<a href="###" @click="switchPage(currentpage+1)">&raquo;</a>
</template>
</div>
</div>
</div>
</div>
</div>
<script src="./assets/js/alpine.js"></script>
<script>
const options = [...<?php echo json_encode($options); ?>];
</script>

10
wms/mkt/pricereview-index.php

@ -425,9 +425,13 @@ if ($user_id=="M0023") {
</p> </p>
</td>--> </td>-->
<td> <td>
<?php if($data['status'] === 'YY' || $user_id=="M0107" || $user_id == "M0174"){ ?> <?php if($data['status'] !== 'YY'): ?>
<a href="../contract/contract-download.php?id=<?php echo $data['id'] . '&' . $para?>">合約書申請</a> <a href="../contract/contract-new-apply.php?id=<?php echo $data['id'] . '&' . $para; ?>">合約書申請</a>
<?php }else{ echo "-"; } ?> <?php endif; ?>
<!-- 工號M0107、M0174有所有權限 -->
<?php if($data['status'] === 'YY' || $user_id == "M0174"): ?>
<a href="../contract/contract-download.php?id=<?php echo $data['id'] . '&' . $para?>">合約書下載</a>
<?php endif; ?>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>

Loading…
Cancel
Save