You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

726 lines
35 KiB

<?php
include_once('../header.php');
require_once('./conn.php');
$id = $_GET['id'];
$sql_str = "SELECT pricereview_main.*, account.name as person_name FROM pricereview_main LEFT JOIN account ON pricereview_main.person = account.accountid WHERE pricereview_main.id = :id";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':id', $id);
$stmt->execute();
$contract = $stmt->fetch(PDO::FETCH_ASSOC);
// print_r($contract);
$sql_str = "SELECT * FROM pricereview_pay WHERE mid = :mid ORDER BY pay_kind ASC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $id);
$stmt->execute();
$pays = $stmt->fetchAll(PDO::FETCH_ASSOC);
$sql_str = "SELECT pricereview_item.*, option_mi.price AS option_mi FROM pricereview_item LEFT JOIN option_mi ON option_mi.option_price_id = pricereview_item.price_id WHERE pricereview_item.mid = :mid AND option_mi.open_kind = 'CO' ORDER BY pricereview_item.item_group, pricereview_item.item_no ASC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $id);
$stmt->execute();
$options = $stmt->fetchAll(PDO::FETCH_ASSOC);
$sql_str = "SELECT * FROM pricereview_item WHERE mid = :mid ORDER BY item_group, item_no ASC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $id);
$stmt->execute();
$items = $stmt->fetchAll(PDO::FETCH_ASSOC);
$sql_str = "SELECT * FROM pricereview_sign WHERE mid = :mid";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $id);
$stmt->execute();
$sign = $stmt->fetch(PDO::FETCH_ASSOC);
$currentSigner = '';
$currentSign = 0;
// Y:已同意 N:不同意 W:待簽
// sign1 => 處長, sign2 => 業務承辦人, sign3 => 協理, sign4 => 總經理
if($sign['sign1'] == NULL || $sign['sign1'] ==''){
$sign1 = NULL;
}else{
if( explode(",", $sign['sign1'])[1] != ''){
$sign1 = explode(",", $sign['sign1'])[1] == 'Y' ? 'Y' : 'N';
}else{
$sign1 = 'W';
}
}
if($sign['sign2'] == NULL || $sign['sign2'] ==''){
$sign2 = NULL;
}else{
if( explode(",", $sign['sign2'])[1] != ''){
$sign2 = explode(",", $sign['sign2'])[1] == 'Y' ? 'Y' : 'N';
}else{
$sign2 = 'W';
}
}
if($sign['sign3'] == NULL || $sign['sign3'] ==''){
$sign3 = NULL;
}else{
if( explode(",", $sign['sign3'])[1] != ''){
// $sign3 = explode(",", $sign['sign3'])[1] == 'Y' ? 'Y' : 'N';
if(explode(",", $sign['sign3'])[1] == 'YY') $sign3 = 'YY';
if(explode(",", $sign['sign3'])[1] == 'Y') $sign3 = 'Y';
}else{
$sign3 = 'W';
}
}
if($sign['sign4'] == NULL || $sign['sign4'] ==''){
$sign4 = NULL;
}else{
if( explode(",", $sign['sign4'])[1] != ''){
// $sign4 = explode(",", $sign['sign4'])[1] == 'Y' ? 'Y' : 'N';
if(explode(",", $sign['sign4'])[1] == 'YY') $sign4 = 'YY';
if(explode(",", $sign['sign4'])[1] == 'Y') $sign4 = 'Y';
}else{
$sign4 = 'W';
}
}
if($sign1 == 'W'){
$currentSigner = explode(",", $sign['sign1'])[0];
$currentSign = 1;
}elseif($sign2 == 'W'){
$currentSigner = explode(",", $sign['sign2'])[0];
$currentSign = 2;
}elseif($sign3 == 'W'){
$currentSigner = explode(",", $sign['sign3'])[0];
$currentSign = 3;
}elseif($sign4 == 'W'){
$currentSigner = explode(",", $sign['sign4'])[0];
$currentSign = 4;
}
// $sql_str = "SELECT * FROM account WHERE accountid = :accountid";
// $stmt = $conn->prepare($sql_str);
// $stmt->bindParam(':accountid', $sign['sign']);
// $stmt->execute();
// $account = $stmt->fetch(PDO::FETCH_ASSOC);
// $sql_str = "SELECT * FROM account WHERE accountid = :accountid";
// $stmt = $conn->prepare($sql_str);
// $stmt->bindParam(':accountid', $account['manager']);
// $stmt->execute();
// $manager = $stmt->fetch(PDO::FETCH_ASSOC);
$permissions = false;
//開啟業務部權限
if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
$permissions = true;
}
?>
<link rel="stylesheet" href="./css/pricereview.css">
<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 defer src="./assets/js/alpinejs/cdn.min.js"></script>
<script src="./assets/js/pricereviewAlpine.js"></script>
<div id="pricereviewCheck" x-data=pricereviewCheck()>
<div class="container">
<table class="table customerinfo-table" >
<tbody>
<tr>
<th>卷號</th>
<th>營業員</th>
<th>客戶名稱</th>
<th>牌價總額(A)</th>
<th>售價總額(B)</th>
<th >破價總額(B-A)</th>
</tr>
<tr>
<td><input type="text" class="form-control" x-model="contractno" disabled /></td>
<td><input type="text" class="form-control" x-model="person_name" disabled /></td>
<td><input type="text" class="form-control" x-model="company" disabled /></td>
<td><input type="text" class="form-control" x-model="Number(price_lowest).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="Number(price_total).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="(price_total - price_lowest).toLocaleString()" disabled /></td>
</tr>
</tbody>
</table>
<table class="table mi-table" border=1>
<thead>
<tr>
<th colspan=5>整機單價</th>
<?php if($permissions): ?>
<th colspan=4>業務部作業區</th>
<?php endif; ?>
</tr>
<tr>
<th>項次</th>
<th>規格</th>
<th>單價</th>
<th>數量</th>
<th>複價</th>
<?php if($permissions): ?>
<th>業務部MI</th>
<th>售價</th>
<th>利潤</th>
<th>利潤率(%)</th>
<?php endif; ?>
</tr>
</thead>
<template x-for="elevator in elevators">
<tbody>
<tr>
<td x-html="'<b>' + elevator.item_no + '</b>'"></td>
<td > <a href="javascript:;" x-text="elevator.item_spec"></a></td>
<td><input type="text" class="form-control" x-model="Number(elevator.item_unit_price).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="elevator.item_qty" disabled /></td>
<td><input type="text" class="form-control" x-model="Number(elevator.item_unit_price * elevator.item_qty).toLocaleString()" disabled /></td>
<?php if($permissions): ?>
<td>
<input x-show="isNotfoundMi" type="text" class="form-control" value="公司無此規格">
<input x-show="!isNotfoundMi" type="text" class="form-control" x-model="Math.round(Number(elevator.optionsTotalPrice) + Number(elevator.otherOptionsTotalPrice) + Number(elevator.maintainOptionsTotalPrice) + Number(elevator.totalMi * elevator.item_qty)).toLocaleString() " disabled />
</td>
<td><input type="text" class="form-control" x-model="Number(elevator.item_price_ct).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="(elevator.item_price_ct - Math.round(Number(elevator.optionsTotalPrice) + Number(elevator.otherOptionsTotalPrice) + Number(elevator.maintainOptionsTotalPrice) + Number(elevator.totalMi * elevator.item_qty))).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="Math.round((elevator.item_price_ct - Math.round(Number(elevator.optionsTotalPrice) + Number(elevator.otherOptionsTotalPrice) + Number(elevator.maintainOptionsTotalPrice) + Number(elevator.totalMi * elevator.item_qty))) / elevator.item_price_ct *1000) /10 + '%'" disabled /></td>
<?php endif; ?>
</tr>
<?php if($permissions): ?>
<tr>
<td colspan=5></td>
<td colspan=4>
<div class="mi-info">
<span>電梯設備</span>
<ul>
<li x-html="'設備1.0:<b>' + (elevator.mi.equipment_fee * elevator.item_qty).toLocaleString() + '</b>'"></li>
<li x-html="'報關+運輸費:<b>' + (elevator.mi.customs_shipping_fee * elevator.item_qty).toLocaleString() + '</b>'"></li>
<li x-html="'工廠卸貨:<b>' + (elevator.mi.unloading_fee * elevator.item_qty).toLocaleString() + '</b>'"></li>
<li x-html="'運輸至工地:<b>' + (elevator.mi.transport_site_fee * elevator.item_qty).toLocaleString() + '</b>'"></li>
<li x-html="'安裝成本:<b>' + (elevator.mi.install_fee * elevator.item_qty).toLocaleString() + '</b>'"></li>
<li x-html="'一年免保:<b>' + (elevator.mi.free1y_fee * elevator.item_qty).toLocaleString() + '</b>'"></li>
<li x-html="'起吊+木箱+耗材:<b>' + (elevator.mi.other_fee * elevator.item_qty).toLocaleString() + '</b>'"></li>
</ul>
<p x-html="'以上合計:<b>' + (elevator.totalMi * elevator.item_qty).toLocaleString() + '</b>'"></p>
<div class="line"></div>
<span>OPTION</span>
<ul>
<template x-for="option in elevator.options">
<li x-html="option.item_spec + '*' + option.item_qty + ':<b>' + (option.mi * option.item_qty).toLocaleString() + '</b>'"></li>
</template>
<template x-for="option in elevator.otherOptions">
<li x-html="option.item_spec + '*' + option.item_qty + ':<b>' + (option.mi * option.item_qty).toLocaleString() + '</b>'"></li>
</template>
<template x-for="option in elevator.maintainOptions">
<li x-html="option.item_spec + '(' + option.item_qty + '月):<b>' + (option.mi * option.item_qty).toLocaleString() + '</b>'"></li>
</template>
</ul>
<p x-html="'以上合計:<b>' + (Math.round(Number(elevator.optionsTotalPrice) + Number(elevator.otherOptionsTotalPrice) + Number(elevator.maintainOptionsTotalPrice))).toLocaleString() + '</b>'"></p>
</div>
</td>
</tr>
<?php endif ;?>
</tbody>
</template>
<tr>
<td colspan=4>小計</td>
<td><input type="text" class="form-control" x-model="elevators_total_price.toLocaleString()" disabled></td>
</tr>
</table>
<table class="table mi-table" border=1>
<thead>
<tr>
<th colspan=8>OPTION 加價</th>
</tr>
<tr>
<th>項次</th>
<th>OPTION ID</th>
<th>名稱</th>
<th>單價</th>
<th>數量</th>
<th>複價</th>
<th>備註</th>
<th>所屬電梯項次</th>
</tr>
</thead>
<tbody>
<template x-for="option in options">
<tr>
<td x-html="'<b>' + option.item_no + '</b>'"></td>
<td x-text="option.price_id"></td>
<td><input type="text" class="form-control" x-model="option.item_spec" disabled /></td>
<td><input type="text" class="form-control" x-model="option.item_unit_price.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="option.item_qty" disabled /></td>
<td><input type="text" class="form-control" x-model="(option.item_unit_price * option.item_qty).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="option.memo" disabled /></td>
<td x-text="option.option_relate_spec"></td>
</tr>
</template>
<tr>
<td colspan=5>小計</td>
<td >
<input type="text" x-model="optionsTotalPrice().toLocaleString()" disabled class="form-control">
</td>
<td colspan=3></td>
</tr>
</tbody>
</table>
<table class="table mi-table" border=1>
<thead>
<tr>
<th colspan=8>除外項目</th>
</tr>
<tr>
<th>項次</th>
<th>詢價單號</th>
<th>名稱</th>
<th>單價</th>
<th>數量</th>
<th>複價</th>
<th>所屬電梯項次</th>
</tr>
</thead>
<tbody>
<template x-for="option in otherOptions">
<tr>
<td x-html="'<b>' + option.item_no + '</b>'"></td>
<td x-text="option.price_id"></td>
<td><input type="text" class="form-control" x-model="option.item_spec" disabled /></td>
<td><input type="text" class="form-control" x-model="option.item_unit_price.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="option.item_qty" disabled /></td>
<td><input type="text" class="form-control" x-model="(option.item_unit_price * option.item_qty).toLocaleString()" disabled /></td>
<td x-text="option.option_relate_spec"></td>
</tr>
</template>
<tr>
<td colspan=5>小計</td>
<td >
<input type="text" x-model="otherOptionsTotalPrice().toLocaleString()" disabled class="form-control">
</td>
<td colspan=3></td>
</tr>
</tbody>
</table>
<table class="table mi-table" border=1>
<thead>
<tr>
<th colspan=8>保固延長</th>
</tr>
<tr>
<th>項次</th>
<th>規格</th>
<th>單價</th>
<th>數量(月)</th>
<th>複價</th>
<th>備註</th>
<th>所屬電梯項次</th>
</tr>
</thead>
<tbody>
<template x-for="option in maintainOptions">
<tr>
<td x-text="option.item_no"></td>
<td x-text="option.item_spec"></td>
<td x-text="option.item_unit_price.toLocaleString()"></td>
<td x-text="option.item_qty"></td>
<td x-text="(option.item_qty * option.item_unit_price).toLocaleString()"></td>
<td x-text="option.memo"></td>
<td x-text="option.option_relate_spec"></td>
</tr>
</template>
<tr>
<td colspan=4>小計</td>
<td >
<input type="text" x-model="maintainOptionsTotalPrice().toLocaleString()" disabled class="form-control">
</td>
<td colspan=2></td>
</tr>
</tbody>
</table>
<table class="table mi-table" border=1 style="width:800px">
<thead>
<tr>
<th>付款辦法</th>
<th>款別</th>
<th>比例(%)</th>
<th>金額</th>
<th>票期</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="4">材料</td>
<td>1.訂金</td>
<td><input type="text" class="form-control" x-model="pays[0].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[0].pay_amount.toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[0].pay_period">
<option value=""></option>
<option value="7">7天</option>
<option value="30" selected>30天</option>
<option value="60">60</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
</select>
</td>
</tr>
<tr>
<td>2.二次款</td>
<td><input type="text" class="form-control" x-model="pays[1].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[1].pay_amount.toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[1].pay_period">
<option value=""></option>
<option value="7">7天</option>
<option value="30" selected>30天</option>
<option value="60">60天</option>
<option value="90">90天</option>
<option value="120">120天</option>
<option value="150">150天</option>
<option value="180">180天</option>
</select>
</td>
</tr>
<tr>
<td>3.貨到工地款</td>
<td><input type="text" class="form-control" x-model="pays[2].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[2].pay_amount.toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[2].pay_period">
<option value=""></option>
<option value="7">7天</option>
<option value="30" selected>30天</option>
<option value="60">60天</option>
<option value="90">90天</option>
<option value="120">120天</option>
<option value="150">150天</option>
<option value="180">180天</option>
</select>
</td>
</tr>
<tr>
<td>4.其他</td>
<td><input type="text" class="form-control" x-model="pays[3].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[3].pay_amount.toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[3].pay_period">
<option value=""></option>
<option value="7">7天</option>
<option value="30" selected>30天</option>
<option value="60">60天</option>
<option value="90">90天</option>
<option value="120">120天</option>
<option value="150">150天</option>
<option value="180">180天</option>
</select>
</td>
</tr>
<tr>
<td rowspan=3>材料</td>
<td>5.安裝完畢款</td>
<td><input type="text" class="form-control" x-model="pays[4].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[4].pay_amount.toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[4].pay_period">
<option value=""></option>
<option value="7">7天</option>
<option value="30" selected>30天</option>
<option value="60">60天</option>
<option value="90">90天</option>
<option value="120">120天</option>
<option value="150">150天</option>
<option value="180">180天</option>
</select>
</td>
</tr>
<tr>
<td>6.驗收款</td>
<td><input type="text" class="form-control" x-model="pays[5].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[5].pay_amount.toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[5].pay_period">
<option value=""></option>
<option value="7">7天</option>
<option value="30" selected>30天</option>
<option value="60">60天</option>
<option value="90">90天</option>
<option value="120">120天</option>
<option value="150">150天</option>
<option value="180">180天</option>
</select>
</td>
</tr>
<tr>
<td>7.尾款</td>
<td><input type="text" class="form-control" x-model="pays[6].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[6].pay_amount.toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[6].pay_period">
<option value=""></option>
<option value="7">7天</option>
<option value="30" selected>30天</option>
<option value="60">60天</option>
<option value="90">90天</option>
<option value="120">120天</option>
<option value="150">150天</option>
<option value="180">180天</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">合計</td>
<td><input type="text" class="form-control" x-model="totalScale()" disabled /></td>
<td><input type="text" class="form-control" x-model="Number(price_total).toLocaleString()" disabled /></td>
<td></td>
</tr>
<tr>
<td colspan="2">備註</td>
<td colspan="3"><textarea name="" id="" cols="30" rows="5" class="form-control" disabled></textarea></td>
</tr>
</tbody>
</table>
<table class="table customerinfo-table" >
<tbody>
<tr>
<th>卷號</th>
<th>營業員</th>
<th>客戶名稱</th>
<th>案件名稱</th>
<th colspan="2">地址</th>
</tr>
<tr>
<td><input type="text" class="form-control" x-model="contractno" disabled /></td>
<td><input type="text" class="form-control" x-model="person_name" disabled /></td>
<td><input type="text" class="form-control" x-model="company" disabled /></td>
<td><input type="text" class="form-control" x-model="case_name" disabled /></td>
<td colspan="2"><input type="text" class="form-control" x-model="address" disabled /></td>
</tr>
<tr>
<th>牌價總額(A)</th>
<th>售價總額(B)</th>
<th>破價總額(B-A)</th>
<th>總台數</th>
<th>服務費(介紹費)</th>
<th>價率%(B/A)</th>
</tr>
<tr>
<td><input type="text" class="form-control" x-model="Number(price_lowest).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="Number(price_total).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="(price_total - price_lowest).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="qty" disabled /></td>
<td><input type="text" class="form-control" x-model="special_fee.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="Math.round(price_total/price_lowest * 1000)/10" disabled /></td>
</tr>
<tr>
<th>預定成交日</th>
<th>預訂出貨日</th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<td><input type="date" disabled class="form-control" x-model="predeal_date" /></td>
<td><input type="date" disabled class="form-control" x-model="facilitok_date" /></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<th>罰則</th>
<th>訂金保證金(函)%</th>
<th>履約保證金(函)%</th>
<th>保固保證金(函)%</th>
<th></th>
<th></th>
</tr>
<tr>
<td><input type="text" disabled class="form-control" x-model="penalty"></td>
<td><input type="text" disabled class="form-control" x-model="deposit_rate"></td>
<td><input type="text" disabled class="form-control" x-model="keep_rate"></td>
<td><input type="text" disabled class="form-control" x-model="warranty_rate"></td>
<td></td>
<td></td>
</tr>
<tr>
<th colspan="6">特記事項</th>
</tr>
<tr>
<td colspan="6">
<textarea name="" id="" cols="30" rows="5" class="form-control" x-model="memo" disabled></textarea>
</td>
</tr>
</tbody>
</table>
<li>營業權限85%以上;85-80%呈至區處長審核;80%以下呈至總經理審核。</li>
<table class="table" style="width:700px">
<thead>
<tr>
<th>審核</th>
<th>審核人</th>
<th>結果</th>
<th>意見</th>
<th>時間</th>
</tr>
</thead>
<tbody>
<tr>
<td>區經理</td>
<td><?php echo explode(',', $sign['sign1'])[0] ?></td>
<td>
<?php
if($sign1 == 'Y'){
echo "同意";
}elseif($sign1 == 'N'){
echo "不同意";
}elseif($sign1 == 'W'){
echo "待簽核";
}else{
echo "---";
}
?>
</td>
<td><?php echo $sign['sign1_note'] ?></td>
<td><?php echo explode(',', $sign['sign1'])[2] ?></td>
</tr>
<tr>
<td>業務承辦人</td>
<td><?php echo $sign['sign2']!=NULL ? explode(',', $sign['sign2'])[0] : '---' ?></td>
<td>
<?php
if($sign2 == 'Y'){
echo "同意";
}elseif($sign2 == 'N'){
echo "不同意";
}elseif($sign2 == 'W'){
echo "待簽核";
}else{
echo "---";
}
?>
</td>
<td><?php echo $sign['sign2']!=NULL ? $sign['sign2_note'] : '---'?></td>
<td><?php echo $sign['sign2']!=NULL ? explode(',', $sign['sign2'])[2] : '---' ?></td>
</tr>
<tr>
<td>業務部協理</td>
<td><?php echo $sign['sign3']!=NULL ? explode(',', $sign['sign3'])[0] : '---' ?></td>
<td>
<?php
if($sign3 == 'Y'){
echo "同意";
}elseif($sign3 == 'YY'){
echo "結案同意";
}elseif($sign3 == 'N'){
echo "不同意";
}elseif($sign3 == 'W'){
echo "待簽核";
}else{
echo "---";
}
?>
</td>
<td><?php echo $sign['sign3']!=NULL ? $sign['sign3_note'] : '---'?></td>
<td><?php echo $sign['sign3']!=NULL ? explode(',', $sign['sign3'])[2] : '---' ?></td>
</tr>
<tr>
<td>總經理</td>
<td><?php echo $sign['sign4']!=NULL ? explode(',', $sign['sign4'])[0] : '---' ?></td>
<td>
<?php
if($contract['status'] == 'YY'){
if($sign3 == 'YY'){
echo "---";
}elseif($sign3 == 'Y' && $sign4 == 'YY'){
echo "結案同意";
}
}else{
if($sign4 == 'Y'){
echo "同意";
}elseif($sign4 == 'N'){
echo "不同意";
}elseif($sign4 == 'W'){
echo "待簽核";
}else{
echo "---";
}
}
?>
</td>
<td><?php echo $sign['sign4']!=NULL ? $sign['sign4_note'] : '---'?></td>
<td><?php echo $sign['sign4']!=NULL ? explode(',', $sign['sign4'])[2] : '---' ?></td>
</tr>
</tbody>
</table>
<table class="table" style="width:700px">
<thead>
<tr>
<th>審核意見</th>
<th>批示售價</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<textarea name="" class="form-control" id="" cols="40" rows="5"></textarea>
</td>
<td>
<input type="text" class="form-control" disabled />
</td>
</tr>
</tbody>
</table>
<div>
<button class="btn btn-primary" @click="window.history.go(-1)">回上頁</button>
<?php if($contract['status'] == "YS"){ ?>
<?php if($currentSigner == $user_id): ?>
<button class="btn btn-primary" @click="check(<?php echo $currentSign; ?>, 'YN')">不同意(退回)</button>
<?php if($sign4 =='W' && $sign3 == 'W'): ?>
<button class="btn btn-primary" @click="check(<?php echo $currentSign; ?>, 'YS')">同意(上呈)</button>
<?php endif ; ?>
<button class="btn btn-primary" @click="check(<?php echo $currentSign; ?>, 'YY')">同意(結案)</button>
<?php endif; ?>
<?php } ?>
<button class="btn btn-primary">下載報價單</button>
<button class="btn btn-primary">下載附表一</button>
</div>
</div>
</div>
<script>
const mid = <?php echo $contract['id']; ?>;
const contractno = '<?php echo $contract['contractno']; ?>';
const person_name = '<?php echo $contract['person_name']; ?>';
const company = '<?php echo $contract['company']; ?>';
const case_name = '<?php echo $contract['case_name']; ?>';
const address = '<?php echo $contract['address']; ?>';
const price_lowest = '<?php echo $contract['price_lowest']; ?>';
const price_total = '<?php echo $contract['price_total']; ?>';
const special_fee = '<?php echo $contract['special_fee']; ?>';
const predeal_date = '<?php echo $contract['predeal_date']; ?>';
const facilitok_date = '<?php echo $contract['facilitok_date']; ?>';
const penalty = '<?php echo $contract['penalty']; ?>';
const deposit_rate = '<?php echo $contract['deposit_rate']; ?>';
const keep_rate = '<?php echo $contract['keep_rate']; ?>';
const warranty_rate = '<?php echo $contract['warranty_rate']; ?>';
const memo = '<?php echo $contract['memo']; ?>';
const pays = [...<?php echo json_encode($pays); ?>];
const items = [...<?php echo json_encode($items); ?>];
const options = [...<?php echo json_encode($options); ?>];
const is_renovate = '<?php echo $contract['ekind']; ?>';
const user_id = '<?php echo $user_id; ?>';
</script>