Browse Source

保養契約價格審核

main
Cheng 1 year ago
parent
commit
1074ee6896
  1. 2
      wms/cont/MICalculator.php
  2. 36
      wms/cont/apply_form.php
  3. 169
      wms/cont/sign_list.php
  4. 16
      wms/cont/t.php

2
wms/cont/MICalculator.php

@ -284,7 +284,7 @@ class MICalculator
and maintain_kind='" . $item['maintain_kind'] . "' and maintain_kind='" . $item['maintain_kind'] . "'
and is_m1_bundle='" . $item['is_m1_bundle'] . "' and is_m1_bundle='" . $item['is_m1_bundle'] . "'
"; ";
echo $sql_get_price; // echo $sql_get_price;
list($row) = DB::result($sql_get_price); list($row) = DB::result($sql_get_price);
if (empty($row)) return self::error(); if (empty($row)) return self::error();

36
wms/cont/apply_form.php

@ -260,6 +260,12 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
} }
?> ?>
<style>
button.disabled {
cursor: not-allowed;
background: #555;
}
</style>
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/jquery.cleditor.css'); ?>" /> <link rel="stylesheet" type="text/css" href="<?php echo base_url('css/jquery.cleditor.css'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url('bootstrap4/css/bootstrap.min.css'); ?>" /> <link rel="stylesheet" type="text/css" href="<?php echo base_url('bootstrap4/css/bootstrap.min.css'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/layui.css'); ?>" /> <link rel="stylesheet" type="text/css" href="<?php echo base_url('css/layui.css'); ?>" />
@ -431,7 +437,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
is_m1_bundle is_m1_bundle
} }
setStandPrice(param1, element); setStandPrice(param1, element);
//console.info(param1); // console.log(param1);
}); });
@ -494,16 +500,33 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
dataType: 'json', dataType: 'json',
//success: function(data) {}, //success: function(data) {},
success: function(data) { success: function(data) {
// console.info(data); console.log(data.price);
if (data.status == 'ok') { if (data.status == 'ok') {
$(obj).val(data.price); $(obj).val(data.price);
} else { } else {
$(obj).val(data.message); $(obj).val(data.message);
}
if (data.message == '無此項目,請聯係業務部創建標準成本') {
console.log('1');
// $("button[name^=btn_save]").attr('disabled', true);
// $("button[name^=btn_save]").css('cursor', 'not-allowed')
$("#submit").css('background-color', '#666')
document.querySelector('#submit').classList.add('disabled')
document.querySelector('#submit').disabled = true
}
if (data.price) {
document.querySelector('#submit').classList.remove('disabled')
document.querySelector('#submit').disabled = false
$("#submit").css('background-color', '#007bff')
// $("button[name^=btn_save]").attr('disabled', false);
// $("button[name^=btn_save]").css('cursor', 'default')
// $("button[name^=btn_save]").css('background-color', '#666')
} }
} }
}); });
} }
addNewBrand = function() { addNewBrand = function() {
var new_brand = $("#new_brand").val(); var new_brand = $("#new_brand").val();
@ -529,6 +552,13 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
} }
} }
$("input[name^='stand_price']").bind('input propertychang', function() {
if ($("input[name^='stand_price']").val() == '') {
console.log('無值');
$("button[name^=btn_save]").attr('disabled', true);
}
});
</script> </script>
@ -711,7 +741,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
</div> </div>
<div class="col-3 form_field_title "> <div class="col-3 form_field_title ">
<button type="submit" name="btn_save" class="btn btn-warning btn-sm" value="save" style='float:left;margin-right:4px;'>保存</button>&nbsp; <button type="submit" name="btn_save" class="btn btn-warning btn-sm" value="save" style='float:left;margin-right:4px;'>保存</button>&nbsp;
<button type="submit" name="btn_save" class="btn btn-primary btn-sm" value="tosign" style='float:left'>提交</button> <button type="submit" name="btn_save" class="btn btn-primary btn-sm" value="tosign" style='float:left' id="submit">提交</button>
</div> </div>
</div> </div>

169
wms/cont/sign_list.php

@ -72,10 +72,7 @@ f_return_content('payment_kind',payment_kind ) payment_kind FROM $table
where 1=1 $where ORDER BY vol_no"; where 1=1 $where ORDER BY vol_no";
// echo $sql; // echo $sql;
$data = mysqli_query($link, $sql); $data = mysqli_query($link, $sql);
// echo '<pre>';
// print_r($data);
// echo '</pre>';
// echo '1';
?> ?>
@ -92,11 +89,97 @@ if ($data) :
} }
?> ?>
<link rel="stylesheet" href="common.css"> <!-- <link rel="stylesheet" href="common.css"> -->
<style>
#table_index2 {
table-layout: fixed;
width: 100%;
}
#table_index2_filter {
float: right;
}
#table_index2_paginate {
float: right;
}
div.dataTables_scrollHead table.dataTable {
margin-bottom: 0 !important;
border-bottom-width: 0;
}
div.dataTables_scrollBody table.dataTable {
border-top-width: 0;
}
/*
.col-sm-12 {
width: auto;
}
*/
img {
width: 125px;
}
.width_style_1 {
width: 125px;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
div a:hover {
text-decoration: none;
}
.btn-sm {
font-size: 14px;
margin: 2px 0;
line-height: 90%;
}
.glyphicon-ok,
.glyphicon-ban-circle {
font-size: 130%;
}
.btn-secondary {
color: #fff;
background-color: #6c757d;
border-color: #6c757d;
}
.btn-secondary:hover {
color: #fff;
background-color: #5a6268;
border-color: #545b62;
}
</style>
<script>
$(function() {
$('#table_index2').DataTable({
"scrollX": true,
"pageLength": 50
});
/*
var api = $('#table_index').dataTable().api();
//var order = api.order();
//console.log(order);
api
.order([0, "desc"])
.draw();
*/
});
</script>
<link rel="stylesheet" href="common.css">
<div style="overflow-x:auto;"> <div style="overflow-x:auto;">
<form method='get' action='#'> <!-- <form method='get' action='#'> -->
<table class='table query-table table-striped table-bordered display compact' style='width:98%;text-align:center;margin:0 auto'> <!-- <table class='table query-table table-striped table-bordered display compact' style='width:98%;text-align:center;margin:0 auto'>
<thead> <thead>
<tr> <tr>
<td colspan="8"> <td colspan="8">
@ -106,47 +189,57 @@ if ($data) :
</thead> </thead>
</table> </table> -->
<table id="table_index" class="table table-striped table-bordered" style="width:98%"> <div style=" white-space:nowrap;">
<table id="table_index2" class="table table-striped table-bordered" style="width:100%">
<thead> <thead>
<?php <tr>
echo "<tr>"; <th>評審單號</th>
foreach ($editableColumn as $key => $val) { <th>卷號</th>
<th>現場地址</th>
echo "<th>" . $val['label'] . "</th>"; <th>現場名稱</th>
} <th>電梯品牌</th>
echo "<th>是否結案</th>"; <th>電梯台數</th>
// echo "<th>刪除</th>"; <th>營業員</th>
echo "</tr>"; <th>保養方式</th>
?> <th>契約期限開始</th>
<th>契約期限結束</th>
<th>契約性質</th>
<th>加盟公司名稱</th>
<th>加盟公司電話</th>
<!-- <th>加盟公司電話</th> -->
<th>是否結案</th>
<th>合約下載</th>
</tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($data as $row) : ?> <?php foreach ($data as $row) : ?>
<tr> <tr>
<?php <td><?php echo $row['apply_key'] ?></td>
foreach ($editableColumn as $key => $val) { <td><?php echo $row['vol_no'] ?></td>
if ($key == 'apply_key') { <td><?php echo $row['address'] ?></td>
echo "<td> <a href='query_form.php?apply_key=$row[$key]&token=" . $_GET['token'] . "'>" . $row[$key] . "</td>"; <td><?php echo $row['case_name'] ?></td>
} elseif ($key == 'brand') { <td><?php echo $row['brand'] ?></td>
echo "<td>" . (!empty($row[$key]) ? $elevator_brand_arr[$row[$key]] : "") . "</td>"; <td><?php echo $row['num'] ?></td>
} else { <td><?php echo $row['salesman'] ?></td>
echo "<td>" . $row[$key] . "</td>"; <td><?php echo $row['maintain_kindd'] ?></td>
} <td><?php echo $row['contract_begin_date'] ?></td>
} <td><?php echo $row['contract_end_date'] ?></td>
//list($signer)=DB::fields("); <td><?php echo $row['contract_kind'] ?></td>
//echo " select f_return_name(current_assigner) signer from subflow where form_key='". $row['form_key'] ."'"; ". (is_array($row['form_key'])?'': $row['form_key']) ." <td><?php echo $row['platform_company'] ?></td>
list($signer) = mysqli_fetch_array(mysqli_query($link, "select max(f_return_name(current_assigner) ) signer from subflow where form_key='" . $row['form_key'] . "'")); <td><?php echo $row['platforom_company_tel'] ?></td>
echo "<td>" . (empty($signer) ? "結案" : "N") . "</td>"; <?php list($signer) = mysqli_fetch_array(mysqli_query($link, "select max(f_return_name(current_assigner) ) signer from subflow where form_key='" . $row['form_key'] . "'")); ?>
<td><?php echo empty($signer) ? '結案' : 'N' ?></td>
?> <td>
<button>下載</button>
</td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
<?php <?php
else : else :

16
wms/cont/t.php

@ -4,7 +4,7 @@ ini_set('dispaly_errors', "On");
require_once './MSCalculator.php'; require_once './MSCalculator.php';
/* //客梯 //客梯
$param = [ $param = [
'elevator_type' => 'A', 'elevator_type' => 'A',
@ -18,8 +18,8 @@ $param = [
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 'maintain_period' => 1, //默认为1月1次, 2是为2月一次
'is_m1_bundle' => 'N', 'is_m1_bundle' => 'N',
]; ];
*/
/* //货梯 //货梯
$param = [ $param = [
'elevator_type' => 'B', 'elevator_type' => 'B',
@ -33,9 +33,9 @@ $param = [
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 'maintain_period' => 1, //默认为1月1次, 2是为2月一次
'is_m1_bundle' => 'N', 'is_m1_bundle' => 'N',
]; ];
*/
/*//病床梯
//病床梯
$param = [ $param = [
'elevator_type' => 'C', 'elevator_type' => 'C',
@ -48,9 +48,9 @@ $param = [
'maintain_kind' => 2, 'maintain_kind' => 2,
'maintain_period' => 1, //默认为1月1次, 2是为2月一次 'maintain_period' => 1, //默认为1月1次, 2是为2月一次
'is_m1_bundle' => 'N', 'is_m1_bundle' => 'N',
];*/ ];
/*//无机房 //无机房
$param = [ $param = [
'elevator_type' => 'D', 'elevator_type' => 'D',
'floors' => 3, 'floors' => 3,
@ -64,7 +64,7 @@ $param = [
'is_m1_bundle' => 'N', 'is_m1_bundle' => 'N',
]; ];
*/
//家用梯 //家用梯
$param = [ $param = [
'elevator_type' => 'E', 'elevator_type' => 'E',

Loading…
Cancel
Save