|
@ -1,6 +1,6 @@ |
|
|
<?php |
|
|
<?php |
|
|
include "../header.php"; |
|
|
include "../header.php"; |
|
|
require_once('./conn.php'); |
|
|
|
|
|
$vol_no = $_REQUEST["vol_no"]; // 從有望客戶過來:卷號 |
|
|
$vol_no = $_REQUEST["vol_no"]; // 從有望客戶過來:卷號 |
|
|
|
|
|
|
|
|
// 營業員只建自己客戶的價審單 |
|
|
// 營業員只建自己客戶的價審單 |
|
@ -144,9 +144,9 @@ while ($row = mysqli_fetch_assoc($res)) { |
|
|
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["unit"] = $row["unit"]; |
|
|
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["unit"] = $row["unit"]; |
|
|
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["price"] = $row["price"]; |
|
|
$opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["price"] = $row["price"]; |
|
|
} |
|
|
} |
|
|
$option_str = $opt_data_arr[$row["kind"]][$row["group_name"]][$row["id"]]["spec"]; |
|
|
|
|
|
mysqli_free_result($res); |
|
|
mysqli_free_result($res); |
|
|
$option_str .= '<table id="table_index2" class="table table-striped table-bordered" style="width:100%">'; |
|
|
$option_str = '<table id="table_index2" class="table table-striped table-bordered" style="width:100%">'; |
|
|
$option_str .= '<thead> |
|
|
$option_str .= '<thead> |
|
|
<tr class="kind-col"> |
|
|
<tr class="kind-col"> |
|
|
<th scope="col" nowrap>名稱</th> |
|
|
<th scope="col" nowrap>名稱</th> |
|
@ -195,6 +195,8 @@ foreach ($opt_data_arr as $k => $v) { |
|
|
*/ |
|
|
*/ |
|
|
} |
|
|
} |
|
|
$option_str .= "</tbody></table>"; |
|
|
$option_str .= "</tbody></table>"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?> |
|
|
?> |
|
|
<style> |
|
|
<style> |
|
|
.c_iframe iframe { |
|
|
.c_iframe iframe { |
|
@ -242,7 +244,7 @@ $option_str .= "</tbody></table>"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.modal-content { |
|
|
.modal-content { |
|
|
height: 660px; |
|
|
height: 760px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#optionModal .modal-body { |
|
|
#optionModal .modal-body { |
|
@ -322,6 +324,7 @@ $option_str .= "</tbody></table>"; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> |
|
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> |
|
|
|
|
|
<script defer src="../contract/js/alpinejs/cdn.min.js"></script> |
|
|
<script> |
|
|
<script> |
|
|
// 加千分位 |
|
|
// 加千分位 |
|
|
function commafy(num) { |
|
|
function commafy(num) { |
|
@ -740,7 +743,8 @@ $option_str .= "</tbody></table>"; |
|
|
$("#optionModal .modal-body td").unbind().click(function() { |
|
|
$("#optionModal .modal-body td").unbind().click(function() { |
|
|
var pobj = $(this).closest('td').parent(); |
|
|
var pobj = $(this).closest('td').parent(); |
|
|
console.log(jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html())); |
|
|
console.log(jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html())); |
|
|
jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html()); |
|
|
console.log(pobj.find('td').eq(0).html()+ pobj.find('td').eq(2).html() + ' ' + pobj.find('td').eq(1).html()); |
|
|
|
|
|
jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html() + '<br />(' + pobj.find('td').eq(2).html() + ')'); |
|
|
jobj.closest('td').parent().find('input[name=option_unit_price]').val(pobj.find('td').eq(5).html()); |
|
|
jobj.closest('td').parent().find('input[name=option_unit_price]').val(pobj.find('td').eq(5).html()); |
|
|
jobj.closest('td').parent().find('input[name=option_price_bp]').val(commafy(pobj.find('td').eq(5).html().replace(/[,]+/g, "") * jobj.closest('td').parent().find('input[name=option_qty]').val().replace(/[,]+/g, ""))); |
|
|
jobj.closest('td').parent().find('input[name=option_price_bp]').val(commafy(pobj.find('td').eq(5).html().replace(/[,]+/g, "") * jobj.closest('td').parent().find('input[name=option_qty]').val().replace(/[,]+/g, ""))); |
|
|
jobj.closest('td').parent().find('input[name=op_id]').val(pobj.find('input[name=option_id]').val()); |
|
|
jobj.closest('td').parent().find('input[name=op_id]').val(pobj.find('input[name=option_id]').val()); |
|
@ -792,6 +796,37 @@ $option_str .= "</tbody></table>"; |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
$('#tb3').on('click', 'a[name=btnfaci]', function() { |
|
|
|
|
|
var jobj = $(this); // 父視窗 |
|
|
|
|
|
if (jobj.closest('td').parent().find('a[name=option_href]').html() != '點選') { |
|
|
|
|
|
var k = 1; |
|
|
|
|
|
$("input[name=item_spec]").each(function() { |
|
|
|
|
|
if ($(this).val() == '') return; |
|
|
|
|
|
var objInput = document.createElement("input"); |
|
|
|
|
|
objInput.setAttribute("type", "checkbox"); |
|
|
|
|
|
objInput.setAttribute("name", "sub_faci"); |
|
|
|
|
|
objInput.setAttribute("value", k + '.' + $(this).val()); |
|
|
|
|
|
$("#optionFaciModal .modal-body").append(objInput); |
|
|
|
|
|
$("#optionFaciModal .modal-body").append(k + '.' + $(this).val()); |
|
|
|
|
|
$("#optionFaciModal .modal-body").append("<br>"); |
|
|
|
|
|
k++; |
|
|
|
|
|
}); |
|
|
|
|
|
$("#optionFaciModal .modal-body").append("<p><button type='button' name='btnpost' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>確定</span></button></p>"); |
|
|
|
|
|
$("#optionFaciModal").modal('show'); |
|
|
|
|
|
var str = ""; |
|
|
|
|
|
$("button[name=btnpost]").click(function() { |
|
|
|
|
|
$('input[name=sub_faci]').each(function() { |
|
|
|
|
|
if ($(this).prop('checked')) { |
|
|
|
|
|
str += $(this).val() + "<br>"; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
jobj.closest('td').parent().find('td[name=option_relate_facil]').html(str); |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
alert("請先新增OPTION"); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
$('#tb4').on('click', 'a[name=btnfaci]', function() { |
|
|
$('#tb4').on('click', 'a[name=btnfaci]', function() { |
|
|
var jobj = $(this); // 父視窗 |
|
|
var jobj = $(this); // 父視窗 |
|
|
if (jobj.closest('td').parent().find('select[name=mn_kind]').val() != '') { |
|
|
if (jobj.closest('td').parent().find('select[name=mn_kind]').val() != '') { |
|
@ -1139,6 +1174,14 @@ $option_str .= "</tbody></table>"; |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
<?php |
|
|
|
|
|
require_once('./conn.php'); |
|
|
|
|
|
$sql_str = "SELECT * FROM option_price WHERE status='Y' ORDER BY kind ASC"; |
|
|
|
|
|
$stmt = $conn->prepare($sql_str); |
|
|
|
|
|
$stmt->execute(); |
|
|
|
|
|
$options = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|
|
|
|
|
|
|
|
|
|
|
?> |
|
|
<div> |
|
|
<div> |
|
|
<ul class="notice"> |
|
|
<ul class="notice"> |
|
|
<li>「保存」:儲存價審單內容</li> |
|
|
<li>「保存」:儲存價審單內容</li> |
|
@ -1167,13 +1210,7 @@ $option_str .= "</tbody></table>"; |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<!--子窗:option加價--> |
|
|
<!--子窗:option加價--> |
|
|
<?php |
|
|
<div class="modal fade" id="optionModal" tabindex="-1" role="dialog" aria-labelledby="optionModalTitle" aria-hidden="true" x-data=pricereviewOptionSelect()> |
|
|
$sql_str = "SELECT * FROM option_price WHERE status='Y' ORDER BY kind ASC"; |
|
|
|
|
|
$stmt = $conn->prepare($sql_str); |
|
|
|
|
|
$stmt->execute(); |
|
|
|
|
|
$options = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|
|
|
|
|
?> |
|
|
|
|
|
<div class="modal fade" id="optionModal" tabindex="-1" role="dialog" aria-labelledby="optionModalTitle" aria-hidden="true"> |
|
|
|
|
|
<div class="modal-dialog" role="document"> |
|
|
<div class="modal-dialog" role="document"> |
|
|
<div class="modal-content"> |
|
|
<div class="modal-content"> |
|
|
<div class="modal-header"> |
|
|
<div class="modal-header"> |
|
@ -1181,9 +1218,26 @@ $options = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
|
|
<span aria-hidden="true">×</span> |
|
|
<span aria-hidden="true">×</span> |
|
|
</button> |
|
|
</button> |
|
|
|
|
|
<label for="" > |
|
|
|
|
|
<input type="text" class="form-control" style="float:left" placeholder="搜尋..." x-model="searchtext" @keyup="searchOptions($event)" /> |
|
|
|
|
|
</label> |
|
|
|
|
|
<div class="categories"> |
|
|
|
|
|
<button :class="['btn', (kind==0) ? 'btn-primary' : 'btn-secondary text-light']" @click="changeCategory(0)">顯示全部</button> |
|
|
|
|
|
<button :class="['btn', (kind=='A') ? 'btn-primary' : 'btn-secondary text-light']" @click="changeCategory('A')">A-1 車廂意匠</button> |
|
|
|
|
|
<button :class="['btn', (kind=='B') ? 'btn-primary' : 'btn-secondary text-light']" @click="changeCategory('B')">A-2 車廂內裝</button> |
|
|
|
|
|
<button :class="['btn', (kind=='C') ? 'btn-primary' : 'btn-secondary text-light']" @click="changeCategory('C')">A-3 車廂外部</button> |
|
|
|
|
|
<button :class="['btn', (kind=='D') ? 'btn-primary' : 'btn-secondary text-light']" @click="changeCategory('D')">A-4 控制與其他</button> |
|
|
|
|
|
<button :class="['btn', (kind=='E') ? 'btn-primary' : 'btn-secondary text-light']" @click="changeCategory('E')">B-1 平台梯</button> |
|
|
|
|
|
<button :class="['btn', (kind=='F') ? 'btn-primary' : 'btn-secondary text-light']" @click="changeCategory('F')">C-1 汰改</button> |
|
|
|
|
|
<br /><br /> |
|
|
|
|
|
<template x-for="button in buttons" > |
|
|
|
|
|
<button style="margin-right:3px" :class="['btn', (button.type == subkind) ? 'btn-primary' : 'btn-secondary text-light']" @click="changeCategory('sub', button.type)" x-text="button.name"></button> |
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="modal-body"> |
|
|
</div> |
|
|
<table id="table_index2" class="table table-striped table-bordered" style="width:100%"> |
|
|
<div class="modal-body" > |
|
|
|
|
|
<table id="" class="table table-striped table-bordered" style="width:100%"> |
|
|
<thead> |
|
|
<thead> |
|
|
<tr class="kind-col"> |
|
|
<tr class="kind-col"> |
|
|
<th scope="col" nowrap>名稱</th> |
|
|
<th scope="col" nowrap>名稱</th> |
|
@ -1195,16 +1249,16 @@ $options = $stmt->fetchAll(PDO::FETCH_ASSOC); |
|
|
</tr> |
|
|
</tr> |
|
|
</thead> |
|
|
</thead> |
|
|
<tbody> |
|
|
<tbody> |
|
|
<?php foreach($options as $option): ?> |
|
|
<template x-for="option in options" > |
|
|
<tr> |
|
|
<tr style="cursor:pointer"> |
|
|
<td>1</td> |
|
|
<td x-text="option.group_name"> </td> |
|
|
<td>2</td> |
|
|
<td x-text="option.spec"></td> |
|
|
<td>3</td> |
|
|
<td x-text="option.memo"></td> |
|
|
<td>4</td> |
|
|
<td x-text="optionalArr[option.optional]"></td> |
|
|
<td>5</td> |
|
|
<td x-text="option.unit"></td> |
|
|
<td>6</td> |
|
|
<td x-text="option.price"></td> |
|
|
</tr> |
|
|
</tr> |
|
|
<?php endforeach; ?> |
|
|
</template> |
|
|
</tbody> |
|
|
</tbody> |
|
|
</table> |
|
|
</table> |
|
|
</div> |
|
|
</div> |
|
@ -1850,7 +1904,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ |
|
|
?> |
|
|
?> |
|
|
<tr name="option_templ"> |
|
|
<tr name="option_templ"> |
|
|
<td name="option_seat"> |
|
|
<td name="option_seat"> |
|
|
<a href="" name="option_href" data-toggle="modal"><?php echo $v["item_spec"] . '-(' . $v['item-memo'] . ')'; ?></a> |
|
|
<a href="" name="option_href" data-toggle="modal"><?php echo $v["item_spec"] . '-(' . $v['item_memo'] . ')'; ?></a> |
|
|
</td> |
|
|
</td> |
|
|
<td><input type="text" name="option_unit_price" class="form-control dollar-right" size="8" value="<?php echo number_format($v["item_unit_price"]); ?>" readonly></td> |
|
|
<td><input type="text" name="option_unit_price" class="form-control dollar-right" size="8" value="<?php echo number_format($v["item_unit_price"]); ?>" readonly></td> |
|
|
<td><input type="text" name="option_qty" class="form-control" size="2" maxlength="2" value="<?php echo $v["item_qty"]; ?>"></td> |
|
|
<td><input type="text" name="option_qty" class="form-control" size="2" maxlength="2" value="<?php echo $v["item_qty"]; ?>"></td> |
|
@ -1890,7 +1944,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ |
|
|
?> |
|
|
?> |
|
|
<tr name="option_templ"> |
|
|
<tr name="option_templ"> |
|
|
<td name="option_seat"> |
|
|
<td name="option_seat"> |
|
|
<a href="" name="option_href" data-toggle="modal">點選</a> |
|
|
<a href="" name="option_href" data-toggle="modal" @click="searchtext = ''">點選</a> |
|
|
</td> |
|
|
</td> |
|
|
<td><input type="text" name="option_unit_price" class="form-control dollar-right" size="8" value="<?php echo (isset($v["option_price"])) ? number_format($v["option_price"]) : 0; ?>" readonly></td> |
|
|
<td><input type="text" name="option_unit_price" class="form-control dollar-right" size="8" value="<?php echo (isset($v["option_price"])) ? number_format($v["option_price"]) : 0; ?>" readonly></td> |
|
|
<td><input type="text" name="option_qty" class="form-control" size="2" maxlength="2" value="<?php echo (isset($v["option_num"])) ? $v["option_num"] : 0; ?>"></td> |
|
|
<td><input type="text" name="option_qty" class="form-control" size="2" maxlength="2" value="<?php echo (isset($v["option_num"])) ? $v["option_num"] : 0; ?>"></td> |
|
@ -1938,8 +1992,10 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ |
|
|
<td><input type="text" name="except_qty" class="form-control" size="4" maxlength="4" value="<?php echo $v["item_qty"]; ?>"><input type="hidden" name="except_qty_ori" value="<?php echo $v["item_qty"]; ?>"></td> |
|
|
<td><input type="text" name="except_qty" class="form-control" size="4" maxlength="4" value="<?php echo $v["item_qty"]; ?>"><input type="hidden" name="except_qty_ori" value="<?php echo $v["item_qty"]; ?>"></td> |
|
|
<td><input type="text" name="except_price_bp" class="form-control dollar-right" size="8" value="<?php echo number_format($v["item_price_bp"]); ?>" readonly> |
|
|
<td><input type="text" name="except_price_bp" class="form-control dollar-right" size="8" value="<?php echo number_format($v["item_price_bp"]); ?>" readonly> |
|
|
<input type="hidden" name="item_group" value="E"> |
|
|
<input type="hidden" name="item_group" value="E"> |
|
|
|
|
|
<a href="javascript:void(0);" name="btnfaci" class="btn btn-danger btn-sm">電梯</a> |
|
|
<a href="javascript:void(0);" name="btndel3" class="btn btn-danger btn-sm">X</a> |
|
|
<a href="javascript:void(0);" name="btndel3" class="btn btn-danger btn-sm">X</a> |
|
|
</td> |
|
|
</td> |
|
|
|
|
|
<td name="mn_relate_facil" nowrap></td> |
|
|
</tr> |
|
|
</tr> |
|
|
<?php |
|
|
<?php |
|
|
} |
|
|
} |
|
@ -1951,8 +2007,10 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ |
|
|
<td><input type="text" name="except_unit_price" class="form-control dollar-right" size="8"></td> |
|
|
<td><input type="text" name="except_unit_price" class="form-control dollar-right" size="8"></td> |
|
|
<td><input type="text" name="except_qty" class="form-control" size="4" maxlength="4"></td> |
|
|
<td><input type="text" name="except_qty" class="form-control" size="4" maxlength="4"></td> |
|
|
<td><input type="text" name="except_price_bp" class="form-control dollar-right" size="8" readonly> |
|
|
<td><input type="text" name="except_price_bp" class="form-control dollar-right" size="8" readonly> |
|
|
|
|
|
<a href="javascript:void(0);" name="btnfaci" class="btn btn-danger btn-sm">電梯</a> |
|
|
<a href="javascript:void(0);" name="btndel3" class="btn btn-danger btn-sm">X</a> |
|
|
<a href="javascript:void(0);" name="btndel3" class="btn btn-danger btn-sm">X</a> |
|
|
</td> |
|
|
</td> |
|
|
|
|
|
<td name="mn_relate_facil" nowrap></td> |
|
|
</tr> |
|
|
</tr> |
|
|
<?php |
|
|
<?php |
|
|
} |
|
|
} |
|
@ -2342,22 +2400,21 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ |
|
|
</tr> |
|
|
</tr> |
|
|
</tbody> |
|
|
</tbody> |
|
|
</table> |
|
|
</table> |
|
|
|
|
|
<ul> |
|
|
|
|
|
<li>營業權限85%以上;85-80%呈至區處長審核;80%以下呈至總經理審核。</li> |
|
|
|
|
|
</ul> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="nextline"></div> |
|
|
<div class="nextline"></div> |
|
|
<ul> |
|
|
<label for="attatch1">報價單</label> |
|
|
<li>營業權限85%以上;85-80%呈至區處長審核;80%以下呈至總經理審核。</li> |
|
|
<input type="file" name="attatch1" id="attatch1"><a href="javascript:void(0);" name="filedel" class="btn btn-danger btn-sm">X</a> |
|
|
</ul> |
|
|
<div class="nextline"></div> |
|
|
<div class="nextline"></div> |
|
|
<label for="attatch2">附表一</label> |
|
|
<label for="attatch1">報價單</label> |
|
|
<input type="file" name="attatch2" id="attatch2"><a href="javascript:void(0);" name="filedel2" class="btn btn-danger btn-sm">X</a> |
|
|
<input type="file" name="attatch1" id="attatch1"><a href="javascript:void(0);" name="filedel" class="btn btn-danger btn-sm">X</a> |
|
|
<div class="nextline"></div><br> |
|
|
<div class="nextline"></div> |
|
|
<button type="submit" name="save" id="save" value="save">保存</button> |
|
|
<label for="attatch2">附表一</label> |
|
|
<button type="submit" name="submit" id="submit" value="tosign">提交</button> |
|
|
<input type="file" name="attatch2" id="attatch2"><a href="javascript:void(0);" name="filedel2" class="btn btn-danger btn-sm">X</a> |
|
|
|
|
|
<div class="nextline"></div><br> |
|
|
|
|
|
<button type="submit" name="save" id="save" value="save">保存</button> |
|
|
|
|
|
<button type="submit" name="submit" id="submit" value="tosign">提交</button> |
|
|
|
|
|
|
|
|
|
|
|
<input type="hidden" name="fp_id_all" id="fp_id_all"> |
|
|
<input type="hidden" name="fp_id_all" id="fp_id_all"> |
|
|
<input type="hidden" name="fp_kind_all" id="fp_kind_all"> |
|
|
<input type="hidden" name="fp_kind_all" id="fp_kind_all"> |
|
@ -2413,3 +2470,9 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ |
|
|
<?php |
|
|
<?php |
|
|
include "../footer.php"; |
|
|
include "../footer.php"; |
|
|
?> |
|
|
?> |
|
|
|
|
|
|
|
|
|
|
|
<script src="./assets/js/alpine.js"></script> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
const options = [...<?php echo json_encode($options); ?>]; |
|
|
|
|
|
</script> |