Browse Source

契約價審合約

main
Cheng 1 year ago
parent
commit
9da56cd58c
  1. 281
      mkt/contractapply-index.php
  2. 8
      wms/cont/apply_form.php
  3. 2
      wms/cont/sign_list.php
  4. 174
      wms/contract-repair/contract-download.php
  5. 763
      wms/contract-repair/js/alpine.js
  6. 649
      wms/contract-repair/prviewPdf.php
  7. 525
      wms/contract/contract-download.php
  8. 2
      wms/crm/crmm02-index.php

281
mkt/contractapply-index.php

@ -1,140 +1,143 @@
<?php
include "header.php";
// 載入db.php來連結資料庫
require_once "database.php";
// 設置一個空陣列來放資料
$data = array();
// sql語法存在變數中
$sql = "select * from contractapply_main order by id";
$data = mysqli_query($link,$sql);
$apply_type_arr = ["A" => "制式新合約", "B" => "非制式新合約"];
$status_arr = ["I" => "申請中", "P" => "在途中", "Y" => "已完成", "X" => "作廢"];
?>
<p>
<a href="contractapply-create.php" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</a>
</p>
<?php
if($data):
?>
<style>
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;
}
</style>
<div style="overflow-x:auto;">
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>項次</th>
<th>申請號</th>
<th>卷號</th>
<th>營業員</th>
<th>合約書號</th>
<th>申請日期</th>
<th>立約人</th>
<th>申請類別</th>
<th>合約狀態</th>
<th>合約狀態時間</th>
<th>案件名稱</th>
<th>含稅貨款</th>
<th>含稅按裝款</th>
<th>含稅給約總價</th>
<th>二次款</th>
<!--<th>交貨期限</th>
<th>完工期限</th>-->
<th>建檔人</th>
<th>建檔時間</th>
</tr>
</thead>
<tbody>
<?php foreach($data as $data) :
switch ($data["status"]) {
case "I":
$status_dt = $data["status_1_dt"];
break;
case "P":
$status_dt = $data["status_2_dt"];
break;
case "Y":
$status_dt = $data["status_3_dt"];
break;
case "X":
$status_dt = $data["status_4_dt"];
break;
}
?>
<tr>
<td><?php echo $data['id']; ?></td>
<td><?php echo $data['apply_no1'].$data['apply_no2']; ?></td>
<td><?php echo $data['contractno']; ?></td>
<td><?php echo $data['person']; ?></td>
<td><?php echo $data['apply_number']; ?></td>
<td><?php echo $data['apply_date']; ?></td>
<td><?php echo $data['promiser']; ?></td>
<td><?php echo $apply_type_arr[$data['apply_type']]; ?></td>
<td>
<?php echo $status_arr[$data['status']]; ?>
<p>
<a href="contractapply-edit.php?id=<?php echo $data['id']; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</p>
</td>
<td><?php echo $status_dt; ?></td>
<td><?php echo $data['case_name']; ?></td>
<td><?php echo number_format($data['pay']); ?></td>
<td><?php echo number_format($data['pay_install']); ?></td>
<td><?php echo number_format($data['pay_total']); ?></td>
<td><?php echo $data['pay_second']; ?></td>
<!--<td><?php echo $data['delivery_date']; ?></td>
<td><?php echo $data['completion_date']; ?></td>-->
<td><?php echo $data['creater']; ?></td>
<td><?php echo $data['create_dt']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php
else:
echo "<h2>There is no record!</h2>";
endif;
#代表結束連線
mysqli_close($link);
include "footer.php";
<?php
include "header.php";
// 載入db.php來連結資料庫
require_once "database.php";
// 設置一個空陣列來放資料
$data = array();
// sql語法存在變數中
$sql = "select * from contractapply_main order by id";
$data = mysqli_query($link, $sql);
$apply_type_arr = ["A" => "制式新合約", "B" => "非制式新合約"];
$status_arr = ["I" => "申請中", "P" => "在途中", "Y" => "已完成", "X" => "作廢"];
?>
<p>
<a href="contractapply-create.php" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</a>
</p>
<?php
if ($data) :
?>
<style>
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;
}
</style>
<div style="overflow-x:auto;">
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>項次</th>
<th>申請號</th>
<th>卷號</th>
<th>營業員</th>
<th>合約書號</th>
<th>申請日期</th>
<th>立約人</th>
<th>申請類別</th>
<th>合約狀態</th>
<th>合約狀態時間</th>
<th>案件名稱</th>
<th>含稅貨款</th>
<th>含稅按裝款</th>
<th>含稅給約總價</th>
<th>二次款</th>
<!--<th>交貨期限</th>
<th>完工期限</th>-->
<th>建檔人</th>
<th>建檔時間</th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $data) :
switch ($data["status"]) {
case "I":
$status_dt = $data["status_1_dt"];
break;
case "P":
$status_dt = $data["status_2_dt"];
break;
case "Y":
$status_dt = $data["status_3_dt"];
break;
case "X":
$status_dt = $data["status_4_dt"];
break;
}
?>
<tr>
<td><?php echo $data['id']; ?></td>
<td><?php echo $data['apply_no1'] . $data['apply_no2']; ?></td>
<td><?php echo $data['contractno']; ?></td>
<td><?php echo $data['person']; ?></td>
<td><?php echo $data['apply_number']; ?></td>
<td><?php echo $data['apply_date']; ?></td>
<td><?php echo $data['promiser']; ?></td>
<td><?php echo $apply_type_arr[$data['apply_type']]; ?></td>
<td>
<?php echo $status_arr[$data['status']]; ?>
<p>
<a href="contractapply-edit.php?id=<?php echo $data['id']; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</p>
</td>
<td><?php echo $status_dt; ?></td>
<td><?php echo $data['case_name']; ?></td>
<td><?php echo number_format($data['pay']); ?></td>
<td><?php echo number_format($data['pay_install']); ?></td>
<td><?php echo number_format($data['pay_total']); ?></td>
<td><?php echo $data['pay_second']; ?></td>
<!--<td><?php echo $data['delivery_date']; ?></td>
<td><?php echo $data['completion_date']; ?></td>-->
<td><?php echo $data['creater']; ?></td>
<td><?php echo $data['create_dt']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php
else :
echo "<h2>There is no record!</h2>";
endif;
#代表結束連線
mysqli_close($link);
include "footer.php";
?>

8
wms/cont/apply_form.php

@ -44,10 +44,10 @@ else {
else $apply_st = 9; // 已到下一關,無法䖺改
}
if ($apply_st > 2) {
echo "<script>alert('卷號" . $vol_no . "已生成價審單,請勿重複生成!');history.go(-1);</script>";
exit;
}
// if ($apply_st > 2) {
// echo "<script>alert('卷號" . $vol_no . "已生成價審單,請勿重複生成!');history.go(-1);</script>";
// exit;
// }
if ($apply_st == 1) {
$wf = new WorkFlow($system_id, $flow_id, $form_id);

2
wms/cont/sign_list.php

@ -256,7 +256,7 @@ if ($data) :
<span style="font-size:13px;font-weight:600">--</span>
<?php endif; ?>
<?php if (($row['status'] === 'YY' && $row['applystatus'] == 3 && ($user_id == "M0107" || $user_id == "M0060")) || $user_id == "M0174" || $user_id == 'M0225') : ?>
<a class="applybtn" href="../contract-repaire/contract-download.php?id=<?php echo $row['id'] . '&' . $para ?>">下載</a>
<a class="applybtn" href="../contract-repair/contract-download.php?apply_key=<?php echo $row['apply_key'] . '&' . $para ?>">下載</a>
<?php endif; ?>
</td>
</tr>

174
wms/contract-repair/contract-download.php

@ -2,49 +2,65 @@
include "../header.php";
require_once('./conn.php');
//買賣1、2、3,安裝5、6 (4跟7很少有)
if (isset($_GET['id']) && $_GET['id'] != "") {
if (!empty($_GET['apply_key'])) {
try {
$id = $_GET['id'];
$sql_str = "SELECT pricereview_main.*, pricereview_pay.*, pricereview_item.note, pricereview_item.item_qty, account.name as accountname, account.id as accountid
FROM pricereview_main
JOIN pricereview_pay ON pricereview_main.id = pricereview_pay.mid
JOIN pricereview_item ON pricereview_main.id = pricereview_item.mid
JOIN account ON pricereview_main.person = account.accountid
WHERE pricereview_main.id = :id AND pricereview_item.item_group = 'A' ORDER BY pay_kind ASC";
$apply_key = $_GET['apply_key'];
// $sql_str = "SELECT pricereview_main.*, pricereview_pay.*, pricereview_item.note, pricereview_item.item_qty, account.name as accountname, account.id as accountid
// FROM pricereview_main
// JOIN pricereview_pay ON pricereview_main.id = pricereview_pay.mid
// JOIN pricereview_item ON pricereview_main.id = pricereview_item.mid
// JOIN account ON pricereview_main.person = account.accountid
// WHERE pricereview_main.id = :id AND pricereview_item.item_group = 'A' ORDER BY pay_kind ASC";
// 價審資料
$sql = "SELECT * FROM con_maintance_examine_apply AS a LEFT JOIN hope_contract_customer AS b ON a.vol_no = b.vol_no WHERE a.apply_key = :apply_key";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':apply_key', $apply_key);
$stmt->execute();
$contract_maintance = $stmt->fetchALL(PDO::FETCH_ASSOC);
echo '<pre>';
print_r($contract_maintance);
echo '</pre>';
// echo $contract_maintance;
// $stmt = $conn->prepare($sql_str);
// $stmt->bindParam(':id',$id);
// $stmt->execute();
// $contracts = $stmt->fetchAll(PDO::FETCH_ASSOC);
$sql_str = "SELECT contract_new_apply.*,
contract_new_apply_pays.pay_kind, contract_new_apply_pays.pay_scale, contract_new_apply_pays.pay_amount, contract_new_apply_pays.pay_period, contract_new_apply_pays.condition_date
FROM contract_new_apply
JOIN contract_new_apply_pays ON contract_new_apply.id = contract_new_apply_pays.contract_apply_id
WHERE contract_new_apply.mid = :id";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':id', $id);
$stmt->execute();
$contracts = $stmt->fetchAll(PDO::FETCH_ASSOC);
$contract = $contracts[0];
$contract_apply_id = $contract['id'];
if (($contract['status'] !== "YY" && $user_id != 'M0107') && $user_id != 'M0174') {
echo '<script type="text/javascript">
alert("非法訪問。");
window.history.back();
</script>';
exit;
}
$sql_str = "SELECT * FROM hope_elevator_customer WHERE vol_no = :vol_no";
// $sql_str = "SELECT contract_new_apply.*,
// contract_new_apply_pays.pay_kind, contract_new_apply_pays.pay_scale, contract_new_apply_pays.pay_amount, contract_new_apply_pays.pay_period, contract_new_apply_pays.condition_date
// FROM contract_new_apply
// JOIN contract_new_apply_pays ON contract_new_apply.id = contract_new_apply_pays.contract_apply_id
// WHERE contract_new_apply.mid = :id";
// $stmt = $conn->prepare($sql_str);
// $stmt->bindParam(':id', $id);
// $stmt->execute();
// $contracts = $stmt->fetchAll(PDO::FETCH_ASSOC);
// $contract = $contracts[0];
// $contract_apply_id = $contract['id'];
// if (($contract['status'] !== "YY" && $user_id != 'M0107') && $user_id != 'M0174' || $user_id != 'M0225') {
// echo '<script type="text/javascript">
// alert("非法訪問。");
// window.history.back();
// </script>';
// exit;
// }
// 抓有望客戶的資料
$sql_str = "SELECT * FROM hope_contract_customer WHERE vol_no = :vol_no";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':vol_no', $contract['contractno']);
$stmt->bindParam(':vol_no', $contract_maintance['vol_no']);
$stmt->execute();
$customer = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (count($customer) <= 0) {
echo "<script>
alert('資料不齊或合約書已生成過。');
window.history.back();
</script>";
exit;
}
// if (count($customer) <= 0) {
// echo "<script>
// alert('資料不齊或合約書已生成過。');
// window.history.back();
// </script>";
// exit;
// }
$buyArr = [];
$buyNo2Pay = false;
$buy_total_price = 0;
@ -52,33 +68,34 @@ if (isset($_GET['id']) && $_GET['id'] != "") {
$install_total_price = 0;
// $noteArr = explode(",", $contracts[0]['note']);
$noteArr = array(1, 1, 1, 1, 1);
$qty = $contracts[0]['total_items'];
foreach ($contracts as $idx => $amount) {
$isset = false;
if ($amount['pay_kind'] == 5 || $amount['pay_kind'] == 6) {
if ($amount['pay_scale'] >= 0) {
$install_total_price = $install_total_price + $amount['pay_amount'];
$installArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']];
}
}
if ($amount['pay_kind'] == 1 || $amount['pay_kind'] == 2 || $amount['pay_kind'] == 3) {
if ($amount['pay_scale'] > 0) {
$buy_total_price = $buy_total_price + $amount['pay_amount'];
foreach ($buyArr as $buy) {
if ($buy['installment'] == $amount['pay_kind']) {
$isset = true;
}
}
if (!$isset) { {
$buyArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']];
}
if ($amount['pay_kind'] == 2) {
$buyNo2Pay = true;
}
}
}
}
}
$qty = $contract_maintance[0]['num'];
// echo $qty;
// foreach ($contract_maintance as $idx => $amount) {
// $isset = false;
// if ($amount['payment_kind'] == 5 || $amount['payment_kind'] == 6) {
// if ($amount['pay_scale'] >= 0) {
// $install_total_price = $install_total_price + $amount['pay_amount'];
// $installArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']];
// }
// }
// if ($amount['pay_kind'] == 1 || $amount['pay_kind'] == 2 || $amount['pay_kind'] == 3) {
// if ($amount['pay_scale'] > 0) {
// $buy_total_price = $buy_total_price + $amount['pay_amount'];
// foreach ($buyArr as $buy) {
// if ($buy['installment'] == $amount['pay_kind']) {
// $isset = true;
// }
// }
// if (!$isset) { {
// $buyArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']];
// }
// if ($amount['pay_kind'] == 2) {
// $buyNo2Pay = true;
// }
// }
// }
// }
// }
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL";
$sql_str = "SELECT contract_apply_files.*, contract_new_apply.id as apply_id FROM contract_apply_files LEFT JOIN contract_new_apply ON contract_apply_files.contract_id = contract_new_apply.id WHERE contract_new_apply.mid = :mid AND contract_apply_files.deleted_at IS NULL";
$stmt = $conn->prepare($sql_str);
@ -102,7 +119,7 @@ if (isset($_GET['id']) && $_GET['id'] != "") {
<ul>
<button :class="isbuyShow ? 'active' : ''" @click="isbuyShow = true">電梯買賣合約書</button>
<button :class="!isbuyShow ?'active' : ''" @click="isbuyShow = false">電梯安裝合約書</button>
<a href="../mkt/pricereview-index.php?function_name=pricereview&<?php echo $token_link; ?>">回列表</a>
<a href="..wms/cont/sign_list.php?function_name=pricereview&<?php echo $token_link; ?>">回列表</a>
</ul>
</div>
<div class="inputDiv" x-show="isbuyShow && isBuyInputIng">
@ -153,7 +170,12 @@ if (isset($_GET['id']) && $_GET['id'] != "") {
</tr>
<tr>
<td colspan="1">
合約書編號:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article>
立契約人 甲方:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article>
</td>
<td>
<div style="margin-left: 100px">
乙方:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article>
</div>
</td>
</tr>
<tr>
@ -424,18 +446,18 @@ if (isset($_GET['id']) && $_GET['id'] != "") {
</main>
<!-- <script src="../ckeditor4/ckeditor.js"></script> -->
<script>
const partyAcompany = <?php echo json_encode($contract['customer']); ?>;
const partyAcontractno = <?php echo json_encode($contract['contractno']); ?>;
const partyAaddress = <?php echo json_encode($contract['contact_address']); ?>;
const totalPrice = <?php echo $contract['total_price']; ?>;
const partyAcompany = <?php echo json_encode($contract_maintance['customer']); ?>;
const partyAcontractno = <?php echo json_encode($contract_maintance['apply_key']); ?>;
const partyAaddress = <?php echo json_encode($contcontract_maintanceract['address']); ?>;
const totalPrice = 0;
const totalInstallPrice = <?php echo $install_total_price; ?>;
const totalBuyPrice = <?php echo $buy_total_price; ?>;
const secondPayDeadline = <?php echo $contract['secondPayDeadline']; ?>;
const buyfill1 = <?php echo $contract['tradedeadline']; ?>;
const installfill1 = "<?php echo $contract['test_time']; ?>";
const installfill2 = "<?php echo $contract['freedeadline']; ?>";
const buyArr = [...<?php echo json_encode($buyArr); ?>];
const installArr = [...<?php echo json_encode($installArr); ?>];
// const secondPayDeadline = <?php echo $contract['secondPayDeadline']; ?>;
// const buyfill1 = <?php echo $contract['tradedeadline']; ?>;
// const installfill1 = "<?php echo $contract_maintance['test_time']; ?>";
// const installfill2 = "<?php echo $contract_maintance['freedeadline']; ?>";
// const buyArr = [...<?php echo json_encode($buyArr); ?>];
// const installArr = [...<?php echo json_encode($installArr); ?>];
let install_pay_text = '付款方式:<br> ';
let buy_pay_text = ''
const chineseArr = ['零', '一', '二', '三', '四', '五', '六', '七']
@ -445,8 +467,8 @@ if (isset($_GET['id']) && $_GET['id'] != "") {
const floor = <?php echo $noteArr[2]; ?>;
const speed = <?php echo $noteArr[3]; ?>;
const buyAffix = ' <?php echo $files_count; ?>';
console.log(buyAffix);
console.log(installArr);
// console.log(buyAffix);
// console.log(installArr);
buyArr.forEach((item, idx) => {
if (item.scale > 0) {
if (item.installment == 1) {

763
wms/contract-repair/js/alpine.js

@ -1,29 +1,16 @@
const contractDownload = () => {
return {
init() {
this.standardData = this.deepClone(this.data);
this.onstandardViewData = this.deepClone(this.data);
this.buystandardData = this.deepClone(this.buydata);
this.standarDate = this.deepClone(this.data);
this.onstandarViewData = this.deepClone(this.data);
this.buystandarData = this.deepClone(this.buydata);
this.buyonstandardViewData = this.deepClone(this.buydata);
// CKEDITOR.replace('editor',{
// extraplugins:'filebrowser',
// height:80,
// width:'100%',
// filebrowserUploadMethod:'form',
// filebrowserUploadUrl:'./ckeditor_upload.php'
// });
},
installfill1: '',
installfill2: '',
installAffix: 1,
buyfill1: '',
buyfill2: '',
buyAffix: 1,
css: `table { background-color: #fff; border: none; margin-top: 30px; font-family: '標楷體'; width: 600px; } table tr:nth-child(even), table tr:nth-child(odd) { background-color: #fff; } table tr { font-size: 12pt; width: 100%; } table tr h2 { font-size: 18pt; } table tr td { width: 100%; height: 100%; line-height: 2; display: flex; } table tr td.center { display: flex; justify-content: center; align-items: center; } table tr td.list { width: 100%; height: 100%; white-space: nowrap; display: flex; } table tr td.list span { width: 60px; min-height: 100%; display: block; } table tr td.list > p { display: block; text-align: justify; } table tr td.list div { max-width: calc(100% - 60px); white-space: normal; } table tr td.list div.text-justify { display: flex; width: 100%; justify-content: space-between; } table tr.date td > div { width: 100%; text-align: right; } table tr.date td > div.text-justify { display: flex; justify-content: space-between; } table td, table th { padding: 8px; }`,
css: `table { background - color: #fff; border: none; margin - top: 30px; font - family: '標楷體'; width: 600px; } table tr: nth - child(even), table tr: nth - child(odd) { background - color: #fff; } table tr { font - size: 12pt; width: 100 %; } table tr h2 { font - size: 18pt; } table tr td { width: 100 %; height: 100 %; line - height: 2; display: flex; } table tr td.center { display: flex; justify - content: center; align - items: center; } table tr td.list { width: 100 %; height: 100 %; white - space: nowrap; display: flex; } table tr td.list span { width: 60px; min - height: 100 %; display: block; } table tr td.list > p { display: block; text - align: justify; } table tr td.list div { max - width: calc(100 % - 60px); white - space: normal; } table tr td.list div.text - justify { display: flex; width: 100 %; justify - content: space - between; } table tr.date td > div { width: 100 %; text - align: right; } table tr.date td > div.text - justify { display: flex; justify - content: space - between; } table td, table th { padding: 8px; }`,
data: {
illustrate: {
editshow: false,
plaintext: '茲因甲方向乙方訂購電梯,並委由乙方安裝系爭電梯,經雙方同意共同訂立本合約書,其條款如下:'
plaintext: '茲因甲乙雙方就電梯設備保養.檢修事宜,同意訂定本契約,議定條款如后,並相互遵守條款約定。',
},
partyA: {
editshow: false,
@ -38,612 +25,80 @@ const contractDownload = () => {
{
editshow: false,
origin: true,
text: `安裝產品名稱、數量及單價:<br>1、&nbsp;${people}&nbsp;人座 &nbsp;${floor}&nbsp;停站速度每分鐘&nbsp;${speed}&nbsp;公尺 交流變頻變壓電腦智能控制升降機&nbsp;${num}&nbsp;部。單價:新台幣&nbsp;${numberToChinese(totalInstallPrice)}&nbsp;元整(&nbsp;${numberWithCommas(totalInstallPrice)}&nbsp;)(含5%加值型營業稅)。`,
type: 'title',
text: ``,
deleted: false,
id: 0,
input_id: null,
input_id: null
},
{
editshow: false,
origin: true,
text: '安裝產品規格:如附表一。',
text: `規格`,
type: 'title',
deleted: false,
id: 1,
input_id: null,
},
{
editshow: false,
origin: true,
text: '安裝地點:' + partyAaddress + '。',
type: 'title',
deleted: false,
id: 2,
input_id: null,
},
{
editshow: false,
origin: true,
text: `安裝報酬:安裝勞務報酬為新台幣(以下皆同)&nbsp;${numberToChinese(totalPrice)}&nbsp;元整(${numberWithCommas(totalPrice)}&nbsp;)(含5%加值型營業稅)。`,
type: 'title',
deleted: false,
id: 3,
input_id: null,
},
{
editshow: false,
origin: true,
text: install_pay_text,
type: 'title',
deleted: false,
id: 4,
input_id: 'fill1',
},
{
editshow: false,
origin: true,
text: '安裝試車事項:<br>一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台__日內安裝完成。<br>二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於__日內交車時,甲方應付清總價款全部餘額。<br>三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。',
type: 'title',
deleted: false,
id: 5,
input_id: null,
},
{
editshow: false,
origin: true,
text: '交車事項:<br>一、乙方完成產品安裝後,甲方應儘速理交車事宜,不得無故或藉故拖延。如經乙方通知,甲方遲未辦理交車事宜,則於乙方催告後,即視同交車完成。<br>二、乙方試車完成後,甲方應配合提供建物使用執照及其他竣工檢查所需文件,以利乙方代甲方辦理昇降設備竣工檢查。<br>三、甲方於昇降設備竣工檢查合格及取得使用許可證後,交車事項即為完成。',
type: 'title',
deleted: false,
id: 6,
input_id: null,
},
{
editshow: false,
origin: true,
text: '因故延期:<br>如因天災、地變及其他不可抗力之因素,或甲方未將電梯昇降路及機械室之建築工程等配合事項未於貨抵工地前七日整理完善,或甲方未將符合規格之電源於安裝前送電至機械室,或房屋建築及其他應配合相關事項未完成,致影響乙方如期安裝產品時,乙方安裝日期應依受影響日數向後延展,如因可歸責於甲方事由者亦同。',
type: 'title',
deleted: false,
id: 7,
input_id: null,
},
{
editshow: false,
origin: true,
text: '工程變更:<br>甲方對本工程之規格有變更設計及增減工程數量時,應於合約訂立日後壹個月內預先以書面通知乙方且需經雙方同意,如因工程變更而致乙方成本增加時,則甲方應吸收所有增加之成本並追認給付給乙方,否則乙方依原合約之貨品規格、數量交貨,甲方亦應依原合約之貨品規格、數量給付款項。',
type: 'title',
deleted: false,
id: 8,
input_id: null,
},
{
editshow: false,
origin: true,
text: '工地清理及除外事項:<br>一、本工程於貨到現場前,其工地廢料雜物及臨時設備,應由甲方清除整理,同時提供乙方放置貨品之處所。<br>二、有關建築工事回填澆灌後之清潔,應由甲方負責清理。<br>三、升降設備除外工程表所列之各項工程不包括於乙方本合約施作範圍,應由甲方負責處理。',
type: 'title',
deleted: false,
id: 9,
input_id: null,
},
{
editshow: false,
origin: true,
text: '電梯保養:<br>一、乙方完工交車後,期後__個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。<br>二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。<br>三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。',
type: 'title',
deleted: false,
id: 10,
input_id: null,
},
{
editshow: false,
origin: true,
text: '特約條款:<br>一、本設備器材在款項未付清前,其所有權仍歸屬乙方所有,價款付清後所有權始轉移給甲方。<br>二、如因甲方因素或建物設計上之疏忽,致影響驗收時,甲方不得以此做為逾期或拒付款之藉口。<br>三、本合約所有日數約定,均以工作天計算。',
type: 'title',
deleted: false,
id: 11,
input_id: null,
},
{
editshow: false,
origin: true,
text: '終止合約權:<br>一、甲乙雙方之任一方若有違反合約之事實或發生清算或破產等信用貶落情形,致工程無法進行時,經催告而未改善者,他方得終止本合約,違約方必須賠償對方之損失。<br>二、乙方逾期交貨或甲方逾期未交付工地受領產品逾壹個月以上經他方催告仍不改善,他方得終止本合約,並請求損害賠償。',
type: 'title',
deleted: false,
id: 12,
input_id: null,
},
{
editshow: false,
origin: true,
text: '合意管轄:<br>因本合約而涉訟,甲、乙方雙方同意以桃園地方法院為第一審管轄法院。催告仍不改善,他方得終止本合約,並請求損害賠償。',
type: 'title',
deleted: false,
id: 13,
input_id: null,
},
{
editshow: false,
origin: true,
text: '附則:<br>本合約經甲、乙雙方簽章後立即生效,甲、乙雙方各存執正副本各壹份為憑,印花雙方各自貼付。',
type: 'title',
deleted: false,
id: 14,
input_id: null,
input_id: null
},
{
editshow: false,
origin: true,
text: '合約附件:<br>本合約附件為本合約之一部份,與本合約具同等效力,甲乙雙方均應遵守之。',
type: 'title',
deleted: false,
id: 15,
input_id: null,
},
editshow: false
}
]
}
},
buydata: {
illustrate: {
editshow: false,
plaintext: '茲因甲方向乙方訂購電梯,經雙方同意共同訂立本合約書,其條款如下:'
},
partyA: {
editshow: false,
plaintext: partyAcompany,
},
partyAcontractno: {
editshow: false,
plaintext: partyAcontractno,
},
list: {
plaintext: [
{
editshow: false,
origin: true,
text: `產品名稱、數量及單價:<br>1、&nbsp;${people}&nbsp;人座&nbsp;${floor}&nbsp;停站速度每分鐘&nbsp;${speed}&nbsp;公尺 交流變頻變壓電腦智能控制升降機&nbsp;${bigChineseArr[num]}&nbsp;部。單價:新台幣&nbsp;${numberToChinese(totalBuyPrice)}&nbsp;元整(&nbsp;${numberWithCommas(totalBuyPrice)}&nbsp;)(含5%加值型營業稅)。`,
type: 'title',
deleted: false,
id: 0,
input_id: null,
},
{
editshow: false,
origin: true,
text: '產品規格:如附表一。',
type: 'title',
deleted: false,
id: 1,
input_id: null,
},
{
editshow: false,
origin: true,
text: '交貨及安裝地點:' + partyAaddress + '。',
type: 'title',
deleted: false,
id: 2,
input_id: null,
},
{
editshow: false,
origin: true,
text: `產品總價:產品價金為新台幣&nbsp;${numberToChinese(totalBuyPrice)}&nbsp;元整(&nbsp;${numberWithCommas(totalBuyPrice)}&nbsp;)(含5%加值型營業稅)。`,
type: 'title',
deleted: false,
id: 3,
input_id: null,
},
{
editshow: false,
origin: true,
text: buy_pay_text,
type: 'title',
deleted: false,
id: 4,
input_id: 'buyfill1',
},
{
editshow: false,
origin: true,
text: '交貨期限及甲方配合事項:<br>乙方應於接獲甲方圖色確認第180日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。',
type: 'title',
deleted: false,
id: 5,
input_id: null,
},
{
editshow: false,
origin: true,
text: '施工規範依據:<br>甲方或其指定工程師,於本契約簽訂後二星期內,提供組立電梯之大樓建築有關圖面,以供乙方製作電梯配置圖,乙方製妥電梯配置圖後請甲方簽認,甲方於接獲乙方提請審核之電梯配置圖後,一星期內簽認並送還乙方,乙方應於接獲甲方簽認之電梯配置圖後,安排電梯組件之生產並按預定時間內製造完成。',
type: 'title',
deleted: false,
id: 6,
input_id: null,
},
{
editshow: false,
origin: true,
text: '因故延期:<br>一、如因天災、地變及其他不可抗力之因素,致影響乙方如期交付產品時,本合約第六條之交貨日期應依受影響日數向後延展,如因可歸責於甲方事由者亦同。<br />二、如因可歸責甲方事由致工期展延逾第六條日期時,如因物價波動致成本增加,乙方得請求物價調漲之補償,或終止合約。',
type: 'title',
deleted: false,
id: 7,
input_id: null,
},
{
editshow: false,
origin: true,
text: '工程變更:<br>甲方對本工程之規格有變更設計及增減工程數量時,應於合約訂立日後壹個月內預先以書面通知乙方且需經雙方同意,如因工程變更而致乙方成本增加時,則甲方應吸收所有增加之成本並追認給付給乙方,否則乙方依原合約之貨品規格、數量交貨,甲方亦應依原合約之貨品規格、數量給付款項。',
type: 'title',
deleted: false,
id: 8,
input_id: null,
},
{
editshow: false,
origin: true,
text: '工地清理及除外事項:<br>一、本工程於貨到現場前,其工地廢料雜物及臨時設備,應由甲方清除整理,同時提供乙方放置貨品之處所。<br />二、有關建築工事回填澆灌後之清潔,應由甲方負責清理。',
type: 'title',
deleted: false,
id: 9,
input_id: null,
},
{
editshow: false,
origin: true,
text: '合約時效:<br>本合約及其附件自簽訂之日起,至保固期滿之日止為有效期間。',
type: 'title',
deleted: false,
id: 10,
input_id: null,
},
{
editshow: false,
origin: true,
text: '特約條款:<br>一、本設備器材在款項未付清前,其所有權仍歸屬乙方所有,價款付清後所有權始轉移給甲方。<br />二、如因甲方因素或建物設計上之疏忽,致影響驗收時,甲方不得以此做為逾期或拒付款之藉口。<br />三、本合約所有日數約定,均以工作天計算。',
type: 'title',
deleted: false,
id: 11,
input_id: null,
},
{
editshow: false,
origin: true,
text: '終止合約權:<br>一、甲乙雙方之任一方若有違反合約之事實或發生清算或破產等信用貶落情形,致工程無法進行時,經催告而未改善者,他方得終止本合約,違約方必須賠償對方之損失。<br />二、乙方逾期交貨或甲方逾期未交付工地受領產品逾壹個月以上經他方催告仍不改善,他方得終止本合約,並請求損害賠償。',
type: 'title',
deleted: false,
id: 12,
input_id: null,
},
{
editshow: false,
origin: true,
text: '合意管轄:<br>因本合約而涉訟,甲、乙方雙方同意以桃園地方法院為第一審管轄法院。',
type: 'title',
deleted: false,
id: 13,
input_id: null,
},
{
editshow: false,
origin: true,
text: '附則:<br>本合約經甲、乙雙方簽章後立即生效,甲、乙雙方各存執正本各壹份為憑。',
type: 'title',
deleted: false,
id: 14,
input_id: null,
},
{
editshow: false,
origin: true,
text: '合約附件:<br>本合約附件為本合約之一部份,與本合約具同等效力,甲乙雙方均應遵守之,本合約附件計有:',
type: 'title',
deleted: false,
id: 15,
input_id: null,
},
]
}
},
fill: [],
standardData: {},
onstandardViewData: {},
deepClone: function (obj) {
let clone = Array.isArray(obj) ? [] : {};
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
if (typeof obj[key] === 'object' && obj[key] !== null) {
clone[key] = this.deepClone(obj[key]);
if (clone[key].text != undefined) {
// clone[key].text = clone[key].text.replace(/<input\s.* /, '___')
}
} else {
clone[key] = obj[key]
}
}
}
return clone;
},
modelshow: false,
modelText: '',
modelContent: '',
objName: '',
isList: false,
actionType: 'i', //i=> insert , u=> update
index: 0,
isInstall: true,
chineseNumbers(number) {
const units = ['', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十'];
if (number <= 10) {
return units[number];
} else if (number < 20) {
return '十' + units[number - 10];
} else if (number < 30) {
return '二十' + units[number - 20];
} else if (number < 40) {
return '三十' + units[number - 30];
} else if (number < 50) {
return '四十' + units[number - 40];
} else {
return '五十';
}
},
mouseover(obj, isInstall = true) {
if (isInstall) {
if (!this.onstandardViewData[obj].editshow) {
this.onstandardViewData[obj].editshow = true
}
} else {
if (!this.buyonstandardViewData[obj].editshow) {
this.buyonstandardViewData[obj].editshow = true
}
}
},
mouseoverlist(idx, inInstall = true) {
if (inInstall) {
if (!this.onstandardViewData.list.plaintext[idx].editshow) {
this.onstandardViewData.list.plaintext[idx].editshow = true
}
} else {
if (!this.buyonstandardViewData.list.plaintext[idx].editshow) {
this.buyonstandardViewData.list.plaintext[idx].editshow = true
}
}
},
mouseoutlist(idx) {
if (this.onstandardViewData.list.plaintext[idx].editshow) {
this.onstandardViewData.list.plaintext[idx].editshow = false
}
if (this.buyonstandardViewData.list.plaintext[idx].editshow) {
this.buyonstandardViewData.list.plaintext[idx].editshow = false
}
},
mouseout(obj) {
if (this.onstandardViewData[obj].editshow) {
this.onstandardViewData[obj].editshow = false
}
if (this.buyonstandardViewData[obj].editshow) {
this.buyonstandardViewData[obj].editshow = false
}
},
modelshowEditFn(text, obj, isList = false, isInstall = true) {
if (this.modelshow) {
return;
}
this.isInstall = isInstall
this.actionType = 'u'
this.modelshow = true
this.modelText = text
this.objName = obj
this.isList = isList
this.actionType = 'u'
if (isInstall) {
if (isList) {
this.$refs.editor.value = this.onstandardViewData.list.plaintext[obj].text
// CKEDITOR.instances.editor.setData(this.onstandardViewData.list.plaintext[obj].text);
return
}
if (!isList) {
this.$refs.editor.value = this.onstandardViewData[obj].plaintext
// CKEDITOR.instances.editor.setData(this.onstandardViewData[obj].plaintext);
return
}
} else {
if (isList) {
this.$refs.editor.value = this.buyonstandardViewData.list.plaintext[obj].text
// CKEDITOR.instances.editor.setData(this.buyonstandardViewData.list.plaintext[obj].text);
return
}
if (!isList) {
this.$refs.editor.value = this.buyonstandardViewData[obj].plaintext
// CKEDITOR.instances.editor.setData(this.buyonstandardViewData[obj].plaintext);
return
}
}
},
modelcloseFn() {
if (this.modelshow) {
this.modelshow = false
this.modelText = ''
this.modelContent = ''
this.isList = false
this.$refs.editor.value = ''
// CKEDITOR.instances.editor.setData('')
}
},
modelshowAddUpFn(idx, isInstall = true) {
this.isInstall = isInstall
this.index = idx
this.actionType = 'i'
this.modelshow = true
this.modelText = '新增一條例'
},
modelshowAddDownFn(idx, isInstall = true) {
this.isInstall = isInstall
this.index = idx + 1
this.actionType = 'i'
this.modelshow = true
this.modelText = '新增一條例'
},
updateEditor() {
let max = 0;
if (this.isInstall) {
this.onstandardViewData.list.plaintext.forEach(item => {
if (item.id > max) {
max = item.id
};
})
} else {
this.buyonstandardViewData.list.plaintext.forEach(item => {
if (item.id > max) {
max = item.id
};
})
}
max = max + 1
if (this.actionType == 'i') {
let newObj = {
editshow: false,
origin: false,
text: this.removeTrailingNewline(this.$refs.editor.value),
// text:this.removeTrailingNewline(this.convertHtmlToPlainText(this.$refs.editor.value)),
// text:this.removeTrailingNewline(this.convertHtmlToPlainText(CKEDITOR.instances.editor.getData())),
type: 'title',
deleted: false,
id: max,
}
if (this.isInstall) {
this.data.list.plaintext.splice(this.index, 0, newObj)
this.onstandardViewData.list.plaintext.splice(this.index, 0, newObj)
} else {
this.buydata.list.plaintext.splice(this.index, 0, newObj)
this.buyonstandardViewData.list.plaintext.splice(this.index, 0, newObj)
}
this.modelcloseFn()
return
}
if (this.actionType == 'u') {
if (this.isInstall) {
if (this.isList) {
// this.data.list.plaintext[this.objName].text = this.convertHtmlToPlainText(CKEDITOR.instances.editor.getData())
this.data.list.plaintext[this.objName].text = this.convertHtmlToPlainText(this.$refs.editor.value)
// this.onstandardViewData.list.plaintext[this.objName].text = this.convertHtmlToPlainText(CKEDITOR.instances.editor.getData())
// this.onstandardViewData.list.plaintext[this.objName].text = this.convertHtmlToPlainText(this.$refs.editor.value)
this.onstandardViewData.list.plaintext[this.objName].text = this.$refs.editor.value
} else {
// this.data[this.objName].plaintext = this.convertHtmlToPlainText(CKEDITOR.instances.editor.getData())
this.data[this.objName].plaintext = this.convertHtmlToPlainText(this.$refs.editor.value)
// this.onstandardViewData[this.objName].plaintext = this.convertHtmlToPlainText(CKEDITOR.instances.editor.getData())
// this.onstandardViewData[this.objName].plaintext = this.convertHtmlToPlainText(this.$refs.editor.value)
this.onstandardViewData[this.objName].plaintext = this.$refs.editor.value
}
} else {
if (this.isList) {
this.buydata.list.plaintext[this.objName].text = this.convertHtmlToPlainText(this.$refs.editor.value)
this.buyonstandardViewData.list.plaintext[this.objName].text = this.$refs.editor.value
} else {
this.buydata[this.objName].plaintext = this.convertHtmlToPlainText(this.$refs.editor.value)
this.buyonstandardViewData[this.objName].plaintext = this.$refs.editor.value
}
}
}
this.modelcloseFn()
return
},
deleteEditor(idx, isInstall = true) {
if (isInstall) {
if (confirm('確定要刪除嗎?')) {
let id = this.onstandardViewData.list.plaintext[idx].id
this.data.list.plaintext.forEach(item => {
if (item.id == id) {
item.deleted = 1;
}
})
this.onstandardViewData.list.plaintext.splice(idx, 1)
}
} else {
if (confirm('確定要刪除嗎?')) {
let id = this.buyonstandardViewData.list.plaintext[idx].id
// this.buydata.list.plaintext[idx].deleted = 1
this.buydata.list.plaintext.forEach(item => {
if (item.id == id) {
if (!item.deleted) {
item.deleted = 1;
}
}
})
this.buyonstandardViewData.list.plaintext.splice(idx, 1)
}
}
},
removeTrailingNewline(str) {
return str.replace(/\n+$/, '');
},
convertHtmlToPlainText(htmlString) {
// 創建一個新的DOMParser對象
var parser = new DOMParser();
// 使用parseFromString方法解析傳入的HTML字符串
var doc = parser.parseFromString(htmlString, 'text/html');
// 返回解析後的純文本內容
return doc.body.textContent || '';
},
exportFn(type) {
const form = this.$refs.form
const form = this.$refs.form;
const prviewType = this.$refs.form.querySelector('#prview-type');
const list = this.$refs.form.querySelector('#prview-list');
const list = this.$refs.form.querySelector('#privew-list');
const standardList = this.$refs.form.querySelector('#standard-prview-list');
const illustrate = this.$refs.form.querySelector('#illustrate');
const illustrate = this.$refs.form.querySelector('illustrate');
const standardIllustrate = this.$refs.form.querySelector('#standard-illustrate');
const partyA = this.$refs.form.querySelector('#partyA');
const partyAcontractno = this.$refs.form.querySelector('#partyAcontractno');
const total_price = this.$refs.form.querySelector('#total_price');
prviewType.value = type
prviewType.value = type;
if (type === 1) {
const standardJsonText = this.buystandardData.list.plaintext.map((item, idx) => {
let text = ''
text = item.text.replace(/\s+/g, "")
this.buydata.list.plaintext[idx].text = this.buydata.list.plaintext[idx].text.replace(/\s+/g, "")
const standarJsonText = this.buystandarDate.list.plaintext.map((item, idx) => {
let text = '';
text = item.text.replace(/\s+/g, "");
this.buydata.list.plaintext[idx].text = this.buydata.list.plaintext[idx].text.replace(/\s+/g, "");
return {
text: text,
id: item.id
}
});
const jsonText = this.buydata.list.plaintext.map(item => {
let text = ''
text = item.text
let text = '';
text = item.text;
return {
text: text,
origin: item.origin ? 1 : 0,
deleted: item.deleted ? 1 : 0,
id: item.id,
updated: item.updated ? 1 : 0,
updated: item.updated ? 1 : 0
}
});
list.value = JSON.stringify(jsonText)
standardList.value = JSON.stringify(standardJsonText)
illustrate.value = this.buydata.illustrate.plaintext
standardIllustrate.value = this.buystandardData.illustrate.plaintext
partyA.value = this.buydata.partyA.plaintext
partyAcontractno.value = this.buydata.partyAcontractno.plaintext
total_price.value = totalBuyPrice
list.value = JSON.stringify(jsonText);
standardList.value = JSON.stringify(standarJsonText);
illustrate.value = this.buydata.illustrate.plaintext;
standardIllustrate.value = this.buyonstandardViewData.illustrate.plaintext;
partyA.value = this.buydata.partyA.plaintext;
partyAcontractno.value = this.buydata.partyAcontractno.plaintext;
total_price.value = totalBuyPrice;
form.submit();
return;
}
if (type === 2) {
// list.value = JSON.stringify(this.data.list.plaintext)
const standardJsonText = this.standardData.list.plaintext.map((item, idx) => {
let text = ''
text = item.text.replace(/\s+/g, "")
const standardJsonText = this.standarData.list.plaintext.map((item, idx) => {
let text = '';
text = item.text.replace(/\s+/g, "");
if (this.data.list.plaintext[idx] !== undefined) {
this.data.list.plaintext[idx].text = this.data.list.plaintext[idx].text.replace(/\s+/g, "")
this.data.list.plaintext[idx].text = this.data.list.plaintext[idx].text.replace(/\s+/g, "");
}
return {
text: text,
@ -651,151 +106,31 @@ const contractDownload = () => {
}
})
const jsonText = this.data.list.plaintext.map(item => {
let text = ''
item.text
text = item.text
let text = '';
item.text;
text = item.text;
return {
text: text,
origin: item.origin ? 1 : 0,
deleted: item.deleted ? 1 : 0,
id: item.id,
updated: item.updated ? 1 : 0,
updated: item.updated ? 1 : 0
}
})
list.value = JSON.stringify(jsonText)
standardList.value = JSON.stringify(standardJsonText)
illustrate.value = this.data.illustrate.plaintext
standardIllustrate.value = this.standardData.illustrate.plaintext
partyA.value = this.data.partyA.plaintext
partyAcontractno.value = this.data.partyAcontractno.plaintext
total_price.value = totalInstallPrice
list.value = JSON.stringify(jsonText);
standardList.value = JSON.stringify(standarJsonText);
illustrate.value = this.data.illustrate.plaintext;
standardIllustrate.value = this.standardData.illustrate.plaintext;
partyA.value = this.data.partyA.plaintext;
partyAcontractno.value = this.data.partyAcontractno.plaintext;
total_price.value = totalInstallPrice;
form.submit();
return;
}
},
toggleBuyStandard: true,
toggleInstallStandard: true,
isbuyShow: true,
sendInstallInputFn() {
if (this.installfill1 == '') {
alert('請輸入安裝試車期限');
return;
}
if (this.installfill2 == '') {
alert('請輸入免費保養月數');
return;
}
if (this.installfill1 < 45) {
alert('安裝試車期限不得低於45日');
return;
}
if (this.installfill1 < 1) {
alert('免費保養月數不得低於1個月');
return;
}
this.isInstallInputIng = false
this.data.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。'
this.standardData.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。'
this.onstandardViewData.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。'
this.data.list.plaintext[5].text = '安裝試車事項:<br>一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台&nbsp;' + this.installfill1 + '&nbsp;日內安裝完成。<br>二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。<br>三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。'
this.standardData.list.plaintext[5].text = '安裝試車事項:<br>一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台&nbsp;' + this.installfill1 + '&nbsp;日內安裝完成。<br>二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。<br>三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。'
this.onstandardViewData.list.plaintext[5].text = '安裝試車事項:<br>一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台&nbsp;' + this.installfill1 + '&nbsp;日內安裝完成。<br>二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。<br>三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。'
this.data.list.plaintext[10].text = '電梯保養:<br>一、乙方完工交車後,期後&nbsp;' + this.installfill2 + '&nbsp;個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。<br>二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。<br>三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。'
this.standardData.list.plaintext[10].text = '電梯保養:<br>一、乙方完工交車後,期後&nbsp;' + this.installfill2 + '&nbsp;個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。<br>二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。<br>三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。'
this.onstandardViewData.list.plaintext[10].text = '電梯保養:<br>一、乙方完工交車後,期後&nbsp;' + this.installfill2 + '&nbsp;個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。<br>二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。<br>三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。'
},
sendInstallInputKeyupFn(e) {
if (e.keyCode !== 13) return
if (this.installfill1 == '') {
alert('請輸入安裝試車期限');
return;
}
if (this.installfill2 == '') {
alert('請輸入免費保養月數');
return;
}
if (this.installfill1 < 45) {
alert('安裝試車期限不得低於45日');
return;
}
if (this.installfill1 < 1) {
alert('免費保養月數不得低於1個月');
return;
}
this.isInstallInputIng = false
this.data.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。'
this.standardData.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。'
this.onstandardViewData.list.plaintext[1].text = '安裝產品規格:如附表' + this.affixArr[Number(this.installAffix)] + '。'
this.data.list.plaintext[5].text = '安裝試車事項:<br>一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台&nbsp;' + this.installfill1 + '&nbsp;日內安裝完成。<br>二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。<br>三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。'
this.standardData.list.plaintext[5].text = '安裝試車事項:<br>一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台&nbsp;' + this.installfill1 + '&nbsp;日內安裝完成。<br>二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。<br>三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。'
this.onstandardViewData.list.plaintext[5].text = '安裝試車事項:<br>一、甲方應於實際出貨日期前七日,清理升降設備之建築物升降道,及完成底坑防水之處理,上述事項完成後,甲方即以書面或電話通知乙方進場安裝,乙方應於貨抵工地後每台&nbsp;' + this.installfill1 + '&nbsp;日內安裝完成。<br>二、甲方接到乙方電梯安裝完成通知之日起,倘因甲方因素致無法於四十五日內交車時,甲方應付清總價款全部餘額。<br>三、如因非關乙方因素致乙方無法進場施作時,於該因素或障礙排除前,甲方應對已進場之材料或設備負保管責任及整修費用。'
this.data.list.plaintext[10].text = '電梯保養:<br>一、乙方完工交車後,期後&nbsp;' + this.installfill2 + '&nbsp;個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。<br>二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。<br>三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。'
this.standardData.list.plaintext[10].text = '電梯保養:<br>一、乙方完工交車後,期後&nbsp;' + this.installfill2 + '&nbsp;個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。<br>二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。<br>三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。'
this.onstandardViewData.list.plaintext[10].text = '電梯保養:<br>一、乙方完工交車後,期後&nbsp;' + this.installfill2 + '&nbsp;個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。<br>二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。<br>三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。'
},
sendBuyInputFn() {
if (this.buyfill1 == '') {
alert('請輸入交貨期限');
return;
}
if (this.buyfill1 < 1) {
alert('交貨期限不得低於1日');
return;
}
if (buyArr[1].installment == 2) {
this.buydata.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2);
this.buystandardData.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2);
this.buyonstandardViewData.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2);
}
this.isBuyInputIng = false
this.buydata.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。'
this.buystandardData.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。'
this.buyonstandardViewData.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。'
this.buydata.list.plaintext[5].text = '交貨期限及甲方配合事項:<br>乙方應於接獲甲方圖色確認第&nbsp;' + this.buyfill1 + '&nbsp;日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。'
this.buystandardData.list.plaintext[5].text = '交貨期限及甲方配合事項:<br>乙方應於接獲甲方圖色確認第&nbsp;' + this.buyfill1 + '&nbsp;日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。'
this.buyonstandardViewData.list.plaintext[5].text = '交貨期限及甲方配合事項:<br>乙方應於接獲甲方圖色確認第&nbsp;' + this.buyfill1 + '&nbsp;日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。'
let buyAffixHtml = ''
for (let i = 0; i < Number(this.buyAffix); i++) {
buyAffixHtml += `<br>${numberToSmallChinese(i + 1)}、附表${numberToSmallChinese(i + 1)}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;共&nbsp;1&nbsp;張`
}
this.buydata.list.plaintext[15].text = this.buydata.list.plaintext[15].text + buyAffixHtml
this.buystandardData.list.plaintext[15].text = this.buystandardData.list.plaintext[15].text + buyAffixHtml
this.buyonstandardViewData.list.plaintext[15].text = this.buyonstandardViewData.list.plaintext[15].text + buyAffixHtml
},
sendBuyInputKeyupFn(e) {
if (e.keyCode !== 13) return
if (this.buyfill1 == '') {
alert('請輸入交貨期限');
return;
}
if (this.buyfill1 < 1) {
alert('交貨期限不得低於1日');
return;
}
if (buyArr[1].installment == 2) {
this.buydata.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2);
this.buystandardData.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2);
this.buyonstandardViewData.list.plaintext[4].text = this.buydata.list.plaintext[4].text.replace('____', this.buyfill2);
}
this.isBuyInputIng = false
this.buydata.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。'
this.buystandardData.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。'
this.buyonstandardViewData.list.plaintext[1].text = '產品規格:如附表' + this.affixArr[Number(this.buyAffix)] + '。'
this.buydata.list.plaintext[5].text = '交貨期限及甲方配合事項:<br>乙方應於接獲甲方圖色確認第&nbsp;' + this.buyfill1 + '&nbsp;日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。'
this.buystandardData.list.plaintext[5].text = '交貨期限及甲方配合事項:<br>乙方應於接獲甲方圖色確認第&nbsp;' + this.buyfill1 + '&nbsp;日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。'
this.buyonstandardViewData.list.plaintext[5].text = '交貨期限及甲方配合事項:<br>乙方應於接獲甲方圖色確認第&nbsp;' + this.buyfill1 + '&nbsp;日(應於合約簽訂日起兩年內),將本工程所需之全部設備、器材 運抵工地,甲方應提供適當的場所供乙方貯放設備、器材。'
let buyAffixHtml = ''
for (let i = 0; i < Number(this.buyAffix); i++) {
buyAffixHtml += `<br>${numberToSmallChinese(i + 1)}、附表${numberToSmallChinese(i + 1)}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;共&nbsp;1&nbsp;張`
}
this.buydata.list.plaintext[15].text = this.buydata.list.plaintext[15].text + buyAffixHtml
this.buystandardData.list.plaintext[15].text = this.buystandardData.list.plaintext[15].text + buyAffixHtml
this.buyonstandardViewData.list.plaintext[15].text = this.buyonstandardViewData.list.plaintext[15].text + buyAffixHtml
},
affixArr: ['', '一', '一、二', '一、二、三', '一、二、三、四', '一、二、三、四、五'],
isBuyInputIng: true,
isInstallInputIng: true,
}
}
};

649
wms/contract-repair/prviewPdf.php

@ -0,0 +1,649 @@
<?php
include "../header.php";
require_once('./conn.php');
if ($_POST['list']) {
$contract_id = $_POST['contract_apply_id'];
if ($_POST['prviewType'] == 1) {
$isStand = ($_POST['buystandard'] == "true") ? 1 : 0;
} else {
$isStand = $_POST['installstandard'] == "true" ? 1 : 0;
}
$type = $_POST['prviewType'] == '1' ? "電梯買賣合約書" : "電梯安裝合約書";
$list = json_decode($_POST['list']);
$standardList = json_decode($_POST['standardList']);
$illustrate = $_POST['illustrate'];
$updatedIllustrate = false;
$standardIllustrate = $_POST['standardIllustrate'];
$partyA = $_POST['partyA'];
$partyAcontractno = $_POST['partyAcontractno'];
$total_price = $_POST['total_price'];
$person = $_POST['person'];
$personid = $_POST['personid'];
$delivery_term = $_POST['delivery_term'];
$install_period = $_POST['install_period'];
$free_maintainance = $_POST['free_maintainance'];
// $originArr = array_filter(json_decode(json_encode($list), true), fn($item)=> $item['origin'] == 1);
$standardArr = json_decode(json_encode($standardList), true);
$nostandardArr = json_decode(json_encode($list), true);
$newlist = array_values(array_filter($list, fn ($item) => $item->deleted == 0));
foreach ($nostandardArr as $idx => &$item) {
if ($item['origin'] === 1) {
if (strip_tags($item['text']) != strip_tags($standardArr[$item['id']]['text'])) {
$item['updated'] = 1;
} else {
$item['updated'] = 0;
}
}
}
unset($item);
if (strip_tags($illustrate) != strip_tags($standardIllustrate)) {
$updatedIllustrate = true;
}
$sql_str = "SELECT * FROM hope_elevator_customer WHERE vol_no = :vol_no";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':vol_no', $partyAcontractno);
$stmt->execute();
$customer = $stmt->fetch(PDO::FETCH_ASSOC);
if (count($customer) <= 0) {
echo "<script>
alert('資料不齊或合約書已生成過。');
window.history.back();
</script>";
}
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':contract_id', $contract_id);
$stmt->execute();
$files = $stmt->fetchAll(PDO::FETCH_ASSOC);
function numberToChinese($num)
{
$chineseNumbers = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十'];
$units = ['', '十', '百', '千', '万'];
if ($num <= 10) {
return $chineseNumbers[$num];
} elseif ($num < 20) {
return $units[1] . $chineseNumbers[$num % 10];
} elseif ($num < 100) {
return $chineseNumbers[intval($num / 10)] . $units[1] . ($num % 10 > 0 ? $chineseNumbers[$num % 10] : '');
} else {
// 處理大於 99 的数字
$result = '';
$strNum = strval($num);
$length = strlen($strNum);
for ($i = 0; $i < $length; $i++) {
$currentDigit = intval($strNum[$i]);
if ($currentDigit > 0) {
$result .= $chineseNumbers[$currentDigit] . $units[$length - $i - 1];
} else {
$result .= $chineseNumbers[$currentDigit];
}
}
return $result;
}
}
function removeTrailingBr($string)
{
//刪除字串尾巴的<br><br />
return preg_replace('/(<br\s*\/?>)+$/', '', $string);
}
?>
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.5.0/axios.min.js" integrity="sha512-aoTNnqZcT8B4AmeCFmiSnDlc4Nj/KPaZyB5G7JnOnUEkdNpCZs1LCankiYi01sLTyWy+m2P+W4XM+BuQ3Q4/Dg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.3/purify.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.3/html2canvas.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js" integrity="sha512-E8QSvWZ0eCLGk4km3hxSsNmGWbLtSCSUcewDQPQWZF6pEU8GlT8a5fF32wOl1i8ftdMhssTrF/OhyGWwonTcXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<style>
.container {
background-color: transparent !important;
width: 100% !important;
}
.prview,
.footer {
width: 800px;
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;
margin: 0;
padding: 0;
}
td tr table th {
border: none !important;
background-color: #fff !important;
}
tr:nth-child(even) {
background-color: #fff !important;
}
.colorDiv {
display: flex;
margin: 10px 0;
}
.colorDiv .block {
width: 18px;
height: 18px;
}
.colorDiv span {
font-size: 15px;
margin: 0 5px 0 2px;
font-weight: 600;
}
.colorDiv .block.gray {
background-color: #DDDDDD;
}
.colorDiv .block.green {
background-color: #00B900;
}
.colorDiv .block.red {
background-color: #D11919;
}
#btn,
.pre {
background-color: #0D559D;
color: #fff;
outline: none;
border: none;
border: 1px #ccc solid;
width: 100px;
height: 32px;
font-weight: 600;
border-radius: 6px;
margin-right: 5px;
}
.pre {
background-color: #40C474;
}
</style>
<div class="container" x-data="{
css:'',
random:'',
init(){
const characters = '012345678901234567890123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
const charactersLength = characters.length;
let randomString = '';
const length = 15;
for (let i = 0; i < length; i++) {
const randomIndex = Math.floor(Math.random() * charactersLength);
randomString += characters.charAt(randomIndex);
}
this.random = randomString;
console.log(files);
},
exportFn(){
const now = new Date();
// 獲取年、月、日、小時、分鐘、秒
const year = now.getFullYear();
const month = now.getMonth() + 1; // 月份是從0開始的,所以要加1
const day = now.getDate();
const hours = now.getHours();
const minutes = now.getMinutes();
const seconds = now.getSeconds();
// 格式化日期和時間
const formattedDate = `${year}${month}${day}${hours}${minutes}${seconds}`;
let token = formattedDate + '<?php echo $partyAcontractno; ?><?php echo $partyA; ?>永佳捷<?php echo $total_price; ?>'
let newtoken = formattedDate + '-' + CryptoJS.MD5(CryptoJS.SHA256(CryptoJS.SHA256(CryptoJS.MD5(token).toString()).toString() + this.random).toString()).toString()
console.log(newtoken);
let html = this.$refs.prview.innerHTML
let footer = this.$refs.footer.innerHTML
let affix1 = this.$refs.affix1.innerHTML
// html = this.$refs.footer.innerHTML
// axios.post('./export-pdf.php', {'html':html}).then(res=>{
// console.log(res);
// })
const form = new FormData();
form.append('html', html);
form.append('footer', footer);
form.append('affix1', affix1);
form.append('css',this.css);
form.append('user_name', '<?php echo $user_name; ?>');
form.append('contract_no', '<?php echo $partyAcontractno; ?>');
form.append('party_a', '<?php echo $partyA; ?>');
form.append('total_price', '<?php echo $total_price; ?>');
form.append('person', '<?php echo $person; ?>');
form.append('token', newtoken);
form.append('formattedDate', formattedDate);
axiosClient({
method:'post',
responseType:'blob',
url:'./export-pdf.php',
data:form
}).then(response=>{
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', formattedDate + '.pdf'); // 指定下载的文件名
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.store(newtoken, formattedDate)
for(let i=0;i<files.length;i++){
let filename = document.createElement('a');
filename.href = './images/contracts_new_files/' + files[i].file_name;
filename.setAttribute('download', filename.href); // 指定下载的文件名
document.body.appendChild(filename);
filename.click();
document.body.removeChild(filename);
}
})
},
store(newtoken, formattedDate){
const form = new FormData();
form.append('contract_id', '<?php echo $partyAcontractno; ?>')
form.append('uscc', '<?php echo $customer['uscc']; ?>')
form.append('ekind', '新梯')
form.append('new_elevator', '<?php $_POST['prviewType'] == '1' ? "買賣" : "安裝"; ?>')
form.append('party_a', '<?php echo $partyA; ?>')
form.append('total_price', <?php echo (int)$total_price; ?>)
form.append('accound_id', '<?php echo $personid; ?>')
form.append('times', 1)
form.append('random', this.random)
form.append('hash', newtoken)
form.append('url', formattedDate+'.pdf' );
form.append('created_by', '<?php echo $user_id; ?>')
form.append('delivery_term', '<?php echo $delivery_term; ?>')
form.append('install_period', '<?php echo $install_period; ?>')
form.append('free_maintainance', '<?php echo $free_maintainance; ?>')
axiosClient({
method:'post',
url:'./store-contract.php',
data:form
}).then(res=>{
console.log(res);
})
},
}">
<button @click="history.go(-1)" class="pre">回前頁</button>
<button id="btn" @click="exportFn()">點我下載</button>
<?php if ($isStand == 0) { ?>
<div class="colorDiv">
<div class="block gray"></div>
<span>修改的條列</span>
<div class="block green"></div>
<span>新增的條列</span>
<div class="block red"></div>
<span>刪除的條列</span>
</div>
<?php } ?>
<div class="prview" id="prview" x-ref="prview" style="font-family:'標楷體'" x-show="false">
<h2 style="text-align:center;font-size:18pt;"><?php echo $type; ?></h2>
<p style="font-size: 12pt;">合約書編號:<?php echo $_POST['partyAcontractno'] ?></p>
<table>
<tr>
<td style="width:100px"></td>
<td style="width:200px"><?php echo $_POST['partyA'] ?></td>
<td>(即買方,以下簡稱為甲方)</td>
</tr>
</table>
<p style="font-size: 12pt;">立合約書人</p>
<table>
<tr>
<td style="width:100px"></td>
<td style="width:200px">永佳捷科技股份有限公司</td>
<td>(即賣方,以下簡稱為乙方)</td>
</tr>
</table>
<p style="font-size: 12pt;width:440px"><?php echo $illustrate; ?></p>
<table style="width:100%">
<?php foreach ($newlist as $idx => $item) {
?>
<tr style="display:block;">
<td style="width:60px;"><?php echo numberToChinese($idx + 1); ?></td>
<td style="width:445px;"><?php echo nl2br(removeTrailingBr(json_decode(json_encode($item), true)['text'])); ?></td>
</tr>
<?php } ?>
</table>
</div>
<section style="display:flex;justify-content:center;">
<div class="prview" style="font-family:'標楷體';background-color:#fff;">
<h2 style="text-align:center;font-size:18pt;"><?php echo $type; ?></h2>
<p style="font-size: 12pt;">合約書編號:<?php echo $_POST['partyAcontractno'] ?></p>
<table style="border:none">
<tr style="border:none;">
<td style="border:none;width:100px;"></td>
<td style="border:none;width:200px"><?php echo $_POST['partyA'] ?></td>
<td style="border:none">(即買方,以下簡稱為甲方)</td>
</tr>
</table>
<p style="font-size: 12pt;">立合約書人</p>
<table style="border:none">
<tr style="border:none;">
<td style="border:none;width:100px"></td>
<td style="border:none;width:200px">永佳捷科技股份有限公司</td>
<td style="border:none">(即賣方,以下簡稱為乙方)</td>
</tr>
</table>
<p style="font-size: 12pt;width:800px"><?php echo $standardIllustrate; ?></p>
<table style="width:100%;border:none">
<?php foreach ($standardList as $idx => $item) {
?>
<tr style="margin-bottom:10px;display:block;border:none">
<td style="width:100px;border:none"><?php echo numberToChinese($idx + 1); ?></td>
<td style="border:none"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td>
</tr>
<?php } ?>
</table>
</div>
<?php if ($isStand == 0) { ?>
<div class="prview nostandard" style="font-family:'標楷體'" x-ref="nostandard">
<h2 style="text-align:center;font-size:18pt;"><?php echo $type; ?></h2>
<p style="font-size: 12pt;">合約書編號:<?php echo $_POST['partyAcontractno'] ?></p>
<table style="border:none">
<tr style="border:none;">
<td style="border:none;width:100px;"></td>
<td style="border:none;width:200px"><?php echo $_POST['partyA'] ?></td>
<td style="border:none">(即買方,以下簡稱為甲方)</td>
</tr>
</table>
<p style="font-size: 12pt;">立合約書人</p>
<table style="border:none">
<tr style="border:none;">
<td style="border:none;width:100px"></td>
<td style="border:none;width:200px">永佳捷科技股份有限公司</td>
<td style="border:none">(即賣方,以下簡稱為乙方)</td>
</tr>
</table>
<p style="font-size: 12pt;width:800px;<?php if ($updatedIllustrate) {
echo 'background-color:#ddd';
} ?>"><?php echo $illustrate; ?></p>
<table style="width:100%;border:none">
<?php foreach ($nostandardArr as $idx => $item) {
?>
<tr style="margin-bottom:10px;display:block;border:none">
<td style="width:100px;border:none"><?php echo numberToChinese($idx + 1); ?></td>
<?php if ($item['updated'] == 1) { ?>
<td style="border:none;background-color:#ddd;"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td>
<?php } elseif ($item['deleted'] == 1) { ?>
<td style="border:none;background-color:#D11919;text-decoration:line-through"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td>
<?php } elseif ($item['id'] > 15) { ?>
<td style="border:none;background-color:#00B900;"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td>
<?php } else { ?>
<td style="border:none"><?php echo nl2br(removeTrailingBr(json_decode(json_encode($item), true)['text'])); ?></td>
<?php } ?>
</tr>
<?php } ?>
</table>
</div>
<?php } ?>
</section>
<div class="footer" x-ref="footer" x-show="false">
<br />
<p> 立合約書人:</p>
<table>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:30px;border:none"></td>
<td style="width:30px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
</td>
<td style="border:none">&nbsp;<?php echo $_POST['partyA']; ?></td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:20px;border:none;"></td>
<td style="width:20px;border:none;text-align:center"></td>
<td style="width:20px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
<td style="border:none">&nbsp;<?php echo $customer['manager']; ?></td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:15px;border:none;"></td>
<td style="width:15px;border:none;text-align:center"></td>
<td style="width:15px;border:none;text-align:center"></td>
<td style="width:15px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
<td style="border:none">&nbsp;<?php echo $customer['uscc']; ?></td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:30px;border:none;"></td>
<td style="width:30px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
<td style="border:none">&nbsp;<?php echo $customer['address']; ?></td>
</tr>
</table>
<p style="line-height:0.1">&nbsp;</p>
<table>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:30px;border:none"></td>
<td style="width:30px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
</td>
<td style="border:none">&nbsp;永佳捷科技股份有限公司</td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:20px;border:none;"></td>
<td style="width:20px;border:none;text-align:center"></td>
<td style="width:20px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
</td>
<td style="border:none">&nbsp;蔡定憲</td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:15px;border:none;"></td>
<td style="width:15px;border:none;text-align:center"></td>
<td style="width:15px;border:none;text-align:center"></td>
<td style="width:15px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
</td>
<td style="border:none">&nbsp;90493119</td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:30px;border:none;"></td>
<td style="width:30px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
</td>
<td style="border:none">&nbsp;臺北市中山區敬業一路128巷39號3樓之1</td>
</tr>
</table>
<p>&nbsp;</p>
<!-- <table>
<tr>
<td style="width:200px;border:none;text-align:justify">中華民國</td>
<td style="width:100px;border:none;text-align:right"></td>
<td style="width:100px;border:none;text-align:right"></td>
<td style="width:100px;border:none;text-align:right"></td>
</tr>
</table> -->
</div>
<div class="affix1" x-ref="affix1" x-show="false">
<h1 style="text-align:center">升降設備除外工程表</h1>
<table>
<tr>
<td style="width:40px">一、</td>
<td>機械室之建造,含預留出入口、通風照明、自動閉鎖裝置,及天花板上之保養用吊鉤。</td>
</tr>
<tr>
<td style="width:40px">二、</td>
<td style="width:460px">通往機械室之樓梯及加護欄杆工程。</td>
</tr>
<tr>
<td style="width:40px">三、</td>
<td style="width:460px">機械室基礎台需用防濕之瀝青鐵筋混凝土及地板防塵工事。</td>
</tr>
<tr>
<td style="width:40px">四、</td>
<td style="width:460px">機械室及升降路中間之橫樑或工字樑之安裝工程。</td>
</tr>
<tr>
<td style="width:40px">五、</td>
<td style="width:460px">自屋外至機械室之動力及照明用配線電源開關插座,及接地線等電路工程。</td>
</tr>
<tr>
<td style="width:40px">六、</td>
<td style="width:460px">升降路及機械室以外監視盤、電鈴、電話之配管與配線工程。</td>
</tr>
<tr>
<td style="width:40px">七、</td>
<td style="width:460px">升降路之建造及底部之防水工程及緩衝器水泥台工程。</td>
</tr>
<tr>
<td style="width:40px">八、</td>
<td style="width:460px">機坑照明保養用之開關及插座,鐵爬梯。</td>
</tr>
<tr>
<td style="width:40px">九、</td>
<td style="width:460px">各樓按鈕開關之留洞工程及安裝後之固定與週邊裝飾工程。</td>
</tr>
<tr>
<td style="width:40px">十、</td>
<td style="width:460px">升降路內甲方不得裝設有任何與升降設備無關之配線、電線配管、水管、風管等設備。</td>
</tr>
<tr>
<td style="width:40px">十一、</td>
<td style="width:460px">安裝所需水泥、砂石、水電與供試車用動力電源。</td>
</tr>
<tr>
<td style="width:40px">十二、</td>
<td style="width:460px">升降路及機房之建造,電源設備之容量及位置等,需符合國家標準(CNS-2866)及建築法規等規定。</td>
</tr>
<tr>
<td style="width:40px">十三、</td>
<td style="width:460px">機械運抵工地後供給儲存倉庫。</td>
</tr>
<tr>
<td colspan="2">備註:CNS-2866國家標準建築物電梯有關之法規: </td>
</tr>
<tr>
<td style="width:25px">1.</td>
<td style="width:475px">機械室內應設有照明及通風設備,以利管理檢查,照明應在100LUX(米一燭光)以上,通風設備應能使室內溫度保持在攝氏40度以下。</td>
</tr>
<tr>
<td style="width:25px">2.</td>
<td style="width:475px">機械室之出入口應加鎖,其裝置應良好。 </td>
</tr>
<tr>
<td style="width:25px">3.</td>
<td style="width:475px">由機械室至走廊,樓梯間應便於通行,樓梯應加裝扶手,其與水平面之傾斜角度,應不超過60度。 </td>
</tr>
<tr>
<td style="width:25px">4.</td>
<td style="width:475px">機械室出入門之構造,應有下述裝置: <br>
A:能自動關閉者。 <br>
B:有彈簧鎖或其類似裝置,以便室內不用鎖匙,而能開門。 <br>
C:除屋頂開口部份以外,機械式牆壁,應能耐火。(二小時防火時效)
</td>
</tr>
<tr>
<td style="width:25px">5.</td>
<td style="width:475px">升降路內不得設置與升降機無關之配管及配線。 </td>
</tr>
<tr>
<td style="width:25px">6.</td>
<td style="width:475px">任一升降路下部之任何部份,供人使用或類似使用時配重側比照車廂,同樣必須裝設緊急安全裝置。</td>
</tr>
<tr>
<td style="width:25px">7.</td>
<td style="width:475px">若有火警受信總機時,甲方需提供"火警受信總機"檢出信號及通往升降道內之配管配線(0.75MM² × 3) </td>
</tr>
</table>
</div>
</div>
<script>
const files = <?php echo json_encode($files); ?>;
const axiosClient = axios.create({
baseURL: ``,
});
axiosClient.interceptors.request.use((config) => {
config.headers.Authorization = `Bearer ${123}`
return config;
}, (error) => {
return Promise.reject(error);
});
axiosClient.interceptors.response.use((response) => {
return response;
}, (error) => {
if (error.response.status === 401) {}
throw error;
});
const btn = document.getElementById('btn')
console.log(<?php echo $contract_id; ?>);
</script>
<?php
} else {
echo "<script>alert('非法訪問!');window.history.back();</script>";
}
?>

525
wms/contract/contract-download.php

@ -2,8 +2,8 @@
include "../header.php";
require_once('./conn.php');
//買賣1、2、3,安裝5、6 (4跟7很少有)
if(isset($_GET['id']) && $_GET['id']!=""){
try{
if (isset($_GET['id']) && $_GET['id'] != "") {
try {
$id = $_GET['id'];
$sql_str = "SELECT pricereview_main.*, pricereview_pay.*, pricereview_item.note, pricereview_item.item_qty, account.name as accountname, account.id as accountid
FROM pricereview_main
@ -26,7 +26,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){
$contracts = $stmt->fetchAll(PDO::FETCH_ASSOC);
$contract = $contracts[0];
$contract_apply_id = $contract['id'];
if(($contract['status'] !== "YY" && $user_id != 'M0107') && $user_id != 'M0174'){
if (($contract['status'] !== "YY" && $user_id != 'M0107') && $user_id != 'M0174' && $user_id != 'M0225') {
echo '<script type="text/javascript">
alert("非法訪問。");
window.history.back();
@ -38,46 +38,45 @@ if(isset($_GET['id']) && $_GET['id']!=""){
$stmt->bindParam(':vol_no', $contract['contractno']);
$stmt->execute();
$customer = $stmt->fetchAll(PDO::FETCH_ASSOC);
if(count($customer) <= 0 ){
echo "<script>
alert('資料不齊或合約書已生成過。');
window.history.back();
</script>";
exit;
}
// if (count($customer) <= 0) {
// echo "<script>
// alert('資料不齊或合約書已生成過。');
// window.history.back();
// </script>";
// exit;
// }
$buyArr = [];
$buyNo2Pay = false;
$buy_total_price = 0;
$installArr = [];
$install_total_price = 0;
// $noteArr = explode(",", $contracts[0]['note']);
$noteArr = array(1,1,1,1,1);
$noteArr = array(1, 1, 1, 1, 1);
$qty = $contracts[0]['total_items'];
foreach($contracts as $idx=>$amount){
foreach ($contracts as $idx => $amount) {
$isset = false;
if($amount['pay_kind']==5 || $amount['pay_kind']==6){
if($amount['pay_scale'] >= 0){
if ($amount['pay_kind'] == 5 || $amount['pay_kind'] == 6) {
if ($amount['pay_scale'] >= 0) {
$install_total_price = $install_total_price + $amount['pay_amount'];
$installArr[] = ['installment'=> $amount['pay_kind'], 'scale'=> $amount['pay_scale'], 'amount'=> $amount['pay_amount'], 'pay_period'=>$amount['pay_period']];
$installArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']];
}
}
if($amount['pay_kind']==1 || $amount['pay_kind']==2 || $amount['pay_kind']==3){
if($amount['pay_scale'] > 0){
if ($amount['pay_kind'] == 1 || $amount['pay_kind'] == 2 || $amount['pay_kind'] == 3) {
if ($amount['pay_scale'] > 0) {
$buy_total_price = $buy_total_price + $amount['pay_amount'];
foreach($buyArr as $buy){
if($buy['installment'] == $amount['pay_kind']){
foreach ($buyArr as $buy) {
if ($buy['installment'] == $amount['pay_kind']) {
$isset = true;
}
}
if(!$isset){{
$buyArr[] = ['installment'=>$amount['pay_kind'], 'scale'=>$amount['pay_scale'], 'amount'=>$amount['pay_amount'], 'pay_period'=>$amount['pay_period']];
}
if($amount['pay_kind'] == 2){
$buyNo2Pay = true;
if (!$isset) { {
$buyArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']];
}
if ($amount['pay_kind'] == 2) {
$buyNo2Pay = true;
}
}
}
}
}
}
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL";
@ -87,9 +86,8 @@ if(isset($_GET['id']) && $_GET['id']!=""){
$stmt->execute();
$files = $stmt->fetchAll(PDO::FETCH_ASSOC);
$files_count = count($files);
}
catch (PDOException $e ){
die("ERROR!!!: ". $e->getMessage());
} catch (PDOException $e) {
die("ERROR!!!: " . $e->getMessage());
}
}
?>
@ -100,25 +98,25 @@ if(isset($_GET['id']) && $_GET['id']!=""){
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.3/html2canvas.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<main x-data="contractDownload">
<div class="sidebar">
<ul>
<button :class="isbuyShow ? 'active' : ''" @click="isbuyShow = true">電梯買賣合約書</button>
<button :class="!isbuyShow ?'active' : ''" @click="isbuyShow = false">電梯安裝合約書</button>
<a href="../mkt/pricereview-index.php?function_name=pricereview&<?php echo $token_link; ?>">回列表</a>
</ul>
</div>
<div class="inputDiv" x-show="isbuyShow && isBuyInputIng">
<!-- <label for="">
<div class="sidebar">
<ul>
<button :class="isbuyShow ? 'active' : ''" @click="isbuyShow = true">電梯買賣合約書</button>
<button :class="!isbuyShow ?'active' : ''" @click="isbuyShow = false">電梯安裝合約書</button>
<a href="../mkt/pricereview-index.php?function_name=pricereview&<?php echo $token_link; ?>">回列表</a>
</ul>
</div>
<div class="inputDiv" x-show="isbuyShow && isBuyInputIng">
<!-- <label for="">
<p>交貨期限(日)</p>
<input type="number" x-model="buyfill1" @keyup="sendBuyInputKeyupFn($event)" />
</label> -->
<?php if($buyNo2Pay){ ?>
<!-- <label for="">
<?php if ($buyNo2Pay) { ?>
<!-- <label for="">
<p>第二期款交貨期限(日)</p>
<input type="number" x-model="buyfill2">
</label> -->
<?php } ?>
<!-- <label for="">
<?php } ?>
<!-- <label for="">
<p>附件數</p>
<select x-model="buyAffix">
<option value="1">1</option>
@ -128,44 +126,56 @@ if(isset($_GET['id']) && $_GET['id']!=""){
<option value="5">5</option>
</select>
</label> -->
<label for="">
<button @click="sendBuyInputFn()">生成買賣合約書</button>
</label>
</div>
<div class="contract-material-component" x-show="isbuyShow && !isBuyInputIng">
<div class="btn-list">
<label for="standardBuyBtn">
<p>制式合約</p>
<input type="checkbox" class="scorll" x-model="toggleBuyStandard">
<!-- <input type="radio" checked id="standardBuyBtn" name="standardBuyBtn" @change="toggleBuyStandard = true" /> -->
<label for="">
<button @click="sendBuyInputFn()">生成買賣合約書</button>
</label>
<!-- <label for="noStandardBuyBtn">
</div>
<div class="contract-material-component" x-show="isbuyShow && !isBuyInputIng">
<div class="btn-list">
<label for="standardBuyBtn">
<p>制式合約</p>
<input type="checkbox" class="scorll" x-model="toggleBuyStandard">
<!-- <input type="radio" checked id="standardBuyBtn" name="standardBuyBtn" @change="toggleBuyStandard = true" /> -->
</label>
<!-- <label for="noStandardBuyBtn">
<input type="radio" id="noStandardBuyBtn" name="standardBuyBtn" @change="toggleBuyStandard = false" />
非制式合約
</label> -->
</div>
<button @click="isBuyInputIng = true" class="rebtn">重新輸入</button>
<button @click="exportFn(1)" class="prviewbtn">預覽</button>
<div class="contract" id="noStandardBuyContract" x-show="!toggleBuyStandard">
<table class="my-2 contract" x-ref="contract1" id="contract1">
<tr >
<td class="center"><h2 style="text-align:center">電梯買賣合約書</h2></td>
</tr>
<tr >
<td colspan="1">
合約書編號:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article>
</td>
</tr>
<tr>
<td><div style="margin-left: 100px"><p x-html="onstandardViewData.partyA.plaintext">一二營造有限公司 </p></div><div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div></td>
</tr>
<tr>
<td >立合約書人</td>
</tr>
<tr>
<td ><div style="margin-left: 100px"><p>永佳捷科技股份有限公司 </p></div><div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div></td>
</tr>
<tr :class="buyonstandardViewData.illustrate.editshow ? 'mouseover' : '' " x-on:mouseover="mouseover('illustrate', false)" x-on:mouseout="mouseout('illustrate')">
</div>
<button @click="isBuyInputIng = true" class="rebtn">重新輸入</button>
<button @click="exportFn(1)" class="prviewbtn">預覽</button>
<div class="contract" id="noStandardBuyContract" x-show="!toggleBuyStandard">
<table class="my-2 contract" x-ref="contract1" id="contract1">
<tr>
<td class="center">
<h2 style="text-align:center">電梯買賣合約書</h2>
</td>
</tr>
<tr>
<td colspan="1">
合約書編號:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article>
</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p x-html="onstandardViewData.partyA.plaintext">一二營造有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div>
</td>
</tr>
<tr>
<td>立合約書人</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p>永佳捷科技股份有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div>
</td>
</tr>
<tr :class="buyonstandardViewData.illustrate.editshow ? 'mouseover' : '' " x-on:mouseover="mouseover('illustrate', false)" x-on:mouseout="mouseout('illustrate')">
<td>
<span x-html='buydata.illustrate.plaintext'></span>
<div class="buttons" x-show="buyonstandardViewData.illustrate.editshow" x-cloak>
@ -174,8 +184,8 @@ if(isset($_GET['id']) && $_GET['id']!=""){
</div>
</td>
</tr>
<template x-for="(item, idx) in buyonstandardViewData.list.plaintext" :key="item.id">
<tr :class="buyonstandardViewData.list.plaintext[idx].editshow ? 'mouseover' : '' " @mouseover="mouseoverlist(idx, false)" @mouseout="mouseoutlist(idx)">
<template x-for="(item, idx) in buyonstandardViewData.list.plaintext" :key="item.id">
<tr :class="buyonstandardViewData.list.plaintext[idx].editshow ? 'mouseover' : '' " @mouseover="mouseoverlist(idx, false)" @mouseout="mouseoutlist(idx)">
<td class="list">
<div class="buttons" x-show="buyonstandardViewData.list.plaintext[idx].editshow" x-cloak>
<button class="edit" @click="modelshowEditFn('update contract list', idx, true, false)"><i class="glyphicon glyphicon-pencil"></i></button>
@ -183,59 +193,72 @@ if(isset($_GET['id']) && $_GET['id']!=""){
<button class="add" @click="modelshowAddDownFn(idx, false)"><i class="glyphicon glyphicon-arrow-down"></i></button>
<button class="delete" @click="deleteEditor(idx, false)"><i class="glyphicon glyphicon-trash"></i></button>
</div>
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span><article x-html="buyonstandardViewData.list.plaintext[idx].text"></article>
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span>
<article x-html="buyonstandardViewData.list.plaintext[idx].text"></article>
</td>
</tr>
</template>
</table>
</div>
<div class="contract" id="standardBuyContract" x-show="toggleBuyStandard">
<table class="my-2 contract" id="contract0">
<tr >
<td class="center"><h2 style="text-align:center">電梯買賣合約書</h2></td>
</tr>
<tr >
<td colspan="1">
合約書編號:<article x-html="data.partyAcontractno.plaintext"></article>
</td>
</tr>
<tr>
<td><div style="margin-left: 100px"><p x-html="data.partyA.plaintext"> </p></div><div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div></td>
</tr>
<tr>
<td >立合約書人</td>
</tr>
<tr>
<td ><div style="margin-left: 100px"><p>永佳捷科技股份有限公司 </p></div><div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div></td>
</tr>
<tr :class="buystandardData.illustrate.editshow ? 'mouseover' : '' ">
</template>
</table>
</div>
<div class="contract" id="standardBuyContract" x-show="toggleBuyStandard">
<table class="my-2 contract" id="contract0">
<tr>
<td class="center">
<h2 style="text-align:center">電梯買賣合約書</h2>
</td>
</tr>
<tr>
<td colspan="1">
合約書編號:<article x-html="data.partyAcontractno.plaintext"></article>
</td>
</tr>
<tr>
<td>
<span x-html='buystandardData.illustrate.plaintext'></span>
<div style="margin-left: 100px">
<p x-html="data.partyA.plaintext"> </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div>
</td>
</tr>
<template x-for="(item, idx) in buystandardData.list.plaintext" :key="item.id">
<tr :class="buystandardData.list.plaintext[idx].editshow ? 'mouseover' : '' " >
<td class="list">
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span>
<article x-html="buystandardData.list.plaintext[idx].text"></article>
<tr>
<td>立合約書人</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p>永佳捷科技股份有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div>
</td>
</tr>
</template>
</table>
<tr :class="buystandardData.illustrate.editshow ? 'mouseover' : '' ">
<td>
<span x-html='buystandardData.illustrate.plaintext'></span>
</td>
</tr>
<template x-for="(item, idx) in buystandardData.list.plaintext" :key="item.id">
<tr :class="buystandardData.list.plaintext[idx].editshow ? 'mouseover' : '' ">
<td class="list">
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span>
<article x-html="buystandardData.list.plaintext[idx].text"></article>
</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<div class="contract-model" x-show="modelshow" x-cloak>
<div class="contract-model" x-show="modelshow" x-cloak>
<div class="contract-back"></div>
<div class="contract-content">
<div class="model-header"><span x-text='modelText'></span><i @click='modelcloseFn()' class="glyphicon glyphicon-remove"></i></div>
<div class="content">
<textarea name="content" id="editor" x-ref="editor" ></textarea>
<textarea name="content" id="editor" x-ref="editor"></textarea>
<input type="submit" value="update" @click='updateEditor()' />
</div>
</div>
</div>
<div class="inputDiv" x-show="!isbuyShow && isInstallInputIng">
<!-- <label for="">
</div>
<div class="inputDiv" x-show="!isbuyShow && isInstallInputIng">
<!-- <label for="">
<p>安裝試車期限(日)</p>
<input type="number" x-model="installfill1" @keyup="sendInstallInputKeyupFn($event)" />
</label>
@ -243,7 +266,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){
<p>免費保養月數(月)</p>
<input type="number" x-model="installfill2" @keyup="sendInstallInputKeyupFn($event)" />
</label> -->
<!-- <label for="">
<!-- <label for="">
<p>附件數</p>
<select x-model="installAffix" @keyup="sendInstallInputKeyupFn($event)">
<option value="1">1</option>
@ -253,47 +276,59 @@ if(isset($_GET['id']) && $_GET['id']!=""){
<option value="5">5</option>
</select>
</label> -->
<label for="">
<button @click="sendInstallInputFn()">生成安裝合約書</button>
</label>
</div>
<div class="contract-install-component" x-show="!isbuyShow && !isInstallInputIng" x-cloak >
<div class="btn-list">
<label for="standardBtn">
<p>制式合約</p>
<input type="checkbox" class="scorll" x-model="toggleBuyStandard">
<!-- <input type="radio" checked id="standardBtn" name="standardBtn" @change="toggleInstallStandard = true" /> -->
<label for="">
<button @click="sendInstallInputFn()">生成安裝合約書</button>
</label>
<!-- <label for="noStandardBtn">
</div>
<div class="contract-install-component" x-show="!isbuyShow && !isInstallInputIng" x-cloak>
<div class="btn-list">
<label for="standardBtn">
<p>制式合約</p>
<input type="checkbox" class="scorll" x-model="toggleBuyStandard">
<!-- <input type="radio" checked id="standardBtn" name="standardBtn" @change="toggleInstallStandard = true" /> -->
</label>
<!-- <label for="noStandardBtn">
<input type="radio" id="noStandardBtn" name="standardBtn" @change="toggleInstallStandard = false" />
非制式合約
</label> -->
</div>
<button @click="isInstallInputIng = true" class="rebtn">重新輸入</button>
<button @click="exportFn(2)" class="prviewbtn">預覽</button>
<div class="contract" id="noStandardContract" x-show="!toggleInstallStandard">
<table class="my-2 contract" x-ref="contract1" id="contract1">
<tr >
<td class="center"><h2 style="text-align:center">電梯安裝合約書</h2></td>
</tr>
<tr >
<td colspan="1">
合約書編號:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article>
</td>
</tr>
<tr>
<td><div style="margin-left: 100px"><p x-html="onstandardViewData.partyA.plaintext">一二營造有限公司 </p></div><div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div></td>
</tr>
<tr>
<td >立合約書人</td>
</tr>
<tr>
<td ><div style="margin-left: 100px"><p>永佳捷科技股份有限公司 </p></div><div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div></td>
</tr>
<tr :class="onstandardViewData.illustrate.editshow ? 'mouseover' : '' " x-on:mouseover="mouseover('illustrate')" x-on:mouseout="mouseout('illustrate')">
</div>
<button @click="isInstallInputIng = true" class="rebtn">重新輸入</button>
<button @click="exportFn(2)" class="prviewbtn">預覽</button>
<div class="contract" id="noStandardContract" x-show="!toggleInstallStandard">
<table class="my-2 contract" x-ref="contract1" id="contract1">
<tr>
<td class="center">
<h2 style="text-align:center">電梯安裝合約書</h2>
</td>
</tr>
<tr>
<td colspan="1">
合約書編號:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article>
</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p x-html="onstandardViewData.partyA.plaintext">一二營造有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div>
</td>
</tr>
<tr>
<td>立合約書人</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p>永佳捷科技股份有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div>
</td>
</tr>
<tr :class="onstandardViewData.illustrate.editshow ? 'mouseover' : '' " x-on:mouseover="mouseover('illustrate')" x-on:mouseout="mouseout('illustrate')">
<td>
<span x-html='onstandardViewData.illustrate.plaintext'></span>
<div class="buttons" x-show="onstandardViewData.illustrate.editshow" x-cloak>
@ -302,8 +337,8 @@ if(isset($_GET['id']) && $_GET['id']!=""){
</div>
</td>
</tr>
<template x-for="(item, idx) in onstandardViewData.list.plaintext" :key="item.text">
<tr :class="onstandardViewData.list.plaintext[idx].editshow ? 'mouseover' : '' " @mouseover="mouseoverlist(idx)" @mouseout="mouseoutlist(idx)">
<template x-for="(item, idx) in onstandardViewData.list.plaintext" :key="item.text">
<tr :class="onstandardViewData.list.plaintext[idx].editshow ? 'mouseover' : '' " @mouseover="mouseoverlist(idx)" @mouseout="mouseoutlist(idx)">
<td class="list">
<div class="buttons" x-show="onstandardViewData.list.plaintext[idx].editshow" x-cloak>
<button class="edit" @click="modelshowEditFn('update contract list', idx, true, true)"><i class="glyphicon glyphicon-pencil"></i></button>
@ -311,68 +346,81 @@ if(isset($_GET['id']) && $_GET['id']!=""){
<button class="add" @click="modelshowAddDownFn(idx)"><i class="glyphicon glyphicon-arrow-down"></i></button>
<button class="delete" @click="deleteEditor(idx)"><i class="glyphicon glyphicon-trash"></i></button>
</div>
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span><article x-html="onstandardViewData.list.plaintext[idx].text"></article>
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span>
<article x-html="onstandardViewData.list.plaintext[idx].text"></article>
</td>
</tr>
</template>
</table>
</div>
<div class="contract" id="standardContract" x-show="toggleInstallStandard">
<table class="my-2 contract" id="contract0">
<tr >
<td class="center"><h2 style="text-align:center">電梯安裝合約書</h2></td>
</tr>
<tr >
<td colspan="1">
合約書編號:<article x-html="data.partyAcontractno.plaintext"></article>
</td>
</tr>
<tr>
<td><div style="margin-left: 100px"><p x-html="data.partyA.plaintext">一二營造有限公司 </p></div><div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div></td>
</tr>
<tr>
<td >立合約書人</td>
</tr>
<tr>
<td ><div style="margin-left: 100px"><p>永佳捷科技股份有限公司 </p></div><div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div></td>
</tr>
<tr :class="standardData.illustrate.editshow ? 'mouseover' : '' ">
</template>
</table>
</div>
<div class="contract" id="standardContract" x-show="toggleInstallStandard">
<table class="my-2 contract" id="contract0">
<tr>
<td class="center">
<h2 style="text-align:center">電梯安裝合約書</h2>
</td>
</tr>
<tr>
<td colspan="1">
合約書編號:<article x-html="data.partyAcontractno.plaintext"></article>
</td>
</tr>
<tr>
<td>
<span x-html='standardData.illustrate.plaintext'></span>
<div style="margin-left: 100px">
<p x-html="data.partyA.plaintext">一二營造有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div>
</td>
</tr>
<template x-for="(item, idx) in standardData.list.plaintext">
<tr :class="standardData.list.plaintext[idx].editshow ? 'mouseover' : '' " >
<td class="list">
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span>
<article x-html="standardData.list.plaintext[idx].text"></article>
<tr>
<td>立合約書人</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p>永佳捷科技股份有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div>
</td>
</tr>
</template>
</table>
</div>
<tr :class="standardData.illustrate.editshow ? 'mouseover' : '' ">
<td>
<span x-html='standardData.illustrate.plaintext'></span>
</td>
</tr>
<template x-for="(item, idx) in standardData.list.plaintext">
<tr :class="standardData.list.plaintext[idx].editshow ? 'mouseover' : '' ">
<td class="list">
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span>
<article x-html="standardData.list.plaintext[idx].text"></article>
</td>
</tr>
</template>
</table>
</div>
<form action="prviewPdf.php?id=<?php echo $id; ?>&<?php echo $token_link; ?>" id="form" method="post" x-ref="form" style="display:none">
<input type="hidden" name="contract_apply_id" id="contract_apply_id" value="<?php echo $contract_apply_id; ?>" />
<input type="hidden" name="list" id="prview-list" />
<input type="hidden" name="prviewType" id="prview-type" />
<input type="hidden" name="standardList" id="standard-prview-list" />
<input type="hidden" name="illustrate" id="illustrate" />
<input type="hidden" name="standardIllustrate" id="standard-illustrate" />
<input type="hidden" name="partyA" id="partyA" />
<input type="hidden" name="partyAcontractno" id="partyAcontractno" />
<input type="hidden" name="buystandard" x-model="toggleBuyStandard" />
<input type="hidden" name="installstandard" x-model="toggleInstallStandard" />
<input type="hidden" name="total_price" x-model="total_price" id="total_price" />
<input type="hidden" name="person" id="person" value="<?php echo $contract['accountname']; ?>" />
<input type="hidden" name="personid" id="personid" value="<?php echo $contract['accountid']; ?>" />
<input type="hidden" name="delivery_term" id="delivery_term" x-model="buyfill1" />
<input type="hidden" name="install_period" id="install_period" x-model="installfill1" />
<input type="hidden" name="free_maintainance" id="free_maintainance" x-model="installfill2" />
</form>
<form action="prviewPdf.php?id=<?php echo $id; ?>&<?php echo $token_link; ?>" id="form" method="post" x-ref="form" style="display:none">
<input type="hidden" name="contract_apply_id" id="contract_apply_id" value="<?php echo $contract_apply_id; ?>" />
<input type="hidden" name="list" id="prview-list" />
<input type="hidden" name="prviewType" id="prview-type" />
<input type="hidden" name="standardList" id="standard-prview-list" />
<input type="hidden" name="illustrate" id="illustrate" />
<input type="hidden" name="standardIllustrate" id="standard-illustrate" />
<input type="hidden" name="partyA" id="partyA" />
<input type="hidden" name="partyAcontractno" id="partyAcontractno" />
<input type="hidden" name="buystandard" x-model="toggleBuyStandard" />
<input type="hidden" name="installstandard" x-model="toggleInstallStandard" />
<input type="hidden" name="total_price" x-model="total_price" id="total_price" />
<input type="hidden" name="person" id="person" value="<?php echo $contract['accountname']; ?>" />
<input type="hidden" name="personid" id="personid" value="<?php echo $contract['accountid']; ?>" />
<input type="hidden" name="delivery_term" id="delivery_term" x-model="buyfill1" />
<input type="hidden" name="install_period" id="install_period" x-model="installfill1" />
<input type="hidden" name="free_maintainance" id="free_maintainance" x-model="installfill2" />
</form>
</div>
</div>
</main>
<!-- <script src="../ckeditor4/ckeditor.js"></script> -->
<script>
@ -389,43 +437,45 @@ if(isset($_GET['id']) && $_GET['id']!=""){
const buyArr = [...<?php echo json_encode($buyArr); ?>];
const installArr = [...<?php echo json_encode($installArr); ?>];
let install_pay_text = '付款方式:<br> ';
let buy_pay_text = ''
const chineseArr = ['零','一','二','三','四','五','六','七']
const bigChineseArr = ['零','壹','貳','參','肆','伍','陸','柒','捌','玖','拾'];
let buy_pay_text = ''
const chineseArr = ['零', '一', '二', '三', '四', '五', '六', '七']
const bigChineseArr = ['零', '壹', '貳', '參', '肆', '伍', '陸', '柒', '捌', '玖', '拾'];
const num = <?php echo $qty; ?>;
const people = <?php echo $noteArr[1]; ?>;
const floor = <?php echo $noteArr[2]; ?>;
const speed = <?php echo $noteArr[3]; ?>;
const buyAffix =' <?php echo $files_count; ?>';
const buyAffix = ' <?php echo $files_count; ?>';
console.log(buyAffix);
console.log(installArr);
buyArr.forEach((item, idx) => {
if(item.scale > 0){
if(item.installment == 1){
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:合約簽定時,甲方應付合約定金新台幣&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
}else if(item.installment == 2){
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:合約簽訂後&nbsp;____&nbsp;天付第二期款新台幣&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
}else if(item.installment == 3){
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:產品貨到工地時應付新台幣&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(&nbsp;含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
if (item.scale > 0) {
if (item.installment == 1) {
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:合約簽定時,甲方應付合約定金新台幣&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
} else if (item.installment == 2) {
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:合約簽訂後&nbsp;____&nbsp;天付第二期款新台幣&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
} else if (item.installment == 3) {
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:產品貨到工地時應付新台幣&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(&nbsp;含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
}
}
});;
buy_pay_text += '以上期款若以票據支付時,發票人需為本合約甲方,票面金額同於各期應付款項,票期於各期付款日三十日內,票據須屬有效並得兌現。<br>乙方收款帳戶名稱:永佳捷科技股份有限公司;收款銀行:兆豐國際商業銀行(桃興分行);帳戶號碼:207-09-08688-2。'
buy_pay_text = buy_pay_text.replace(/\n/g, "").replace(/\s+/g, '').trim();
installArr.forEach((item,idx)=>{
if(item.scale > 0){
if(item.installment == 5){
installArr.forEach((item, idx) => {
if (item.scale > 0) {
if (item.installment == 5) {
install_pay_text = `${install_pay_text}第${chineseArr[idx+1]}期款:甲方應於安裝及試車完成後給付安裝費用&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
}else if(item.installment == 6){
} else if (item.installment == 6) {
install_pay_text = `${install_pay_text}第二期款:甲方應於交車後給付&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
}
}
})
install_pay_text += '以上期款若以票據支付時,發票人需為本合約甲方,票面金額同於各期應付款項,票期於各期付款日三十日內,票據須屬有效並得兌現。<br> 乙方收款帳戶名稱:永佳捷科技股份有限公司;收款銀行:兆豐國際商業銀行(桃興分行);帳戶號碼:207-09-08688-2。'
install_pay_text = install_pay_text.replace(/\n/g, "").replace(/\s+/g, '').trim();
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function numberToChinese(n) {
if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) return "Invalid number.";
let unit = "仟佰拾億仟佰拾萬仟佰拾元角分";
@ -442,6 +492,7 @@ if(isset($_GET['id']) && $_GET['id']!=""){
str = ('_' + str + '_');
return str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(萬|億|元)/g, "$1").replace(/(億)萬|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "").replace("元", "").replace(/^\s+|\s+$/g, '');
}
function numberToSmallChinese(num) {
const chineseNumbers = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
const chineseUnits = ['', '十', '百', '千'];
@ -455,38 +506,36 @@ if(isset($_GET['id']) && $_GET['id']!=""){
const unitPos = numLength - i - 1;
if (digit !== 0) {
chineseStr += chineseNumbers[digit] + chineseUnits[unitPos];
chineseStr += chineseNumbers[digit] + chineseUnits[unitPos];
} else {
// 处理连续的零,只添加一个零到结果中
if (i < numLength - 1 && parseInt(numStr.charAt(i + 1)) !== 0) {
chineseStr += chineseNumbers[digit];
}
// 处理连续的零,只添加一个零到结果中
if (i < numLength - 1 && parseInt(numStr.charAt(i + 1)) !== 0) {
chineseStr += chineseNumbers[digit];
}
}
}
return chineseStr;
}
</script>
<script src="./js/alpine.js"></script>
<script>
const axiosClient = axios.create({
baseURL : './',
baseURL: './',
});
axiosClient.interceptors.request.use( (config)=> {
config.headers.Authorization = 'Bearer <?php echo $token?>'
axiosClient.interceptors.request.use((config) => {
config.headers.Authorization = 'Bearer <?php echo $token ?>'
return config;
}, (error)=> {
}, (error) => {
return Promise.reject(error);
});
axiosClient.interceptors.response.use( (response)=> {
axiosClient.interceptors.response.use((response) => {
return response;
}, (error)=>{
if(error.response.status === 401){
}, (error) => {
if (error.response.status === 401) {
console.error(error);
}
throw error;

2
wms/crm/crmm02-index.php

@ -169,7 +169,7 @@ if ($data) :
<a href="crmm05-edit.php?function_name=customer&<?= $token_link ?>&vol_no=<?php echo $row['vol_no']; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<?php if ($user_name === $row['salesman']) : ?>
<?php if ($user_name === $row['salesman'] || $user_id = 'M0225') : ?>
<a href="../cont/apply_form.php?<?= $token_link ?>&vol_no=<?php echo $row['vol_no']; ?>" class="btn btn-info btn-sm">
轉價審
</a>

Loading…
Cancel
Save