Browse Source

契約管理

main
Cheng 1 year ago
parent
commit
105e458133
  1. 14
      wms/cont/apply_form.php
  2. 10
      wms/cont/apply_form1.php
  3. 42
      wms/cont/conn.php
  4. 28
      wms/crm/crmm02-index.php
  5. 450
      wms/crm/crmm06-edit.php
  6. 20
      wms/mkt/pricereview_repair-create.php

14
wms/cont/apply_form.php

@ -2,6 +2,8 @@
require_once '../header_nomenu.php'; require_once '../header_nomenu.php';
require_once './FormHelper.php'; require_once './FormHelper.php';
require_once './wf_common.php'; require_once './wf_common.php';
// require_once('./conn.php');
$vol_no = empty($_GET['vol_no']) ? "" : $_GET['vol_no']; $vol_no = empty($_GET['vol_no']) ? "" : $_GET['vol_no'];
@ -25,11 +27,19 @@ $flow_id = 'con01';
$form_id = ""; $form_id = "";
#價審單狀態 #價審單狀態
$apply_st = ""; $apply_st = "";
list($apply_key, $form_key) = DB::fields("SELECT apply_key, form_key from con_maintance_examine_apply where vol_no='$vol_no' order by apply_key desc limit 0, 1"); list($apply_key, $form_key, $salesman) = DB::fields("SELECT apply_key, form_key,salesman FROM con_maintance_examine_apply WHERE vol_no='$vol_no' ORDER BY apply_key desc limit 0, 1");
// echo '<pre>';
// print_r($apply_key);
// echo '</pre>';
// exit;
// if ($salesman != $user_id) {
// echo '<script>alert("您並不是該單營業員,無法訪問。");history.go(-1);</script>';
// exit;
// }
if (empty($apply_key)) $apply_st = 1; // 準備新增 if (empty($apply_key)) $apply_st = 1; // 準備新增
else { else {
//list($flow_code)=DB::fields("select flow_code from flow where form_key = '$form_key' and system_id = '$system_id' and flow_id = '$flow_id'"); //list($flow_code)=DB::fields("select flow_code from flow where form_key = '$form_key' and system_id = '$system_id' and flow_id = '$flow_id'");
list($current_assigner) = DB::fields("select current_assigner from subflow where form_key = '$form_key' order by seq desc limit 0, 1"); list($current_assigner) = DB::fields("SELECT current_assigner FROM subflow WHERE form_key = '$form_key' ORDER BY seq desc limit 0, 1");
if ($current_assigner == $user_id) $apply_st = 2; // 修改中,還未提交 if ($current_assigner == $user_id) $apply_st = 2; // 修改中,還未提交
else $apply_st = 9; // 已到下一關,無法䖺改 else $apply_st = 9; // 已到下一關,無法䖺改
} }

10
wms/cont/apply_form1.php

@ -27,13 +27,13 @@ $form_id = "";
$apply_st = ""; $apply_st = "";
list($apply_key, $form_key, $salesman) = DB::fields("SELECT apply_key, form_key,salesman FROM con_maintance_examine_apply WHERE vol_no='$vol_no' ORDER BY apply_key desc limit 0, 1"); list($apply_key, $form_key, $salesman) = DB::fields("SELECT apply_key, form_key,salesman FROM con_maintance_examine_apply WHERE vol_no='$vol_no' ORDER BY apply_key desc limit 0, 1");
// echo '<pre>'; // echo '<pre>';
// print_r($apply_key); // print_r($salesman);
// echo '</pre>'; // echo '</pre>';
// exit; // exit;
// if ($salesman != $user_id) { if ($salesman != $user_id) {
// echo '<script>alert("您並不是該單營業員,無法訪問。");history.go(-1);</script>'; echo '<script>alert("您並不是該單營業員,無法訪問。");history.go(-1);</script>';
// exit; exit;
// } }
if (empty($apply_key)) $apply_st = 1; // 準備新增 if (empty($apply_key)) $apply_st = 1; // 準備新增
else { else {
//list($flow_code)=DB::fields("select flow_code from flow where form_key = '$form_key' and system_id = '$system_id' and flow_id = '$flow_id'"); //list($flow_code)=DB::fields("select flow_code from flow where form_key = '$form_key' and system_id = '$system_id' and flow_id = '$flow_id'");

42
wms/cont/conn.php

@ -0,0 +1,42 @@
<?php
$envFile = __DIR__ . '/.env'; // .env 文件的路径
if (file_exists($envFile)) {
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if ($lines !== false) {
foreach ($lines as $line) {
list($key, $value) = explode('=', $line, 2);
$key = trim($key);
$value = trim($value);
// 设置环境变量
putenv("$key=$value");
}
}
}
$db_hostname = getenv('DB_HOST'); //資料庫主機名稱
$db_username = getenv('DB_USERNAME'); //登入資料庫的管理者的帳號
$db_password = getenv('DB_PASSWORD'); //登入密碼
$db_name = getenv('DB_DATABASE'); //使用的資料庫
$db_charset = 'utf8'; //設定字元編碼
//建立PDO的指定工作
$dsn = "mysql:host=$db_hostname;dbname=$db_name;charset=$db_charset";
try {
//使用PDO連接到MySQL資料庫,建立PDO物件
$conn = new PDO($dsn, $db_username, $db_password);
//當錯誤發生時會將錯誤資訊放到一個類物件裡(PDOException)
//PDO異常處理,PDO::ATTR_ERRMODE,有以下三種值的設定
//PDO::ERRMODE_SILENT: 預設模式,不主動報錯,需要以$conn->errorInfo()的形式獲取錯誤資訊
//PDO::ERRMODE_WARNING: 引發 E_WARNING 錯誤,主動報錯
//PDO::ERRMODE_EXCEPTION: 主動抛出 exceptions 異常,需要以try{}cath(){}輸出錯誤資訊。
//設定主動以警告的形式報錯
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//如果連接錯誤,將抛出一個PDOException異常對象
} catch (PDOException $e) {
//如果連結資料庫失敗則顯示錯誤訊並停止本頁的工作
die("ERROR!!!: " . $e->getMessage());
}
//$conn = null; //關閉資料庫的連線

28
wms/crm/crmm02-index.php

@ -45,7 +45,7 @@ $sql_cmd = sql_myself($user_id, "salesman");
if (in_array($user_department_id, $depart_arr) || $user_id == "M0060" || $user_id == "M0149") $sql_cmd = ""; // M0060:Max,鄭伊岑 if (in_array($user_department_id, $depart_arr) || $user_id == "M0060" || $user_id == "M0149") $sql_cmd = ""; // M0060:Max,鄭伊岑
if (!empty($sql_cmd)) $where .= " and " . str_replace("where", "", $sql_cmd); if (!empty($sql_cmd)) $where .= " and " . str_replace("where", "", $sql_cmd);
$sql = "SELECT vol_no,customer,manager,f_return_content('customer_source',source ) source, $sql = "SELECT vol_no,customer,manager,salesman,f_return_content('customer_source',source ) source,
linkman,lm_tel,f_return_name(salesman) salesman,num ,date_format(pre_order_date,'%Y/%m/%d') pre_order_date, linkman,lm_tel,f_return_name(salesman) salesman,num ,date_format(pre_order_date,'%Y/%m/%d') pre_order_date,
f_return_content('hope_customer_status',status ) status, date_format(next_visit_date,'%Y/%m/%d') next_visit_date ,brand , f_return_content('hope_customer_status',status ) status, date_format(next_visit_date,'%Y/%m/%d') next_visit_date ,brand ,
date_format(quote_date,'%Y/%m/%d') quote_date, created_at FROM $table where 1=1 $where ORDER BY vol_no"; date_format(quote_date,'%Y/%m/%d') quote_date, created_at FROM $table where 1=1 $where ORDER BY vol_no";
@ -55,6 +55,17 @@ $data = mysqli_query($link, $sql);
// echo '<pre>'; // echo '<pre>';
// print_r($sql); // print_r($sql);
// echo '</pre>'; // echo '</pre>';
// echo '<pre>';
// print_r($data);
// echo '</pre>';
// $sql = "SELECT * FROM hope_contract_customer WHERE 1=1 $where";
// $result = mysqli_query($link, $sql);
// echo '<pre>';
// print_r($result);
// echo '</pre>';
// echo $data['salesman'];
?> ?>
<style> <style>
#table_index2 { #table_index2 {
@ -142,10 +153,14 @@ if ($data) :
?> ?>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($data as $row) : ?> <?php foreach ($data as $row) : ?>
<tr> <tr>
<?php <?php
foreach ($editableColumn as $key => $val) { foreach ($editableColumn as $key => $val) {
// echo '<pre>';
// print_r($row['salesman']);
// echo '</pre>';
echo "<td>" . (!empty($row[$key]) ? $row[$key] : '') . "</td>"; echo "<td>" . (!empty($row[$key]) ? $row[$key] : '') . "</td>";
} }
?> ?>
@ -154,10 +169,11 @@ 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"> <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> <span class="glyphicon glyphicon-pencil"></span>
</a> </a>
<?php if ($user_name === $row['salesman']) : ?>
<a href="../cont/apply_form.php?<?= $token_link ?>&vol_no=<?php echo $row['vol_no']; ?>" class="btn btn-info btn-sm"> <a href="../cont/apply_form.php?<?= $token_link ?>&vol_no=<?php echo $row['vol_no']; ?>" class="btn btn-info btn-sm">
轉價審 轉價審
</a> </a>
<?php endif ?>
</p> </p>
</td> </td>
</tr> </tr>

450
wms/crm/crmm06-edit.php

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

20
wms/mkt/pricereview_repair-create.php

@ -271,13 +271,13 @@ $assign_status = '<option value="FH">指派</option>'
$('#tb1 tr:last').prev().prev().prev().find('td a[name=item_href]').html('點選'); $('#tb1 tr:last').prev().prev().prev().find('td a[name=item_href]').html('點選');
}); });
// 點擊服務費會出現 or 消失 input 框 // 點擊服務費會出現 or 消失 input 框
$('#btnadd-sc').click(function() { // $('#btnadd-sc').click(function() {
$('#service_charge_tr').toggle(); // $('#service_charge_tr').toggle();
// 若消失清空 input 的值 // // 若消失清空 input 的值
$('#service_charge').val(''); // $('#service_charge').val('');
// 並且重新計算總價(total) // // 並且重新計算總價(total)
dataFormat(); // dataFormat();
}); // });
$('#tb1').on('click', 'a[name=btndel]', function() { $('#tb1').on('click', 'a[name=btndel]', function() {
if ($('tr[name=main_templ]').length > 1) { if ($('tr[name=main_templ]').length > 1) {
$(this).closest('tr').remove(); $(this).closest('tr').remove();
@ -471,7 +471,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
<thead> <thead>
<tr> <tr>
<th colspan="5"><a href="javascript:void(0);" id="btnadd" class="btn btn-primary btn-sm">新增備品</a> <span class="star">*</span></th> <th colspan="5"><a href="javascript:void(0);" id="btnadd" class="btn btn-primary btn-sm">新增備品</a> <span class="star">*</span></th>
<th colspan="5"><a href="javascript:void(0);" id="btnadd-sc" class="btn btn-primary btn-sm">服務費</a></th> <!-- <th colspan="5"><a href="javascript:void(0);" id="btnadd-sc" class="btn btn-primary btn-sm">服務費</a></th> -->
</tr> </tr>
<tr> <tr>
<th nowrap>名稱</th> <th nowrap>名稱</th>
@ -505,12 +505,12 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
<a href="javascript:void(0);" name="btndel" class="btn btn-danger btn-sm">X</a> <a href="javascript:void(0);" name="btndel" class="btn btn-danger btn-sm">X</a>
</td> </td>
</tr> </tr>
<tr id='service_charge_tr' style="display: none;"> <tr id='service_charge_tr'>
<td colspan="3"> <td colspan="3">
<h5>服務費</h5> <h5>服務費</h5>
</td> </td>
<td> <td>
<input type="text" name="service_charge" id="service_charge" class="dollar-right" size="8" "> <input type="text" name="service_charge" id="service_charge" value="0" class="dollar-right" size="8" ">
</td> </td>
<td colspan=" 2"> <td colspan=" 2">
</td> </td>

Loading…
Cancel
Save