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.
224 lines
11 KiB
224 lines
11 KiB
<?php
|
|
error_reporting(E_ALL);
|
|
ini_set("display_errors", "On");
|
|
|
|
require_once './FormHelper.php';
|
|
require_once './wf_common.php';
|
|
|
|
|
|
//錶單數據
|
|
#客戶錶
|
|
#1.電梯品牌選項
|
|
$sql = "select code_name value ,content label from code where field_name='elevator_brand' order by convert(content using gbk) asc ";
|
|
$elevator_brand_opt = DB::result($sql);
|
|
#2.客戶來源
|
|
$sql = "select code_name value ,content label from code where field_name='customer_source'";
|
|
$customer_source_opt = DB::result($sql);
|
|
#3.電梯類型
|
|
$sql = "select code_name value ,content label from code where field_name='elevator_kind'";
|
|
$elevator_kind_opt = DB::result($sql);
|
|
#4.營業員
|
|
$sql = "select employee_no value ,name label from employee where depart_no in ('511','512','513','514')";
|
|
$salesman_opt = DB::result($sql);
|
|
#5.有望客戶狀態
|
|
$sql = "select code_name value ,content label from code where field_name='hope_customer_status'";
|
|
$hope_customer_status_opt = DB::result($sql);
|
|
#6.是否改造
|
|
$is_renovation_opt = [
|
|
['label' => '是', 'value' => 'Y'],
|
|
['label' => '否', 'value' => 'N'],
|
|
|
|
];
|
|
#7.开门方式
|
|
$sql = "select code_name value ,content label from code where field_name='open_kind'";
|
|
$open_kind_opt = DB::result($sql);
|
|
#生成新梯卷号
|
|
$vol_no = get_sequnece_no('qy_vol_no', date('ym'));
|
|
|
|
#抓取有望客戶資料
|
|
$table_hope_contract_customer = 'hope_contract_customer';
|
|
|
|
$hope_contract_customer_column = [
|
|
'vol_no' => ['label' => "卷號(B)", "tag" => 'text', 'attr' => ['required','readonly', "value" => "$vol_no", 'class' => 'form-control form-control-sm']],
|
|
//'form_key' => ['label' => "錶單號","tag" => 'text', 'attr'=>['class' => 'form-control form-control-sm' ]],
|
|
'customer' => ['label' => "客戶名稱", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
|
|
'manager' => ['label' => "負責人", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
|
|
'source' => ['label' => "客戶來源", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $customer_source_opt],
|
|
//'linkman' => ['label' => "聯係人", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
|
|
'lm_tel' => ['label' => "手機", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
|
|
'salesman' => ['label' => "營業員", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $salesman_opt],
|
|
'num' => ['label' => "数量", "tag" => 'number', 'attr' => ['min=1','class' => 'form-control form-control-sm']],
|
|
'address' => ['label' => "地址", "tag" => 'text', 'attr' => ['required', 'class' => ' form-control form-control-sm']],
|
|
// 'case_name' => ['label' => "现场名称", "tag" => 'text', 'attr' => ['required', 'class' => ' form-control form-control-sm']],
|
|
'floors' => ['label' => '樓層', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
|
|
'persons' => ['label' => '人乘', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
|
|
'speed' => ['label' => '速度', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
|
|
'completed_date' => ['label' => '竣工(民國年)', 'tag' => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
|
|
'pre_order_date' => ['label' => "預定成交日", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']],
|
|
'status' => ['label' => "有望客戶狀態", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $hope_customer_status_opt],
|
|
'next_visit_date' => ['label' => "下次拜訪時間", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']],
|
|
// 'brand' => ['label' => "廠牌", "tag" => 'select', 'attr' => ['required', 'class' => ' form-control form-control-sm '], 'options' => $elevator_brand_opt],
|
|
'quote_date' => ['label' => "報價日期", "tag" => 'date', 'attr' => ['class' => 'date form-control form-control-sm']],
|
|
// 'is_renovation' => ['label' => "是否汰改", "tag" => 'select', 'attr' => ['required','class' => ' form-control form-control-sm'], 'options' => $is_renovation_opt],
|
|
|
|
];
|
|
|
|
|
|
$where = " and vol_no='$vol_no'";
|
|
|
|
$sql = " SELECT vol_no,customer,manager,source,
|
|
linkman,lm_tel,salesman,num,address,floors,persons,speed,completed_date,
|
|
date_format(pre_order_date,'%Y-%m-%d') pre_order_date,
|
|
status, date_format(next_visit_date,'%Y-%m-%d') next_visit_date ,brand ,
|
|
date_format(quote_date,'%Y-%m-%d') quote_date ,is_renovation FROM $table_hope_contract_customer where 1=1 $where ";
|
|
$hope_contract_customer = DB::result($sql);
|
|
|
|
|
|
|
|
function base_url($url)
|
|
{
|
|
return "https://www.masada.com.tw/static/" . $url;
|
|
}
|
|
|
|
#生成卷号
|
|
function get_sequnece_no($seq_name = '', $p_yyyymm = '')
|
|
{
|
|
|
|
if (empty($p_yyyymm) || empty($seq_name)) return null;
|
|
#當前年月
|
|
|
|
//echo "select yyyymm from sequence where seq_name='$seq_name' ";
|
|
list($yyyymm, $prefix) = DB::fields("select yyyymm ,prefix from sequence where seq_name='$seq_name' ");
|
|
if ($p_yyyymm != $yyyymm) {
|
|
DB::query("update sequence set yyyymm='$p_yyyymm' , current_val='10000' where seq_name='$seq_name' ");
|
|
}
|
|
// echo "SELECT concat( $prefix,,substring(nextval('$seq_name'),2)) seq_no ";
|
|
list($seq_no) = DB::fields("SELECT concat( '$prefix','$p_yyyymm',substring( appwms.nextval('$seq_name'),2)) seq_no ");
|
|
// echo "SELECT concat( '$prefix','$p_yyyymm',substring( appwms.nextval('$seq_name'),2)) seq_no ";
|
|
|
|
return $seq_no;
|
|
}
|
|
?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<title>有望客戶新增</title>
|
|
<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('css/layui.css'); ?>" />
|
|
<script type="text/javascript" src="<?php echo base_url('js/jquery3.7.js'); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('js/selectpage.min.js'); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('js/jquery.cleditor.min.js'); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('bootstrap4/js/bootstrap.min.js'); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('js/layui.js?' . rand(10, 100)); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('js/wf_property.js?') . rand(10, 100); ?>"></script>
|
|
<script type="text/javascript" src="<?php echo base_url('js/flow_chart.js?' . rand(10, 100)); ?>"></script>
|
|
<script src="<?php echo base_url('js/validate/jquery.validate.min.js?' . rand(10, 100)); ?>"></script>
|
|
<script src="<?php echo base_url('js/validate/messages_zh_TW.js?' . rand(10, 100)); ?>"></script>
|
|
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/form.css?') . rand(10, 100);; ?>" />
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
|
|
|
|
// $('#cmecTbody').append(cmecRow);
|
|
$('.sp_element_box').attr("disabled", true);
|
|
$("#assign_opinion").cleditor({
|
|
height: 100, // height not including margins, borders or padding
|
|
controls: // controls to add to the toolbar
|
|
"bold italic underline strikethrough subscript superscript | font size " +
|
|
"style | color highlight removeformat | bullets numbering | outdent " +
|
|
"indent | alignleft center alignright justify | undo redo | "
|
|
});
|
|
|
|
$("#form").validate();
|
|
|
|
});
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<div id="toolbarmenu">
|
|
<ul class="nav nav-tabs" role="tablist" id="tablist">
|
|
<li class=" nav-item ">
|
|
<a href="#tabassign" aria-controls="tabassign" role="tab" class=" active nav-link" data-toggle="tab">申请單</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="tab-content ">
|
|
<div class="tab-pane active assign_content " id="tabassign">
|
|
<form action="crmm06_submit.php" id='form' method="post" style='width:98%;margin:0 auto'>
|
|
<!-- hidden域 -->
|
|
<input type='hidden' name='vol_no' value='<?= $vol_no ?>'>
|
|
<input type='hidden' name='token' value='<?= $_GET['token'] ?>' />
|
|
|
|
<!--錶單start-->
|
|
<div class=" form container-fluid pt-5">
|
|
<div class="row form_head ">
|
|
<div class=" col-12 form_head_title ">
|
|
<h4> 有望客戶(契约)</h4>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row " style='padding-top:30px;'>
|
|
<div class=" col-lg-12 form_row_header ">
|
|
<b>有望客戶資料</b>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
//一行顯示三列
|
|
$i = 0;
|
|
echo " <div class='row '>";
|
|
foreach ($hope_contract_customer_column as $key => $val) {
|
|
$j = (($i++) % 4);
|
|
$fieldVal = empty($hope_contract_customer) ? "" : $hope_contract_customer[0][$key];
|
|
|
|
$_input = $val['tag'] == 'select' ?
|
|
FormHelper::select("$key", $val['options'], $fieldVal, $val['attr'])
|
|
: FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']);
|
|
if ($i != 1 && $j == 0) {
|
|
echo "
|
|
</div>
|
|
<div class='row'>
|
|
";
|
|
}
|
|
echo " <div class='col-1 form_field_title'>
|
|
" . $val['label'] . "
|
|
</div>
|
|
<div class=' col-2 form_field_content ' >
|
|
$_input
|
|
</div>
|
|
";
|
|
}
|
|
echo "</div>";
|
|
|
|
?>
|
|
|
|
<div id="assign_area " class="row ">
|
|
<div class="col-12 form_row_header ">
|
|
<b>洽商進度</b>
|
|
</div>
|
|
<div class="col-12 " style="padding:0">
|
|
|
|
<textarea class='form-control textarea' id="progress_status" name="progress_status" value='' rows='6'></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<button style='margin:20px auto;width:50px' type="submit" class="btn btn-primary btn-sm">保存</button>
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</body>
|