From db3108d7d878a0c577174e2012c9df044b8b7e3d Mon Sep 17 00:00:00 2001 From: Cheng Date: Mon, 29 Jan 2024 18:17:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E9=A4=8A=E5=83=B9=E5=AF=A9=E7=8D=8E?= =?UTF-8?q?=E9=87=91=E8=A8=88=E7=AE=97\?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintainance_contract_payment_status.php | 399 -------- wms/{bons => bonus}/api/get.php | 39 +- wms/bonus/api/getAccount.php | 11 + wms/bonus/api/insertBonus.php | 27 + wms/bonus/api/postCalBouns.php | 53 + .../bons_index.php => bonus/bonus_index1.php} | 86 +- .../elevator_new_deal_bonus_v1_0.php | 0 ...evator_new_deal_bonus_v1_0_examination.php | 0 .../elevator_new_deal_bonus_v2_0.php | 0 ...evator_new_deal_bonus_v2_0_examination.php | 0 .../maintenance_contract_bonus_v2_0.php | 0 ...enance_contract_bonus_v2_0_examination.php | 0 wms/class/Cmail.php | 62 -- wms/class/Cnotice.php | 109 --- wms/cont/FormHelper.php | 509 ---------- wms/cont/MICalculator.php | 324 ------- wms/cont/MSCalculator.php | 322 ------- wms/cont/apply.php | 22 - wms/cont/apply_form.php | 859 ----------------- wms/cont/apply_form1.php | 912 ------------------ wms/cont/async_req.php | 20 - wms/cont/con_maintance_examine_clear.php | 14 - wms/cont/conn.php | 42 - wms/cont/crmm06_submit.php | 21 - wms/cont/list.php | 168 ---- .../model/ConMaintanceExamineApplyModel.php | 29 - .../model/ConMaintanceExamineClearModel.php | 33 - wms/cont/model/Model.php | 53 - wms/cont/query_form.php | 511 ---------- wms/cont/review_apply_form.php | 507 ---------- wms/cont/sign_form.php | 577 ----------- wms/cont/sign_list.php | 225 ----- wms/cont/submit.php | 79 -- wms/cont/success.php | 1 - wms/cont/t.php | 84 -- wms/cont/test.php | 174 ---- wms/cont/wf_common.php | 20 - wms/contract-repair/js/alpine.js | 84 +- wms/contract/option/option2.xlsx | Bin 10978 -> 10999 bytes wms/frame/api_getdata.php | 1 - wms/fun_global.php | 59 +- wms/mkt/pricereview-edit.php | 12 +- 42 files changed, 291 insertions(+), 6157 deletions(-) delete mode 100644 wms/bons/maintainance_contract_payment_status.php rename wms/{bons => bonus}/api/get.php (64%) create mode 100644 wms/bonus/api/getAccount.php create mode 100644 wms/bonus/api/insertBonus.php create mode 100644 wms/bonus/api/postCalBouns.php rename wms/{bons/bons_index.php => bonus/bonus_index1.php} (63%) rename wms/{bons => bonus}/elevator_new/elevator_new_deal_bonus_v1_0.php (100%) rename wms/{bons => bonus}/elevator_new/elevator_new_deal_bonus_v1_0_examination.php (100%) rename wms/{bons => bonus}/elevator_new/elevator_new_deal_bonus_v2_0.php (100%) rename wms/{bons => bonus}/elevator_new/elevator_new_deal_bonus_v2_0_examination.php (100%) rename wms/{bons => bonus}/maintance/maintenance_contract_bonus_v2_0.php (100%) rename wms/{bons => bonus}/maintance/maintenance_contract_bonus_v2_0_examination.php (100%) delete mode 100644 wms/class/Cmail.php delete mode 100644 wms/class/Cnotice.php delete mode 100644 wms/cont/FormHelper.php delete mode 100644 wms/cont/MICalculator.php delete mode 100644 wms/cont/MSCalculator.php delete mode 100644 wms/cont/apply.php delete mode 100644 wms/cont/apply_form.php delete mode 100644 wms/cont/apply_form1.php delete mode 100644 wms/cont/async_req.php delete mode 100644 wms/cont/con_maintance_examine_clear.php delete mode 100644 wms/cont/conn.php delete mode 100644 wms/cont/crmm06_submit.php delete mode 100644 wms/cont/list.php delete mode 100644 wms/cont/model/ConMaintanceExamineApplyModel.php delete mode 100644 wms/cont/model/ConMaintanceExamineClearModel.php delete mode 100644 wms/cont/model/Model.php delete mode 100644 wms/cont/query_form.php delete mode 100644 wms/cont/review_apply_form.php delete mode 100644 wms/cont/sign_form.php delete mode 100644 wms/cont/sign_list.php delete mode 100644 wms/cont/submit.php delete mode 100644 wms/cont/success.php delete mode 100644 wms/cont/t.php delete mode 100644 wms/cont/test.php delete mode 100644 wms/cont/wf_common.php diff --git a/wms/bons/maintainance_contract_payment_status.php b/wms/bons/maintainance_contract_payment_status.php deleted file mode 100644 index ed76f046..00000000 --- a/wms/bons/maintainance_contract_payment_status.php +++ /dev/null @@ -1,399 +0,0 @@ -query($sql); - -function getContractnoDetails($link, $user_id, $contractno = null) -{ - $sql = " - SELECT - c.contractno - FROM contract AS c - LEFT JOIN con_maintance_examine_apply AS cmea - ON c.contractno = cmea.vol_no - WHERE 1 = 1 - AND cmea.salesman IN (" . getAccountids($link, $user_id) . ") - "; - if (!empty($contractno)) { - $sql .= " - AND c.contractno = '$contractno' - "; - } - $result = mysqli_query($link, $sql); - $data = []; - foreach ($result as $row) { - array_push($data, $row['contractno']); - } - return "'" . implode("','", $data) . "'"; -} - -function getSalesmanNo($link, $contractno) -{ - $sql = " - SELECT - cmea.salesman - FROM contract AS c - LEFT JOIN con_maintance_examine_apply AS cmea - ON c.contractno = cmea.vol_no - WHERE 1 = 1 - AND c.contractno IN ('$contractno') - "; - $result = mysqli_query($link, $sql); - $data = []; - foreach ($result as $row) - return $row['salesman']; - return ""; -} -function getSalesmanName($link, $contractno) -{ - $sql = " - SELECT - a.name - FROM contract AS c - LEFT JOIN con_maintance_examine_apply AS cmea - ON c.contractno = cmea.vol_no - LEFT JOIN account AS a - ON cmea.salesman = a.accountid - WHERE 1 = 1 - AND c.contractno IN ('$contractno') - "; - $result = mysqli_query($link, $sql); - $data = []; - foreach ($result as $row) - return $row['name']; - return ""; -} - -function getAccountids($link, $user_id) -{ - $sql = " - SELECT - accountid - FROM account - WHERE 1 = 1 - AND (accountid = '$user_id' - OR accountid IN ( - SELECT - accountid - FROM account - WHERE 1 = 1 - AND manager = '$user_id' - AND accounttype IN ('B','E','M','W') - ) - ) - "; - $result = mysqli_query($link, $sql); - $data = []; - foreach ($result as $row) { - array_push($data, $row['accountid']); - } - return "'" . implode("','", $data) . "'"; -} - -function checkArCheckBillStatus($row) -{ - $CU_EstPayDate = $row['CU_EstPayDate']; - $BillNo2 = $row['BillNo2']; - if (substr($CU_EstPayDate, 0, 6) <= date("Ym")) { - if (empty($BillNo2)) { - return "未轉應收確認單"; - } else { - return "已轉應收確認單"; - } - } else { - return "時間未到"; - } -} - -function arSellInvoiceMaterial($row) -{ - - $CU_EstPayDate = $row['CU_EstPayDate']; - $InvoiceName = $row['InvoiceName']; - - if (substr($CU_EstPayDate, 0, 6) <= date("Ym")) { - if (empty($InvoiceName)) { - return "未開發票"; - } else { - return "已開發票"; - } - } else { - return "時間未到"; - } -} - -function checkArWriteOffBill($conn, $row) -{ - $BillNo = $row['BillNo2']; - - $sql = " - SELECT - * - -- a.BillNo, - -- a.WriteOffBizPartnerId, - -- a.PayWriteOffOAmount, - -- b.FromBillDate AS ReceivedDate, - -- b.CurrWOFeeOAmt AS Fee, - -- c.OrderBillNo, - -- c.checkBillNo, - -- c.InvoiceNo, - -- c.BillDate AS CheckBillDate - FROM arWriteOffBill AS a - LEFT JOIN arWriteOffBillRec AS b ON a.BillNo=b.BillNo - LEFT JOIN - (SELECT temp1.*,arWriteOffBillDetail.* FROM arWriteOffBillDetail - LEFT JOIN - (SELECT - arCheckBill.BillNo AS checkBillNo, arCheckBill.BillDate,arCheckBillInvInfo.InvoiceNo - FROM arCheckBill - LEFT JOIN arCheckBillInvInfo - ON arCheckBill.InvoiceBillNo=arCheckBillInvInfo.InvoiceBillNo) AS temp1 - ON temp1.checkBillNo = arWriteOffBillDetail.FromBillNo) AS c - ON a.BillNo=c.BillNo - WHERE c.checkBillNo = '$BillNo' - "; - - $del = $conn->query($sql); - $i = 0; - foreach ($del as $row) - $i++; - if (empty($i)) { - return "未收款"; - } else { - return "已收款"; - } -} - -?> - - - - - - - - -
-
- - - - - - - - - - - - - -
-

保養合約-應收款項明細

-
合約號 - - - -
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
營業人員/契約人員合約號標示號電梯編號預計請款日催收次數應收申請單狀態請款金額(未轉應收)請款金額(已轉應收)應收申請單號發票狀態發票單標示號發票單號發票明細發票金額發票號碼核銷
- "; - echo getSalesmanName($link, $row['BillNo']); - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- -There is no record!"; -endif; - -#代表結束連線 -mysqli_close($link); - -include "footer.php"; -?> \ No newline at end of file diff --git a/wms/bons/api/get.php b/wms/bonus/api/get.php similarity index 64% rename from wms/bons/api/get.php rename to wms/bonus/api/get.php index b50687a3..52ae13ff 100644 --- a/wms/bons/api/get.php +++ b/wms/bonus/api/get.php @@ -1,26 +1,28 @@ prepare($sql); $stmt->execute(); @@ -37,7 +39,9 @@ $sql = "SELECT (SELECT temp1.*,arWriteOffBillDetail.* FROM arWriteOffBillDetail LEFT JOIN (SELECT - arCheckBill.BillNo AS checkBillNo, arCheckBill.BillDate,arCheckBillInvInfo.InvoiceNo + arCheckBill.BillNo AS checkBillNo, + arCheckBill.BillDate, + arCheckBillInvInfo.InvoiceNo FROM arCheckBill LEFT JOIN arCheckBillInvInfo ON arCheckBill.InvoiceBillNo=arCheckBillInvInfo.InvoiceBillNo) AS temp1 @@ -63,8 +67,6 @@ $count = COUNT($result); $data['maintain_month'] = intval($count * $result[0]['SQuantity']); - - if (!empty($check['CheckBillDate'])) { header('Content-Type: application/json'); echo json_encode($data); @@ -72,4 +74,3 @@ if (!empty($check['CheckBillDate'])) { echo false; exit; } -// } diff --git a/wms/bonus/api/getAccount.php b/wms/bonus/api/getAccount.php new file mode 100644 index 00000000..e60e2626 --- /dev/null +++ b/wms/bonus/api/getAccount.php @@ -0,0 +1,11 @@ +prepare($sql); +$stmt->bindParam(':accountid', $accountid); +$stmt->execute(); +$result = $stmt->fetch(PDO::FETCH_ASSOC); + +header('Content-Type: application/json'); +echo json_encode($result); diff --git a/wms/bonus/api/insertBonus.php b/wms/bonus/api/insertBonus.php new file mode 100644 index 00000000..2748a91d --- /dev/null +++ b/wms/bonus/api/insertBonus.php @@ -0,0 +1,27 @@ +;prepare($sql); + $stmt->bindParam(':bonus_type', $bonus_type); + $stmt->bindParam(':bonus_verson', $bonus_verson); + $stmt->bindParam('conreact_no', $contract_no); + $stmt->bindParam(':contract_type', $contract_type); + } + } diff --git a/wms/bonus/api/postCalBouns.php b/wms/bonus/api/postCalBouns.php new file mode 100644 index 00000000..f97ba228 --- /dev/null +++ b/wms/bonus/api/postCalBouns.php @@ -0,0 +1,53 @@ + 0) { + header("HTTP/1.1 422 Unprocessable Entity"); + echo json_encode($fail_arr); + exit(); + } + + + + // 合約類型 + $clientType = [ + '1' => 'new', + '2' => 'free_to_charge', + '3' => 'renew_priceissue' + ]; + + // 應付日期 + $day = DateTime::createFromFormat('Ymd', $payDay); + $pay_day = $day->format('Y-m-d'); + + $years = $maintain_month / 12; + $contract_years = ($years >= 2) ? 'above_two' : 'one'; + + $result = maintenance_contract_bonus_v2_0( + $bonuns_verson, + $clientType[$client_type], + $contract_years, + 0.8, + $maintain_price_total, + 0, + $payDay, + $receiver, + $manager, + $a + ); + header('Content-Type: application/json'); + echo json_encode($result); +} diff --git a/wms/bons/bons_index.php b/wms/bonus/bonus_index1.php similarity index 63% rename from wms/bons/bons_index.php rename to wms/bonus/bonus_index1.php index 0ee7058a..82c20421 100644 --- a/wms/bons/bons_index.php +++ b/wms/bonus/bonus_index1.php @@ -12,7 +12,7 @@ require_once('../contract-repair/conn.php'); -
+
@@ -60,6 +60,7 @@ require_once('../contract-repair/conn.php'); +

未填寫

作番號 @@ -68,11 +69,11 @@ require_once('../contract-repair/conn.php'); 獎金適用版本 - + - 獎金發放人員 + 契約人員 @@ -82,28 +83,73 @@ require_once('../contract-repair/conn.php'); 保養總額 - + + + - - - - + +
-
\ No newline at end of file +
+ + \ No newline at end of file diff --git a/wms/bons/elevator_new/elevator_new_deal_bonus_v1_0.php b/wms/bonus/elevator_new/elevator_new_deal_bonus_v1_0.php similarity index 100% rename from wms/bons/elevator_new/elevator_new_deal_bonus_v1_0.php rename to wms/bonus/elevator_new/elevator_new_deal_bonus_v1_0.php diff --git a/wms/bons/elevator_new/elevator_new_deal_bonus_v1_0_examination.php b/wms/bonus/elevator_new/elevator_new_deal_bonus_v1_0_examination.php similarity index 100% rename from wms/bons/elevator_new/elevator_new_deal_bonus_v1_0_examination.php rename to wms/bonus/elevator_new/elevator_new_deal_bonus_v1_0_examination.php diff --git a/wms/bons/elevator_new/elevator_new_deal_bonus_v2_0.php b/wms/bonus/elevator_new/elevator_new_deal_bonus_v2_0.php similarity index 100% rename from wms/bons/elevator_new/elevator_new_deal_bonus_v2_0.php rename to wms/bonus/elevator_new/elevator_new_deal_bonus_v2_0.php diff --git a/wms/bons/elevator_new/elevator_new_deal_bonus_v2_0_examination.php b/wms/bonus/elevator_new/elevator_new_deal_bonus_v2_0_examination.php similarity index 100% rename from wms/bons/elevator_new/elevator_new_deal_bonus_v2_0_examination.php rename to wms/bonus/elevator_new/elevator_new_deal_bonus_v2_0_examination.php diff --git a/wms/bons/maintance/maintenance_contract_bonus_v2_0.php b/wms/bonus/maintance/maintenance_contract_bonus_v2_0.php similarity index 100% rename from wms/bons/maintance/maintenance_contract_bonus_v2_0.php rename to wms/bonus/maintance/maintenance_contract_bonus_v2_0.php diff --git a/wms/bons/maintance/maintenance_contract_bonus_v2_0_examination.php b/wms/bonus/maintance/maintenance_contract_bonus_v2_0_examination.php similarity index 100% rename from wms/bons/maintance/maintenance_contract_bonus_v2_0_examination.php rename to wms/bonus/maintance/maintenance_contract_bonus_v2_0_examination.php diff --git a/wms/class/Cmail.php b/wms/class/Cmail.php deleted file mode 100644 index 51ed924b..00000000 --- a/wms/class/Cmail.php +++ /dev/null @@ -1,62 +0,0 @@ -charset = "UTF-8"; - $this->host = "mail.masada.com.tw"; - $this->port = 25; - $this->smtp_user = "notice"; // 這裡填寫SMTP登入帳號, 例如 your.gmail.name@gmail.com 則填寫your.gmail.name - $this->smtp_pwd = "90493119"; // 這裡填寫SMTP登入密碼 - } - - function sendx($subject="", $em_body="", $sendlist=array(), $from="永佳捷科技", $bcc="", $files=array()) - { - if (!$sendlist) return; - $em_body = nl2br($em_body); - $em_body .= "

※此信件為系統發出信件,請勿直接回覆。

"; - - $mail = new PHPMailer(true); - $mail->IsHTML(true); //設定是否使用HTML格式 - $mail->CharSet = $this->charset; - $mail->isSMTP(); - $mail->SMTPAuth = true; - $mail->Host = $this->host; - $mail->Port = $this->port; - $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //使用SSL, 如果是TLS 請改為 PHPMailer::ENCRYPTION_STARTTLS - $mail->Username = $this->smtp_user; - $mail->Password = $this->smtp_pwd; - $mail->SMTPSecure = ""; - $mail->From = "notice@masada.com.tw"; - $mail->FromName = $from; - $mail->Subject = $subject; - $mail->Body = $em_body; - foreach ($sendlist as $v) { // $sendlist[0]=['M0044', 'jrbin@masada.com.tw'] - list($name, $email) = $v; - if ($email) $mail->addAddress($email, $name); - } - //$mail->addCC("personC@gmail.com", "person C"); - //$mail->addBCC("personD@gmail.com", "person D"); - //$mail->addAttachment("image1.jpg", "picture.jpg"); //設定附件, 對方會看到附件名稱為 picture.jpg - //print_r($mail);exit; - if (!$mail->Send()){ - // echo "Mailer error: " . $mail->ErrorInfo; - } else { - //echo "Email sent"; - } - } -} \ No newline at end of file diff --git a/wms/class/Cnotice.php b/wms/class/Cnotice.php deleted file mode 100644 index 970bf81c..00000000 --- a/wms/class/Cnotice.php +++ /dev/null @@ -1,109 +0,0 @@ - false, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_EMULATE_PREPARES => false, - PDO::ATTR_STRINGIFY_FETCHES => false, - PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', - ]; - $pdo = new PDO('mysql:host=' . $host . ';port=' . $dbport . ';dbname=' . $dbname . '', $dbuser, $dbpassword, $options); - $pdo->exec('SET CHARACTER SET utf8mb4'); - return $pdo; - } catch (PDOException $e) { - die("Something wrong: {$e->getMessage()}"); - } - } - - /** - * 結束資料庫連線 - */ - function endConnectionDB($pdo) - { - unset($pdo); - } - - /** - * 提交消息 notice - * @param string $kind : 類別 1=系統 2=會議 - * @param int $related_id : 關聯序號 - * @param string $title : 標題 - * @param string $title : 內容 - * @param string $permission : 瀏覽權限 員編/ALL=全體 - * @param string $creater : 建立者 - * @param string $create_at : 建立時間 - */ - function sendx($data) - { - - $kind = $data['kind']; - $related_id = $data['related_id']; - $title = $data['title']; - $content = $data['content']; - $permission = $data['permission']; - $creater = $data['creater']; - $create_at = $data['create_at']; - - $pdo = $this->connectionDB(); - $pdo->exec('SET CHARACTER SET utf8mb4'); - $str = " - INSERT INTO `notice` (`kind`, `related_id`, `title`, `content`, `permission`, `creater`, `create_at`) - VALUES (?,?,?,?,?,?,?) - "; - - $sth = $pdo->prepare($str); - $sth->bindValue(1, $kind); - $sth->bindValue(2, $related_id); - $sth->bindValue(3, $title); - $sth->bindValue(4, $content); - $sth->bindValue(5, $permission); - $sth->bindValue(6, $creater); - $sth->bindValue(7, $create_at); - - $sth->execute(); - - $this->endConnectionDB($pdo); - } -} - -// $cn = new Cnotice(); -// $data = array( -// 'kind' => 1, -// 'related_id' => 1, -// 'title' => "標題", -// 'content' => "內容", -// 'permission' => "M0117", -// 'creater' => "M0117", -// 'create_at' => date("Y-m-d H:i:s") -// ); -// $cn->sendx($data); diff --git a/wms/cont/FormHelper.php b/wms/cont/FormHelper.php deleted file mode 100644 index 8025239a..00000000 --- a/wms/cont/FormHelper.php +++ /dev/null @@ -1,509 +0,0 @@ - 'post', 'accept-charset' => 'utf-8'), $attributes); - - return "
'; - } - - /** - * Form closing tag - * - * @static - * @return string - */ - public static function close() - { - return '
'; - } - - /** - * Creates a label for an input - * - * @param string $text The label text - * @param string $fieldName Name of the input element - * @param array $attributes HTML attributes - * @return string - */ - public static function label($text, $fieldName = null, array $attributes = array()) - { - if (!isset($attributes['for']) && $fieldName !== null) { - $attributes['for'] = static::autoId($fieldName); - } - if (!isset($attributes['id']) && isset($attributes['for'])) { - $attributes['id'] = $attributes['for'] . '-label'; - } - - return self::tag('label', $attributes, $text); - } - - /** - * Creates a text field - * - * @param string $name - * @param string $value - * @param array $attributes HTML attributes - * @return string - */ - public static function text($name, $value = null, array $attributes = array(),$type='text') - { - $attributes = array_merge(array( - 'id' => static::autoId($name), - 'name' => $name, - 'type' => $type, - 'value' => $value, - ), $attributes); - - return self::tag('input', $attributes); - } - - /** - * Creates a password input field - * - * @static - * @param string $name - * @param string $value - * @param array $attributes HTML attributes - * @return string - */ - public static function password($name, $value = null, array $attributes = array()) - { - $attributes = array_merge(array( - 'id' => static::autoId($name), - 'name' => $name, - 'type' => 'password', - 'value' => $value, - ), $attributes); - - return self::tag('input', $attributes); - } - - /** - * Creates a hidden input field - * - * @static - * @param string $name - * @param string $value - * @param array $attributes - * @return string - */ - public static function hidden($name, $value, array $attributes = array()) - { - $attributes = array_merge(array( - 'id' => static::autoId($name), - 'name' => $name, - 'type' => 'hidden', - 'value' => $value, - ), $attributes); - - return self::tag('input', $attributes); - } - - /** - * Creates a textarea - * - * @param string $name - * @param string $text - * @param array $attributes HTML attributes - * @return string - */ - public static function textArea($name, $text = null, array $attributes = array()) - { - $attributes = array_merge(array( - 'id' => static::autoId($name), - 'name' => $name, - ), $attributes); - - return self::tag('textarea', $attributes, (string)$text); - } - - /** - * Creates a check box. - * By default creates a hidden field with the value of 0, so that the field is present in $_POST even when not checked - * - * @param string $name - * @param bool $checked - * @param mixed $value Checked value - * @param array $attributes HTML attributes - * @param bool|string $withHiddenField Pass false to omit the hidden field or "array" to return both parts as an array - * @return string - */ - public static function checkBox( - $name, - $checked = false, - $value = 1, - array $attributes = array(), - $withHiddenField = true - ) { - $auto_id = static::autoId($name); - - $checkboxAttributes = array_merge(array( - 'name' => $name, - 'type' => 'checkbox', - 'value' => $value, - 'id' => $auto_id, - 'checked' => (bool)$checked, - ), $attributes); - $checkbox = self::tag('input', $checkboxAttributes); - - if ($withHiddenField === false) { - return $checkbox; - } - - $hiddenAttributes = array( - 'name' => $name, - 'type' => 'hidden', - 'value' => 0, - 'id' => $auto_id . '-hidden', - ); - $hidden = self::tag('input', $hiddenAttributes); - - return $withHiddenField === 'array' - ? array($hidden, $checkbox) - : $hidden . $checkbox; - } - - /** - * Creates multiple checkboxes for a has-many association. - * - * @param string $name - * @param array $collection - * @param array|\Traversable $checked Collection of checked values - * @param array $labelAttributes - * @param bool $returnAsArray - * @throws \InvalidArgumentException - * @return string - */ - public static function collectionCheckBoxes($name, array $collection, $checked, array $labelAttributes = array(), $returnAsArray = false) - { - // TODO: Does this check cover all options? - if (!(is_array($checked) || $checked instanceof \Traversable)) { - throw new \InvalidArgumentException("$name must be an array or Traversable!"); - } - - $checkBoxes = array(); - foreach ($collection as $value => $label) { - $checkBoxes[] = self::tag( - 'label', - $labelAttributes, - FormHelper::checkBox("{$name}[]", in_array($value, $checked, true), $value, array(), false) . self::escape($label), - false - ); - } - - return $returnAsArray ? $checkBoxes : implode('', $checkBoxes); - } - - /** - * Creates a radio button - * - * @static - * @param string $name - * @param string $value - * @param bool $checked - * @param array $attributes - * @return string - */ - public static function radio($name, $value, $checked = false, array $attributes = array()) - { - $attributes = array_merge(array( - 'type' => 'radio', - 'name' => $name, - 'value' => $value, - 'checked' => (bool)$checked, - ), $attributes); - - return self::tag('input', $attributes); - } - - /** - * Creates multiple radio buttons with labels - * - * @static - * @param string $name - * @param array $collection - * @param mixed $checked Checked value - * @param array $labelAttributes - * @param bool $returnAsArray - * @return array|string - */ - public static function collectionRadios($name, array $collection, $checked, array $labelAttributes = array(), $returnAsArray = false) - { - $radioButtons = array(); - foreach ($collection as $value => $label) { - $radioButtons[] = self::tag( - 'label', - $labelAttributes, - FormHelper::radio($name, $value, $value === $checked) . self::escape($label), - false - ); - } - - return $returnAsArray ? $radioButtons : implode('', $radioButtons); - } - - /** - * Creates a select tag - * - * // Simple select - * select('coffee_id', array('b' => 'black', 'w' => 'white')); - * - * With option groups - * select('beverage', array( - * 'Coffee' => array('bc' => 'black', 'wc' => 'white'), - * 'Tea' => array('gt' => 'Green', 'bt' => 'Black'), - * )); - * - * - * @param string $name Name of the attribute - * @param array $collection An associative array used for the option values - * @param mixed $selected Selected option Can be array or scalar - * @param array $attributes HTML attributes - * @return string - */ - public static function select($name, array $collection, $selected = null, array $attributes = array()) - { - $attributes = array_merge(array( - 'name' => $name, - 'id' => static::autoId($name), - 'multiple' => false, - ), $attributes); - - if (is_string($selected) || is_numeric($selected)) { - $selected = array($selected => 1); - } else if (is_array($selected)) { - $selected = array_flip($selected); - } else { - $selected = array(); - } - - $content = self::option('', '', $selected); - foreach ($collection as $value => $element) { - // Element is an optgroup - $content .= self::option($element['value'], $element['label'], $selected); - } - - return self::tag('select', $attributes, $content, false); - } - - /** - * Creates an option tag - * - * @param string $value - * @param string $label - * @param array $selected - * @return string - */ - private static function option($value, $label, $selected) - { - // Special handling of option tag contents to enable indentation with   - //$label = str_replace('&nbsp;', ' ', self::escape($label)); - - return self::tag( - 'option', - array( - 'value' => $value, - 'selected' => isset($selected[$value]), - ), - $label, - false - ); - } - - /** - * Creates a file input field - * - * @static - * @param string $name - * @param array $attributes HTML attributes - * @return string - */ - public static function file($name, array $attributes = array()) - { - $attributes = array_merge(array( - 'type' => 'file', - 'name' => $name, - 'id' => static::autoId($name), - ), $attributes); - - return self::tag('input', $attributes); - } - - public static function button($name, $text, array $attributes = array()) - { - $attributes = array_merge(array( - 'id' => static::autoId($name), - 'name' => $name, - ), $attributes); - - return self::tag('button', $attributes, $text); - } - - - /** - * Generate an ID given the name of an input - * - * @static - * @param string $name - * @return string|null - */ - public static function autoId($name) - { - // Don't set an id on collection inputs - if (strpos($name, '[]') !== false) { - return null; - } - - // Hyphenate array keys, for example model[field][other_field] => model-field-other_field - $name = preg_replace('/\[([^]]+)\]/u', '-\\1', $name); - - return $name; - } - - /** - * Generates an HTML tag - * - * @param string $tagName Name of the tag - * @param array $attributes HTML attributes - * @param string $content Content of the tag. Omit to create a self-closing tag - * @param bool $escape_content - * - * @see attributes() - * - * @return string - */ - public static function tag($tagName, array $attributes = array(), $content = null, $escape_content = true) - { - $result = '<' . $tagName . static::attributes($attributes) . '>'; - - if ($content !== null) { - $result .= ($escape_content ? static::escape($content) : $content) . ''; - } - - return $result; - } - - /** - * Converts an array of HTML attributes to a string - * - * If an attribute is false or null, it will not be set. - * - * If an attribute is true or is passed without a key, it will - * be set without an explicit value (useful for checked, disabled, ..) - * - * If an array is passed as a value, it will be joined using spaces - * - * Note: Starts with a space - * - * Html::attributes(array('id' => 'some-id', 'selected' => false, 'disabled' => true, 'class' => array('a', 'b'))); - * //=> ' id="some-id" disabled class="a b"' - * - * - * @param array $attributes Associative array of attributes - * - * @return string - */ - public static function attributes(array $attributes) - { - $result = ''; - - foreach ($attributes as $attribute => $value) { - if ($value === false || $value === null) continue; - if ($value === true) { - $result .= ' ' . $attribute; - } else if (is_numeric($attribute)) { - $result .= ' ' . $value; - } else { - if (is_array($value)) { // support cases like 'class' => array('one', 'two') - $value = implode(' ', $value); - } - $result .= ' ' . $attribute . '=\'' . static::escape($value) . '\''; - } - } - - return $result; - } - - /** - * Escapes a string for output in HTML - * - * @static - * @param string $string - * @return string - */ - public static function escape($string) - { - return htmlspecialchars($string, ENT_QUOTES, 'UTF-8'); - } - /** - * 输出表单标题 - * - * @param string $title - * @return void - */ - public static function formTitle(string $title) - { - return '
-
- ' . $title . ' -
-
- '; - } - /** - * 输出行标题 - * - * @param string $title - * @return void - */ - public static function formRowTitle(string $title) - { - return '
-
- ' . $title . ' -
-
- '; - } - /** - * 输出行内容 - * - * @return void - */ - public static function formRowContent($fieldName, string $fieldValue, string $key) - { - return '
-

' . $fieldName . '

-
-
- -
- '; - } - /** - * 生成Row - * - * @return void - */ - public function formRow() - { - $_div = "
"; - $_div .= "
"; - } -} diff --git a/wms/cont/MICalculator.php b/wms/cont/MICalculator.php deleted file mode 100644 index 8b087582..00000000 --- a/wms/cont/MICalculator.php +++ /dev/null @@ -1,324 +0,0 @@ - 'fail', - 'message' => '無此項目,請聯係業務部創建MI' - ]; - } - public function success($price) - { - return [ - 'status' => 'ok', - 'price' => $price - ]; - } -} diff --git a/wms/cont/MSCalculator.php b/wms/cont/MSCalculator.php deleted file mode 100644 index cd56873b..00000000 --- a/wms/cont/MSCalculator.php +++ /dev/null @@ -1,322 +0,0 @@ - 'fail', - 'message' => '無此項目,請聯係業務部創建標準成本' - ]; - } - public function success($price) - { - return [ - 'status' => 'ok', - 'price' => $price - ]; - } -} diff --git a/wms/cont/apply.php b/wms/cont/apply.php deleted file mode 100644 index 451eb877..00000000 --- a/wms/cont/apply.php +++ /dev/null @@ -1,22 +0,0 @@ -initWorkFlow(ID); - -//加载视图 - -echo '查看全部待签'; diff --git a/wms/cont/apply_form.php b/wms/cont/apply_form.php deleted file mode 100644 index a7f4c7db..00000000 --- a/wms/cont/apply_form.php +++ /dev/null @@ -1,859 +0,0 @@ -0) { - echo""; - exit; -} -*/ - -#係統ID -$system_id = 'con'; -#流程ID -$flow_id = 'con01'; -#表單號 $form_id; -$form_id = ""; -#價審單狀態 -$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"); -// echo '
';
-// print_r($apply_key);
-// echo '
'; -// exit; -// if ($salesman != $user_id) { -// echo ''; -// exit; -// } -if (empty($apply_key)) $apply_st = 1; // 準備新增 -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($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; // 修改中,還未提交 - else $apply_st = 9; // 已到下一關,無法䖺改 -} - -// if ($apply_st > 2) { -// echo ""; -// exit; -// } - -if ($apply_st == 1) { - $wf = new WorkFlow($system_id, $flow_id, $form_id); - $wf->initWorkFlow($user_id); - $form_key = $wf->flowContext->getFormKey(); -} else { - $wf = new WorkFlow($system_id, $flow_id, $form_id, $form_key); -} - -#獲取簽核意見 -$assign_opinions = Assign::get_records($form_key); - -#會簽部門意見 -$subflow_assign_opinions = SubflowManager::getCounterSignComments($form_key); - -//預設冇有摺扣 -$wf->setFormData(['discount' => 100]); -$flowName = $wf->getFlowName(); -$assigner = $wf->getAssignerList(); -$assign_status = $wf->getAssignStatus($assigner); - -$if_show_assign = true; -//加載流程圖 -//$fc = WorkFLowItems::get_records($flow->getSystemID(), $flow->getFlowID()); -//$path = $fc[0]->wf_file; -//echo dirname(__DIR__)."/../"."$path"; - -//$flow_chart = file_get_contents(dirname(__DIR__) . '/' . $path); -#是否可會簽 -$isSplitable = $wf->isSplitable(); - -//表單數據 -#客戶表 -#1.電梯品牌選項 -$sql = "SELECT code_name value ,content label FROM code WHERE field_name='elevator_brand' order by code_name asc "; -$elevator_brand_opt = DB::result($sql); -#2.保養方式 -$sql = "SELECT code_name value ,content label FROM code WHERE field_name='maintain_kind'"; -$maintain_kind_opt = DB::result($sql); -#3.電梯類型 -$sql = "SELECT code_name value ,content label FROM code WHERE field_name='maintain_elevator_kind'"; -$elevator_kind_opt = DB::result($sql); -#4.付款方式 -$sql = "SELECT code_name value ,content label FROM code WHERE field_name='payment_kind' order by code_name+ 0 asc"; -$payment_kind_opt = DB::result($sql); -#5.契約性質 -$sql = "SELECT code_name value ,content label FROM code WHERE field_name='contract_kind'"; -$contract_kind_opt = DB::result($sql); -#6.是否贈送M1 -$is_m1_bundle_opt = [ - ['label' => '是', 'value' => 'Y'], - ['label' => '否', 'value' => 'N'] - -]; -#7.機種 -$sql = "SELECT code_name value ,content label FROM code WHERE field_name='fp_kind'"; -$fp_kind_opt = DB::result($sql); -#抓取有望客戶資料 - - -$vol_no = $_GET['vol_no']; -$where = " and vol_no='$vol_no'"; -$sql = "SELECT * FROM hope_contract_customer where 1=1 $where ORDER BY vol_no"; -// print_r($sql); -$hope_contract = DB::result($sql); -$hope_contract = empty($hope_contract) ? [] : $hope_contract[0]; -#寫入 con_maintance_examine_apply -if ($apply_st == 1) { - #獲取評審單號 - $apply_key = get_sequnece_no('cmea_apply_key', date('ym')); - //var_dump($hope_contract); - $insert_data = [ - 'apply_key' => $apply_key, - 'vol_no' => $vol_no, - 'form_key' => $form_key, - 'address' => $hope_contract['address'], - 'case_name' => $hope_contract['customer'], - 'num' => $hope_contract['num'], - 'brand' => '', - 'customer' => $hope_contract['customer'], - 'salesman' => empty($hope_contract['salesman']) ? $user_id : $hope_contract['salesman'], - 'progress_remark' => $hope_contract['progress_status'] - //'platform_company'=>'', - // 'platforom_company_tel'=> '' - - ]; - //var_dump($insert_data); - DB::insert_table('con_maintance_examine_apply', $insert_data); -} - -$table = 'con_maintance_examine_apply'; -#可編輯的列 -$editableColumn = [ - 'apply_key' => [ - 'label' => "評審單號", "value" => "$apply_key", "tag" => 'text', - 'attr' => [ - 'readonly=true ', - 'class' => 'form-control form-control-sm' - ] - ], - 'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']], - 'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'num' => ['label' => "數量", "value" => "", "tag" => 'digits', 'attr' => ['required', 'min=1', 'class' => 'form-control form-control-sm']], - 'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $maintain_kind_opt], - 'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $contract_kind_opt], - 'introducer' => ['label' => "介紹人", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - - 'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt], - -]; -$where = " and apply_key='$apply_key'"; - -$sql = "SELECT * FROM $table where 1=1 $where ORDER BY vol_no"; -$data = []; -$data = DB::result($sql); - -#電梯詳細資料 -$con_maintance_examine_clear_columm = [ - 'register_code' => ['label' => "電梯許可證代碼", "value" => "", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', 'required', 'class' => 'form-control form-control-sm']], - 'elevator_brand' => ['label' => "品牌", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'elevator_brand[]', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'elevator_kind' => ['label' => "電梯類型", "value" => "", "tag" => 'select', 'attr' => ['name' => 'elevator_kind[]', 'required', 'colspan' => 2, 'class' => 'form-control form-control-sm'], 'options' => $elevator_kind_opt], - 'spec' => ['label' => "規格型號", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'spec[]', 'class' => 'form-control form-control-sm'], 'options' => $fp_kind_opt], - 'weight' => ['label' => "載重(KG)", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'weight[]', "placeholder" => "載重", 'gt=0', 'min=0', 'required', 'class' => 'form-control form-control-sm']], - 'speed' => ['label' => "速度(m/min)", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed[]', "placeholder" => "速度", 'gt=0', 'min=0', 'required', 'class' => 'form-control form-control-sm']], - 'stop' => ['label' => "停數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'stop[]', "placeholder" => "停數", 'class' => 'form-control form-control-sm']], - 'floors' => ['label' => "層數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'floors[]', 'min=1', 'required', "placeholder" => "層數", 'class' => 'form-control form-control-sm']], - 'persons' => ['label' => "人乘", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'persons[]', 'min=1', 'required', "placeholder" => "人乘", 'class' => 'form-control form-control-sm']], - - 'maintain_times' => ['label' => "保養次數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'maintain_times[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_months' => ['label' => "保養月數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'maintain_months[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_period' => ['label' => "保養周期", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt], - 'useful_years' => ['label' => "竣工檢查年度", "value" => "", "tag" => 'digits', 'attr' => ['colspan' => 2, 'required', "placeholder" => "竣工檢查年度", 'gt=0', 'min=0', 'name' => 'useful_years[]', 'class' => 'form-control form-control-sm']], - 'last_check_date' => ['label' => "上次年檢日期", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'last_check_date[]', "placeholder" => "上次年檢日期", 'colspan' => 2, 'class' => 'form-control form-control-sm']], - - 'annual_survey_expense' => ['label' => "年檢費用(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'annual_survey_expense[]', "placeholder" => "年檢費用", 'colspan' => 2, 'class' => 'form-control form-control-sm ']], - - 'maintain_times' => ['label' => "保養次數", "tag" => 'digits', 'attr' => ['name' => 'maintain_times[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'register_code' => ['label' => "電梯許可證代碼", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', "placeholder" => "無證號請輸入A,B...", 'required', 'class' => 'form-control form-control-sm']], - 'maintain_months' => ['label' => "保養月數", "tag" => 'digits', 'attr' => ['name' => 'maintain_months[]', "value" => "12", 'min=12', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_period' => ['label' => "保養周期", "tag" => 'digits', 'attr' => ['name' => 'maintain_period[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'option' => 'disable', 'options' => $is_m1_bundle_opt], - 'stand_price' => ['label' => "標準價格(元/月)", "value" => "", "tag" => 'text', 'attr' => ['required', "readonly", 'colspan' => 2, 'name' => 'stand_price[]', 'class' => 'form-control form-control-sm']], - 'contract_price' => ['label' => "契約報價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, "placeholder" => "契約報價", 'name' => 'contract_price[]', 'class' => 'form-control form-control-sm']], - 'sold_price' => ['label' => "契約成交價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'sold_price[]', 'placeholder' => '契約成交價', 'class' => 'form-control form-control-sm']], - -]; -$con_maintance_examine_clear = DB::result("SELECT " . implode(',', array_keys($con_maintance_examine_clear_columm)) . - " FROM con_maintance_examine_clear where 1=1 and apply_key='$apply_key' and cmstatus='Y' "); - -$j = 0; -$col_count = 12; -$cmecRow = " "; -foreach ($con_maintance_examine_clear_columm as $key => $val) { - $fieldVal = ""; - $_input = $val['tag'] == 'select' ? - FormHelper::select('', $val['options'], $fieldVal, $val['attr']) - : FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']); - // : ""; - $cmecRow .= "
$_input"; - if ((++$j % $col_count) == 0) { - if ($j == $col_count) $cmecRow .= ""; - $cmecRow .= ""; - } -} -$cmecRow .= ""; -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; - #當前年月 - 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 "); - - - return $seq_no; -} -$sql = "SELECT * FROM account WHERE accountid = '$user_id' "; -list($result) = DB::result($sql); -if ($result['department_id'] == '511') { - $managerid = 'M0137'; - $managername = '劉永德'; -} else if ($result['department_id'] == '512') { - $managerid = 'M0054'; - $managername = '陳志文'; -} else if ($result['department_id'] == '513') { - $managerid = 'M0086'; - $managername = '李烘銘'; -} else if ($result['department_id'] == '514') { - $managerid = 'M0033'; - $managername = '吳育宗'; -} else if ($user_id == 'TEST01') { - $managerid = 'TEST04'; - $managername = '區經理'; -} - -if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' || $result['department_id'] == 'M0033') { - $managerid = 'M0008'; - $managername = '詹益彰'; -} - -?> - - - - - - - - - - - - - - - - - - - -
- - - - -
- -
- -
-
- - - ' /> - - - -
-
-
-

保養契約價格審核單

-
-
- -
-
- 契約信息 -
-
- - "; - foreach ($editableColumn as $key => $val) { - $j = (($i++) % 4); - $fieldVal = empty($data) ? "" : $data[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 " -
-
- "; - } - echo "
- " . $val['label'] . " -
-
- $_input -
- "; - } - echo "
"; - - ?> - -
-
- 洽商進度 -
-
- - -
-
-
-
- 電梯詳細資料 -
- - - - - - - - - - - "; - - $i = 0; - $cmecRow = ''; - foreach ($con_maintance_examine_clear_columm as $col => $col_def) { - echo FormHelper::tag("th", ['colspan' => empty($col_def['attr']['colspan']) ? 1 : $col_def['attr']['colspan']], $col_def['label']); - - if ((++$j % $col_count) == 0) { - if ($j == $col_count) echo ""; - echo ""; - } - } - echo ''; - - - ?> - - - - - - $val) { - $j = 0; - $cmecRow = ""; - foreach ($con_maintance_examine_clear_columm as $col => $col_def) { - - $fieldVal = empty($val) ? "" : $val[$col]; - $_input = $col_def['tag'] == 'select' ? - FormHelper::select($col, $col_def['options'], $fieldVal, $col_def['attr']) - : FormHelper::text($col, $fieldVal, $col_def['attr'], $col_def['tag']); - $cmecRow .= ""; - if ((++$j % $col_count) == 0) { - $cmecRow .= ""; - $cmecRow .= ""; - } - } - - - echo $cmecRow . ""; - } - ?> - - -
- 註意事項: -

1.速度單位是 米/分.

-

2.選擇贈送M1,保養月數需填寫60.

-

3.標準價格未帶出,請聯係業務部建立該規格報價.

-

4.無機房速度20~60米 以60米為標準.

- - -
操作
- $_input
- -
- -
-
- 簽核操作 -
-
- -
-
-
-
- 簽核狀態 -
-
- -
- -
- 下位簽核者 -
-
- - -
-
-   - -
- -
-
-
- -
-
-
- - -
- -
- - - - ' . $wf->getNodeDescriptions($as['flow_code']) . ' -
'; - $tmp_code = $as['flow_code']; - ?> -
"> -
- - - - -   - " . $as['position_name'] . " "; ?> - - - - - - -   - 申請人 "; ?> - 退回"; ?> - 會簽"; ?> - - - - 簽核於: - - - -
-
- -
- -
- -
- - - -
-
- -
-
-
- - - -
- - - - - - \ No newline at end of file diff --git a/wms/cont/apply_form1.php b/wms/cont/apply_form1.php deleted file mode 100644 index 2e035859..00000000 --- a/wms/cont/apply_form1.php +++ /dev/null @@ -1,912 +0,0 @@ -0) { - echo""; - exit; -} -*/ - -#係統ID -$system_id = 'con'; -#流程ID -$flow_id = 'con01'; -#表單號 $form_id; -$form_id = ""; -#價審單狀態 -$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"); -// echo '
';
-// print_r($salesman);
-// echo '
'; -// exit; -if ($salesman != $user_id) { - echo ''; - exit; -} -if (empty($apply_key)) $apply_st = 1; // 準備新增 -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($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; // 修改中,還未提交 - else $apply_st = 9; // 已到下一關,無法䖺改 -} - -// if ($apply_st > 2) { -// echo ""; -// exit; -// } - -if ($apply_st == 1) { - $wf = new WorkFlow($system_id, $flow_id, $form_id); - $wf->initWorkFlow($user_id); - $form_key = $wf->flowContext->getFormKey(); -} else { - $wf = new WorkFlow($system_id, $flow_id, $form_id, $form_key); -} - -#獲取簽核意見 -$assign_opinions = Assign::get_records($form_key); - -#會簽部門意見 -$subflow_assign_opinions = SubflowManager::getCounterSignComments($form_key); - -//預設冇有摺扣 -$wf->setFormData(['discount' => 100]); -$flowName = $wf->getFlowName(); -$assigner = $wf->getAssignerList(); -$assign_status = $wf->getAssignStatus($assigner); -$if_show_assign = true; -//加載流程圖 -//$fc = WorkFLowItems::get_records($flow->getSystemID(), $flow->getFlowID()); -//$path = $fc[0]->wf_file; -//echo dirname(__DIR__)."/../"."$path"; - -//$flow_chart = file_get_contents(dirname(__DIR__) . '/' . $path); -#是否可會簽 -$isSplitable = $wf->isSplitable(); - -//表單數據 -#客戶表 -#1.電梯品牌選項 -$sql = "select code_name value ,content label from code where field_name='elevator_brand' order by code_name asc "; -$elevator_brand_opt = DB::result($sql); -#2.保養方式 -$sql = "select code_name value ,content label from code where field_name='maintain_kind'"; -$maintain_kind_opt = DB::result($sql); -#3.電梯類型 -$sql = "select code_name value ,content label from code where field_name='maintain_elevator_kind'"; -$elevator_kind_opt = DB::result($sql); -#4.付款方式 -$sql = "select code_name value ,content label from code where field_name='payment_kind' order by code_name+ 0 asc"; -$payment_kind_opt = DB::result($sql); -#5.契約性質 -$sql = "select code_name value ,content label from code where field_name='contract_kind'"; -$contract_kind_opt = DB::result($sql); -#6.是否贈送M1 -$is_m1_bundle_opt = [ - ['label' => '是', 'value' => 'Y'], - ['label' => '否', 'value' => 'N'] - -]; -#7.機種 -$sql = "select code_name value ,content label from code where field_name='fp_kind'"; -$fp_kind_opt = DB::result($sql); -#抓取有望客戶資料 - -$vol_no = $_GET['vol_no']; -$where = " and vol_no='$vol_no'"; -$sql = "SELECT * FROM hope_contract_customer where 1=1 $where ORDER BY vol_no"; -$hope_contract = DB::result($sql); -$hope_contract = empty($hope_contract) ? [] : $hope_contract[0]; -#寫入 con_maintance_examine_apply -if ($apply_st == 1) { - #獲取評審單號 - $apply_key = get_sequnece_no('cmea_apply_key', date('ym')); - //var_dump($hope_contract); - $insert_data = [ - 'apply_key' => $apply_key, - 'vol_no' => $vol_no, - 'form_key' => $form_key, - 'address' => $hope_contract['address'], - 'case_name' => $hope_contract['customer'], - 'num' => $hope_contract['num'], - 'brand' => '', - 'customer' => $hope_contract['customer'], - 'salesman' => empty($hope_contract['salesman']) ? $user_id : $hope_contract['salesman'], - 'progress_remark' => $hope_contract['progress_status'] - //'platform_company'=>'', - // 'platforom_company_tel'=> '' - - ]; - //var_dump($insert_data); - DB::insert_table('con_maintance_examine_apply', $insert_data); -} -#抓使用者主管 -$sql = "SELECT * FROM account WHERE accountid = '$user_id' "; -list($result) = DB::result($sql); -if ($result['department_id'] == '511') { - $managerid = 'M0137'; - $managername = '劉永德'; -} else if ($result['department_id'] == '512') { - $managerid = 'M0137'; - $managername = '劉永德'; -} else if ($result['department_id'] == '513') { - $managerid = 'M0086'; - $managername = '李烘銘'; -} else if ($result['department_id'] == '514') { - $managerid = 'M0033'; - $managername = '吳育宗'; -} - -if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' || $result['department_id'] == 'M0033') { - $managerid = 'M0008'; - $managername = '詹益彰'; -} - -if ($result['department_id'] == 'M0008') { - $managerid = 'M0008'; - $managername = '詹益彰'; -} -$table = 'con_maintance_examine_apply'; -#可編輯的列 -$editableColumn = [ - 'apply_key' => [ - 'label' => "評審單號", "value" => "$apply_key", "tag" => 'text', - 'attr' => [ - 'readonly=true ', - 'class' => 'form-control form-control-sm' - ] - ], - 'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']], - 'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'num' => ['label' => "數量", "value" => "", "tag" => 'digits', 'attr' => ['required', 'min=1', 'class' => 'form-control form-control-sm']], - 'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $maintain_kind_opt], - 'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $contract_kind_opt], - 'introducer' => ['label' => "介紹人", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - - 'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt], - -]; -$where = " and apply_key='$apply_key'"; - -$sql = "SELECT * FROM $table where 1=1 $where ORDER BY vol_no"; -$data = []; -$data = DB::result($sql); - -#電梯詳細資料 -$con_maintance_examine_clear_columm = [ - 'register_code' => ['label' => "電梯許可證代碼", "value" => "", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', 'required', 'class' => 'form-control form-control-sm']], - 'elevator_brand' => ['label' => "品牌", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'elevator_brand[]', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'elevator_kind' => ['label' => "電梯類型", "value" => "", "tag" => 'select', 'attr' => ['name' => 'elevator_kind[]', 'required', 'colspan' => 2, 'class' => 'form-control form-control-sm'], 'options' => $elevator_kind_opt], - 'spec' => ['label' => "規格型號", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'spec[]', 'class' => 'form-control form-control-sm'], 'options' => $fp_kind_opt], - 'weight' => ['label' => "載重(KG)", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'weight[]', "placeholder" => "載重", 'gt=0', 'min=0', 'required', 'class' => 'form-control form-control-sm']], - 'speed' => ['label' => "速度(m/min)", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed[]', "placeholder" => "速度", 'gt=0', 'min=0', 'required', 'class' => 'form-control form-control-sm']], - 'stop' => ['label' => "停數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'stop[]', "placeholder" => "停數", 'class' => 'form-control form-control-sm']], - 'floors' => ['label' => "層數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'floors[]', 'min=1', 'required', "placeholder" => "層數", 'class' => 'form-control form-control-sm']], - 'persons' => ['label' => "人乘", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'persons[]', 'min=1', 'required', "placeholder" => "人乘", 'class' => 'form-control form-control-sm']], - - 'maintain_times' => ['label' => "保養次數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'maintain_times[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_months' => ['label' => "保養月數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'maintain_months[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_period' => ['label' => "保養周期", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt], - 'useful_years' => ['label' => "竣工檢查年度", "value" => "", "tag" => 'digits', 'attr' => ['colspan' => 2, 'required', "placeholder" => "竣工檢查年度", 'gt=0', 'min=0', 'name' => 'useful_years[]', 'class' => 'form-control form-control-sm']], - 'last_check_date' => ['label' => "上次年檢日期", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'last_check_date[]', "placeholder" => "上次年檢日期", 'colspan' => 2, 'class' => 'form-control form-control-sm']], - - 'annual_survey_expense' => ['label' => "年檢費用(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'annual_survey_expense[]', "placeholder" => "年檢費用", 'colspan' => 2, 'class' => 'form-control form-control-sm ']], - - 'maintain_times' => ['label' => "保養次數", "tag" => 'digits', 'attr' => ['name' => 'maintain_times[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'register_code' => ['label' => "電梯許可證代碼", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', "placeholder" => "無證號請輸入A,B...", 'required', 'class' => 'form-control form-control-sm']], - 'maintain_months' => ['label' => "保養月數", "tag" => 'digits', 'attr' => ['name' => 'maintain_months[]', "value" => "12", 'min=12', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_period' => ['label' => "保養周期", "tag" => 'digits', 'attr' => ['name' => 'maintain_period[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'option' => 'disable', 'options' => $is_m1_bundle_opt], - 'stand_price' => ['label' => "標準價格(元/月)", "value" => "", "tag" => 'text', 'attr' => ['required', "readonly", 'colspan' => 2, 'name' => 'stand_price[]', 'class' => 'form-control form-control-sm']], - 'contract_price' => ['label' => "契約報價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, "placeholder" => "契約報價", 'name' => 'contract_price[]', 'class' => 'form-control form-control-sm']], - 'sold_price' => ['label' => "契約成交價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'sold_price[]', 'class' => 'form-control form-control-sm']], - -]; -$con_maintance_examine_clear = DB::result("SELECT " . implode(',', array_keys($con_maintance_examine_clear_columm)) . - " FROM con_maintance_examine_clear where 1=1 and apply_key='$apply_key' and cmstatus='Y' "); -$j = 0; -$col_count = 12; -$cmecRow = " "; - -foreach ($con_maintance_examine_clear_columm as $key => $val) { - $fieldVal = ""; - $_input = $val['tag'] == 'select' ? - FormHelper::select('', $val['options'], $fieldVal, $val['attr']) - : FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']); - // : ""; - $cmecRow .= "
$_input"; - if ((++$j % $col_count) == 0) { - if ($j == $col_count) $cmecRow .= ""; - $cmecRow .= ""; - } -} - - -$cmecRow .= ""; -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; - #當前年月 - 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 "); - - - return $seq_no; -} - - -?> - - - - - - - - - - - - - - - - - - -
- - - - -
- -
- -
-
- - - ' /> - - - -
-
-
-

保養契約價格審核單

-
-
- -
-
- 契約信息 -
-
- - "; - foreach ($editableColumn as $key => $val) { - $j = (($i++) % 4); - $fieldVal = empty($data) ? "" : $data[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 " -
-
- "; - } - echo "
- " . $val['label'] . " -
-
- $_input -
- "; - } - echo "
"; - - ?> - -
-
- 洽商進度 -
-
- - -
-
-
-
- 電梯詳細資料 -
- - - - - - - - - - -
- 註意事項: -

1.速度單位是 米/分.

-

2.選擇贈送M1,保養月數需填寫60.

-

3.標準價格未帶出,請聯係業務部建立該規格報價.

-

4.無機房速度20~60米 以60米為標準.

- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
電梯許可代碼品牌電梯類型規格型號載重(KG)速度(m/min)停數層數人乘保養次數保養月數保養周期贈送M1
-
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
竣工檢查年度上次年檢日期年檢費用(元)標準價格(元/月)契約報價(元/月)契約成交價(元/月)刪除
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
- -
-
- 簽核操作 -
-
- -
-
-
-
- 簽核狀態 -
-
- -
- -
- 下位簽核者 -
-
- - -
-
-   - -
- -
-
-
- -
-
-
- -
- -
- - - - ' . $wf->getNodeDescriptions($as['flow_code']) . ' -
'; - $tmp_code = $as['flow_code']; - ?> -
"> -
- - - - -   - " . $as['position_name'] . " "; ?> - - - - - - -   - 申請人 "; ?> - 退回"; ?> - 會簽"; ?> - - - - 簽核於: - - - -
-
- -
- -
- -
- - - -
-
- -
-
-
- - - -
- - - - - - \ No newline at end of file diff --git a/wms/cont/async_req.php b/wms/cont/async_req.php deleted file mode 100644 index 0d693a1e..00000000 --- a/wms/cont/async_req.php +++ /dev/null @@ -1,20 +0,0 @@ - $code_name]); -} diff --git a/wms/cont/con_maintance_examine_clear.php b/wms/cont/con_maintance_examine_clear.php deleted file mode 100644 index f2faf705..00000000 --- a/wms/cont/con_maintance_examine_clear.php +++ /dev/null @@ -1,14 +0,0 @@ - ['label' => "电梯注册代码", "value" => "", "tag" => 'text', 'class' => ''], - 'brand' => ['label' => "品牌", "value" => "", "tag" => 'text', 'class' => ''], - 'spec' => ['label' => "规格型号", "value" => "", "tag" => 'text', 'class' => ''], - 'weight' => ['label' => "载重", "value" => "", "tag" => 'text', 'class' => ''], - 'speed' => ['label' => "速度", "value" => "", "tag" => 'text', 'class' => ''], - 'stop' => ['label' => "停数", "value" => "", "tag" => 'text', 'class' => ''], - 'useful_years' => ['label' => "使用年限", "value" => "", "tag" => 'text', 'class' => ''], - 'last_check_date' => ['label' => "最近一次年检日期", "value" => "", "tag" => 'text', 'class' => ''], - 'speed_governors_check_expense' => ['label' => "限速器校验费", "value" => "", "tag" => 'text', 'class' => ''], -]; -$con_maintance_examine_clear = DB::result("SELECT * FROM con_maintance_examine_clear where 1=1 and cmstatus='Y' "); diff --git a/wms/cont/conn.php b/wms/cont/conn.php deleted file mode 100644 index 1476902e..00000000 --- a/wms/cont/conn.php +++ /dev/null @@ -1,42 +0,0 @@ -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; //關閉資料庫的連線 \ No newline at end of file diff --git a/wms/cont/crmm06_submit.php b/wms/cont/crmm06_submit.php deleted file mode 100644 index 79b54de8..00000000 --- a/wms/cont/crmm06_submit.php +++ /dev/null @@ -1,21 +0,0 @@ -fillable; -foreach ($cols as $col) { - if (!in_array($col, array_keys($request))) { - continue; - } - $data[$col] = empty($request[$col]) ? NULL : $request[$col]; -} -$hecm->create( $data); - - -echo""; diff --git a/wms/cont/list.php b/wms/cont/list.php deleted file mode 100644 index a019243e..00000000 --- a/wms/cont/list.php +++ /dev/null @@ -1,168 +0,0 @@ - $item['system_id'], 'system_name' => $item['system_name']); -}, $res_get); -$system_name_opt = (array_unique($system_name_opt, SORT_REGULAR)); - - -$flow_name_opt = array_map(function ($item) { - return array('flow_id' => $item['flow_id'], 'flow_name' => $item['flow_name']); -}, $res_get); -$flow_name_opt = (array_unique($flow_name_opt, SORT_REGULAR)); - -?> - -
- - - - - - - - - - - - - - - - - - - - - -
-

待签查询

-
系统名称 - - 流程名称
- -
-
- - - - - - - - - - - - - $data) : - ?> - - - - - - - - - - - - - -
序号系统名称流程名称接收日期当前签核者
-
-
- \ No newline at end of file diff --git a/wms/cont/model/ConMaintanceExamineApplyModel.php b/wms/cont/model/ConMaintanceExamineApplyModel.php deleted file mode 100644 index f4824a9a..00000000 --- a/wms/cont/model/ConMaintanceExamineApplyModel.php +++ /dev/null @@ -1,29 +0,0 @@ -fillable as $col) { - $_data[$col] = empty($data[$col]) ? '' : $data[$col]; - } - DB::insert_table($this->table, $_data); - } - /** - * 创建或更新 - * - * @return void - */ - public function createOrUpdate(array $keyCol, array $data) - { - list($cnt) = DB::fields( - "select count(*) from $this->table where " . $keyCol[0] . " = '" . $keyCol[1] . "'" - ); - if ($cnt == 0) { - self::create(array_merge($data, $keyCol)); - } - } - - public function update(array $keyCol, array $data) - { - $_data = []; - foreach ($this->fillable as $col) { - if (in_array($col, array_keys($data))) $_data[$col] = empty($data[$col]) ? '' : $data[$col]; - } - DB::update_table($this->table, $_data, $keyCol[0] . '=\'' . $keyCol[1] . '\''); - } - /** - * 获取记录 - * - * @param array $cond - * @return void - */ - public function get(array $cond) - { - return []; - } -} diff --git a/wms/cont/query_form.php b/wms/cont/query_form.php deleted file mode 100644 index f3495f14..00000000 --- a/wms/cont/query_form.php +++ /dev/null @@ -1,511 +0,0 @@ -vol_no; -require_once './MICalculator.php'; -require_once './FormHelper.php'; -require_once './wf_common.php'; -list($form_key) = DB::fields("select form_key from con_maintance_examine_apply where apply_key='$apply_key'"); -//echo $form_key; -$flow = new Flow($form_key); -// 當前節點簽核開始 -//var_dump($flow); -$wf = new WorkFlow($flow->system_id, $flow->flow_id, $flow->form_id, $form_key); -#獲取簽核意見 -$assign_opinions = Assign::get_records($form_key); -$flowName = $wf->getFlowName(); -$assigner = $wf->getAssignerList(); -$assign_status = $wf->getAssignStatus($assigner); -//表單數據 -#客戶表 -#客戶表 -#1.電梯品牌選項 -$sql = "select code_name value ,content label from code where field_name='elevator_brand'"; -$elevator_brand_opt = DB::result($sql); -#2.保養方式 -$sql = "select code_name value ,content label from code where field_name='maintain_kind'"; -$maintain_kind_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 code_name value ,content label from code where field_name='payment_kind'"; -$payment_kind_opt = DB::result($sql); -#5.契約性質 -$sql = "select code_name value ,content label from code where field_name='contract_kind'"; -$contract_kind_opt = DB::result($sql); -#6.是否贈送M1 -$is_m1_bundle_opt = [ - ['label' => '是', 'value' => 'Y'], - ['label' => '否', 'value' => 'N'] -]; -#7.機種 -$sql = "select code_name value ,content label from code where field_name='fp_kind'"; -$fp_kind_opt = DB::result($sql); -$table = 'con_maintance_examine_apply'; -#可編輯的列 -$editableColumn = [ - 'apply_key' => [ - 'label' => "評審單號", "value" => "$apply_key", "tag" => 'text', - 'attr' => [ - 'readonly=true ', - 'class' => 'form-control form-control-sm' - ] - ], - 'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']], - 'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'num' => ['label' => "數量", "value" => "", "tag" => 'number', 'attr' => ['required', 'min=1', 'class' => 'form-control form-control-sm']], - 'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $maintain_kind_opt], - 'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $contract_kind_opt], - 'introducer' => ['label' => "介紹人", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - - // 'platform_company' => ['label' => "加盟公司名稱", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - // 'platforom_company_tel' => ['label' => "加盟公司電話", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt], - -]; -$where = " and apply_key='$apply_key'"; - -$sql = "SELECT * FROM $table where 1=1 $where ORDER BY apply_key"; -$data = []; -list($data) = DB::result($sql); - -#電梯詳細資料 -$con_maintance_examine_clear_columm = [ - 'register_code' => ['label' => "電梯許可證代碼", "value" => "", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', 'class' => 'form-control form-control-sm']], - //'elevator_brand' => ['label' => "品牌", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'elevator_brand[]', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'elevator_kind' => ['label' => "電梯類型", "value" => "", "tag" => 'select', 'attr' => ['name' => 'elevator_kind[]', 'required', 'colspan' => 2, 'class' => 'form-control form-control-sm'], 'options' => $elevator_kind_opt], - 'spec' => ['label' => "規格型號", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'spec[]', 'class' => 'form-control form-control-sm'], 'options' => $fp_kind_opt], - 'weight' => ['label' => "載重(KG)", "value" => "", "tag" => 'number', 'attr' => ['name' => 'weight[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'speed' => ['label' => "速度(m/min)", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed[]', 'min=0', 'required', 'class' => 'form-control form-control-sm']], - //'stop' => ['label' => "停數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'stop[]', 'class' => 'form-control form-control-sm']], - 'floors' => ['label' => "層數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'floors[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'persons' => ['label' => "人乘", "value" => "", "tag" => 'number', 'attr' => ['name' => 'persons[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - - 'maintain_times' => ['label' => "保養次數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_times[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_months' => ['label' => "保養月數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_months[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_period' => ['label' => "保養周期", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt], - - - // 'elevator_num' => ['label' => "臺數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'brand_num[]', 'class' => 'form-control form-control-sm']], - 'useful_years' => ['label' => "竣工檢查年度", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'required', 'name' => 'useful_years[]', 'class' => 'form-control form-control-sm']], - 'last_check_date' => ['label' => "上次年檢日期", "value" => "", "tag" => 'date', 'attr' => ['required', 'name' => 'last_check_date[]', 'colspan' => 2, 'type' => 'date', 'class' => 'form-control form-control-sm']], - //'speed_governors_check_expense' => ['label' => "限速器校驗費", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed_governors_check_expense[]', 'class' => 'form-control form-control-sm']], - // 'service_expense' => ['label' => "服務費", "value" => "", "tag" => 'text', 'attr' => ['required', 'name' => 'service_expense[]', 'class' => ' form-control form-control-sm ']], - // 'commission_expense' => ['label' => "分成費(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'commission_expense[]', 'class' => 'form-control form-control-sm']], - // 'management_expense' => ['label' => "管理費(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'management_expense[]', 'class' => 'form-control form-control-sm']], - 'annual_survey_expense' => ['label' => "年檢費用(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'annual_survey_expense[]', 'colspan' => 2, 'class' => 'date form-control form-control-sm ']], - //'service_expense' => ['label' => "服務費", "value" => "", "tag" => 'text', 'attr' => ['required', 'name' => 'service_expense[]', 'class' => ' form-control form-control-sm ']], - 'maintain_times' => ['label' => "保養次數", "tag" => 'number', 'attr' => ['name' => 'maintain_times[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_months' => ['label' => "保養月數", "tag" => 'number', 'attr' => ['name' => 'maintain_months[]', "value" => "12", 'min=12', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_period' => ['label' => "保養周期", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt], - 'stand_price' => ['label' => "標準價格A(元/月)", "value" => "", "tag" => 'text', 'attr' => ['required', "readonly", 'colspan' => 2, 'name' => 'stand_price[]', 'class' => 'form-control form-control-sm']], - 'contract_price' => ['label' => "契約報價B(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'contract_price[]', 'class' => 'form-control form-control-sm']], - 'sold_price' => ['label' => "契約成交價C(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'sold_price[]', 'class' => 'form-control form-control-sm']], - - - 'mi_cost' => ['label' => "標準成本D(元/月)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true', 'disabled', 'colspan' => 2, 'name' => 'mi_cost[]', 'class' => 'form-control form-control-sm']], - 'discount' => ['label' => "折扣率E(%)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true', 'disabled', 'colspan' => 2, 'name' => 'mi_cost_rate[]', 'class' => 'form-control form-control-sm']], - 'gross_profit' => ['label' => "毛利率F(%)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true', 'disabled', 'colspan' => 2, 'name' => 'gross_profit[]', 'class' => 'form-control form-control-sm']], - -]; -$con_maintance_examine_clear = DB::result("SELECT register_code, - f_return_content('elevator_brand',elevator_brand) elevator_brand, - f_return_content('maintain_elevator_kind',elevator_kind) elevator_kind, - elevator_kind con_elevator_kind, - spec, - weight, - speed, - floors, - persons, - maintain_times, - maintain_months, - maintain_period, - is_m1_bundle, - - useful_years, - last_check_date, - speed_governors_check_expense, - service_expense, - commission_expense, - management_expense, - annual_survey_expense, - stand_price, - contract_price, - sold_price, - 0 mi_cost , - 0 discount, - 0 gross_profit - FROM - con_maintance_examine_clear - WHERE - 1 = 1 - AND apply_key='" . $apply_key . "' and cmstatus = 'Y'"); - -function base_url($url) -{ - return "https://www.masada.com.tw/static/" . $url; -} - - -?> - - - - - - - <?php echo $flowName; ?> - - - - - - - - - - - - - - - - - - - -
- -
-
- - - - -
-
-
-

保養契約價格審核單

-
-
- -
-
- 契約信息 -
-
- - "; - foreach ($editableColumn as $key => $val) { - // print_r($val['label']); - $j = (($i++) % 4); - $fieldVal = empty($data) ? "" : $data[$key]; - $fieldVal = empty($data) ? "" : $data[$key]; - - $_input = $val['tag'] == 'select' ? - FormHelper::select("$key", $val['options'], $fieldVal, $val['attr']) : - FormHelper::tag("label", $val['attr'], $fieldVal); - - // ""; - if ($i != 1 && $j == 0) { - echo " -
-
- "; - } - echo "
- " . $val['label'] . " -
-
- $_input -
- "; - } - echo "
"; - - ?> - -
-
- 洽商進度 -
-
- - -
-
- -
-
- 電梯詳細資料 -
- - - - - - empty($val['attr']['colspan']) - ? 1 : $val['attr']['colspan']], $val['label']); - - if ((++$j % 14) == 0) { - // if ($j == 12) echo ""; - - - echo ""; - } - } - - ?> - - - - - $val) { - $j = 0; - - $cmecRow = " "; - - foreach ($con_maintance_examine_clear_columm as $col => $col_def) { - $fieldVal = empty($val) ? "" : $val[$col]; - if ($col == 'mi_cost') { - $param = [ - 'elevator_type' => $val['con_elevator_kind'], - 'floors' => $val['floors'], - 'speed' => $val['speed'], - 'persons' => $val['persons'], - 'weight' => $val['weight'], - 'maintain_times' => $val['maintain_times'], - 'maintain_months' => $val['maintain_months'], - 'maintain_kind' => $data['maintain_kind'], - 'maintain_period' => $val['maintain_period'], - 'is_m1_bundle' => $val['is_m1_bundle'], - ]; - $mic = new MICalculator(); - $res = $mic->cal($param); - #MI報價 - $con_maintance_examine_clear[$key]['mi_cost'] = $fieldVal = $res['status'] == 'ok' ? $res['price'] : $res['message']; - $con_maintance_examine_clear[$key]['gross_profit'] = $val['gross_profit'] = "/"; //$fieldVal==0?0: (round(($val['sold_price'] - $val['mi_cost']) / $fieldVal, 2) * 100) . "%" - #扣率 - $val['discount'] = (100 * round($val['sold_price'] / $val['stand_price'], 4)) . "%"; - } - - $_input = FormHelper::tag("label", ['colspan' => empty($col_def['attr']['colspan']) ? 1 - : $col_def['attr']['colspan']], $fieldVal); - $cmecRow .= ""; - - $cmecRow = (++$j % 14 == 0) ? $cmecRow . "" : $cmecRow; - } - $tr_class = $tr_class == 'odd' ? "even" : "odd"; - echo $cmecRow . ""; - } - ?> - - - - - - - -
操作
$_input
-
- - - - - -
-
- -
- - - -
-
- -
-
-
- - -
- -
- - - - ' . $wf->getNodeDescriptions($as['flow_code']) . ' -
'; - $tmp_code = $as['flow_code']; - ?> -
"> -
- - - - -   - " . $as['position_name'] . " "; ?> - - - - - - -   - 申請人 "; ?> - 退回"; ?> - 會簽"; ?> - - - - 簽核於: - - - -
-
- -
- -
- -
- - - -
-
- -
-
-
- - - - - - - - - \ No newline at end of file diff --git a/wms/cont/review_apply_form.php b/wms/cont/review_apply_form.php deleted file mode 100644 index aac97e74..00000000 --- a/wms/cont/review_apply_form.php +++ /dev/null @@ -1,507 +0,0 @@ -user_id; -$apply_key = 'MB23060422'; -require_once './FormHelper.php'; -require_once './wf_common.php'; -#系统ID -$system_id = 'con'; -#流程ID -$flow_id = 'con01'; -#表单号 $form_id; -$form_id = ""; - -$wf = new WorkFlow($system_id, $flow_id, $form_id); -$wf->initWorkFlow($user_id); - -$form_key = $wf->flowContext->getFormKey(); - -#获取签核意见 -$assign_opinions = Assign::get_records($form_key); - -#会签部门意见 -$subflow_assign_opinions = SubflowManager::getCounterSignComments($form_key); - -$flowName = $wf->getFlowName(); -$assigner = $wf->getAssignerList(); -$assign_status = $wf->getAssignStatus($assigner); -$if_show_assign = true; - -#是否可会签 -$isSplitable = $wf->isSplitable(); - -//表单数据 -#客户表 -#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='maintain_kind'"; -$maintain_kind_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 code_name value ,content label from code where field_name='payment_kind'"; -$payment_kind_opt = DB::result($sql); -#5.合约性质 -$sql = "select code_name value ,content label from code where field_name='hope_contract_customer_kind'"; -$contract_kind_opt = DB::result($sql); - -#抓取有 - -$where = " and apply_key='$apply_key'"; -$sql = "SELECT * FROM con_maintance_examine_apply where 1=1 $where "; -$res_cmea = DB::result($sql); -$cmea = empty($res_cmea) ? [] : $res_cmea[0]; -#写入 con_maintance_review_apply -#获取评审单号 -//$cmea['payment_kind']; //付款方式 -//月付 12; 季付 三月一次;半年付 6个月一次, 年付 12个月 -// -$insert_data = [ - 'apply_key' => $apply_key, - 'vol_no' => $cmea['vol_no'], - 'form_key' => $cmea, - 'address' => $cmea['address'], - 'case_name' => $cmea['case_name'], - 'num' => $cmea['num'], - 'brand' => $cmea['brand'], - 'customer' => $hope_contract['customer'], - 'salesman' => $hope_contract['salesman'], - 'progress_remark' => $hope_contract['progress_remark'], - 'platform_company' => empty(trim($hope_contract['common_platform_company'])) ? $hope_contract['sales_platform_company'] : $hope_contract['common_platform_company'], - 'platforom_company_tel' => empty(trim($hope_contract['common_platform_tel'])) ? $hope_contract['sales_platform_tel'] : $hope_contract['common_platform_tel'] - -]; -//var_dump($insert_data); -DB::insert_table('con_maintance_examine_apply', $insert_data); -// $ins_sql="INSERT INTO `adm824727563_db`.`hope_contract_customer` (`vol_no`, `customer_kind`, `num`, `case_name`, `customer`, -// `salesman`, `address`, `lm_name`, `lm_tel`, `pre_order_date`, `order_rate`, `visit_date`, `progress_remark`, `common_platform_lm`, `common_platform_tel`, -// `common_platform_company`, `sales_platform_lm`, `sales_platform_tel`, `sales_platform_company`, `is_strategic_customer`, -// `strategic_customer`, `brand`, `partya_end_date`, `created_at`, `creator`, `updated_at`) VALUES ('Q2305047', '1', '47', '辰富佳苑', '上海新桃源物业管理有限公司', 'P0053', '松江广富林路3939弄', '周总', '13482376166', '2023-06-30 00:00:00', '中', '2023-05-23 18:13:05', '该物业为国有企业,本次 拜访物业沈经理引荐周总。经过与周总交流要求我司进行投标,今天进公司注册云采购账号,等公示后进一步了解如何投标再与周总会面细谈。', NULL, NULL, NULL, NULL, NULL, NULL, 'N', NULL, '永大', '2023-06-30 00:00:00', '2023-05-25 10:15:31', 'P0053', '2023-05-29 14:22:35'); -// "; -$table = 'con_maintance_examine_apply'; -#可编辑的列 -$editableColumn = [ - 'apply_key' => [ - 'label' => "评审单号", "value" => "$apply_key", "tag" => 'text', - 'attr' => [ - 'readonly=true ', - 'class' => 'form-control form-control-sm' - ] - ], - 'vol_no' => ['label' => "卷号", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']], - //'form_key' => ['label' => "表单号", "value" => "", "tag" => 'text', 'attr'=>['class' => 'form-control form-control-sm' ]], - 'address' => ['label' => "现场地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'case_name' => ['label' => "现场名称", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'brand' => ['label' => "电梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'num' => ['label' => "电梯台数", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'salesman' => ['label' => "营业员", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'maintain_kind' => ['label' => "保养方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $maintain_kind_opt], - 'contract_begin_date' => ['label' => "合约期限开始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_end_date' => ['label' => "合约期限结束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'elevator_kind' => ['label' => "电梯类型", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $elevator_kind_opt], - 'contract_kind' => ['label' => "合约性质", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $contract_kind_opt], - 'platform_company' => ['label' => "加盟公司名称", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'platforom_company_tel' => ['label' => "加盟公司电话", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'stand_price' => ['label' => "标准价格(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'contract_price' => ['label' => "合约报价(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'sold_price' => ['label' => "合约成交价(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt], - 'commission_expense' => ['label' => "加盟分成费(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'management_expense' => ['label' => "我司管理费(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'annual_survey_expense' => ['label' => "年检费用(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'date form-control form-control-sm ']], - 'service_expense' => ['label' => "服务费", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => ' form-control form-control-sm ']], - // 'postgress_remark' => ['label' => "洽商进度", "value" => "", "tag" => 'text', 'attr'=>['class' => 'form-control form-control-sm' ]] - -]; -$vol_no = empty($_GET['vol_no']) ? "" : $_GET['vol_no']; -$where = " and apply_key='$apply_key'"; - -$sql = "SELECT * FROM $table where 1=1 $where ORDER BY vol_no"; -$data = []; -$data = DB::result($sql); - -#电梯详细资料 -$con_maintance_examine_clear_columm = [ - 'register_code' => ['label' => "电梯注册代码", "value" => "", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', 'class' => 'form-control form-control-sm']], - 'elevator_brand' => ['label' => "品牌", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'elevator_brand[]', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'spec' => ['label' => "规格型号", "value" => "", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'spec[]', 'class' => 'form-control form-control-sm']], - 'weight' => ['label' => "载重(KG)", "value" => "", "tag" => 'number', 'attr' => ['name' => 'weight[]', 'class' => 'form-control form-control-sm']], - 'speed' => ['label' => "速度(m/s)", "value" => "", "tag" => 'number', 'attr' => ['name' => 'speed[]', 'class' => 'form-control form-control-sm']], - 'stop' => ['label' => "停数", "value" => "", "tag" => 'number', 'attr' => ['name' => 'stop[]', 'class' => 'form-control form-control-sm']], - 'elevator_num' => ['label' => "台数", "value" => "", "tag" => 'number', 'attr' => ['name' => 'brand_num[]', 'class' => 'form-control form-control-sm']], - 'useful_years' => ['label' => "使用年限", "value" => "", "tag" => 'number', 'attr' => ['name' => 'useful_years[]', 'class' => 'form-control form-control-sm']], - 'last_check_date' => ['label' => "最近一次年检日期", "value" => "", "tag" => 'date', 'attr' => ['name' => 'last_check_date[]', 'colspan' => 2, 'type' => 'date', 'class' => 'form-control form-control-sm']], - 'speed_governors_check_expense' => ['label' => "限速器校验费", "value" => "", "tag" => 'number', 'attr' => ['name' => 'speed_governors_check_expense[]', 'class' => 'form-control form-control-sm']], -]; -$con_maintance_examine_clear = DB::result("SELECT " . implode(',', array_keys($con_maintance_examine_clear_columm)) . - " FROM con_maintance_examine_clear where 1=1 and apply_key='$apply_key' and cmstatus='Y' "); -$i = 0; -$cmecRow = " "; -foreach ($con_maintance_examine_clear_columm as $key => $val) { - $fieldVal = ""; - $_input = $val['tag'] == 'select' ? - FormHelper::select('', $val['options'], $fieldVal, $val['attr']) - : FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']); - // : ""; - $cmecRow .= "
$_input"; -} -$cmecRow .= ""; -function base_url($url) -{ - return "https://web.platform-cn.com/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(nextval('$seq_name'),2)) seq_no "); - - - return $seq_no; -} - - -?> - - - - - - - <?php echo $flowName; ?> - - - - - - - - - - - - - - - - - - - - -
- 流程: - - - -
- -
- -
-
- - - - -
-
-
-

保養合約價格審核單

-
-
- -
-
- 合约信息 -
-
- - "; - foreach ($editableColumn as $key => $val) { - $j = (($i++) % 4); - $fieldVal = empty($data) ? "" : $data[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 " -
-
- "; - } - echo "
- " . $val['label'] . " -
-
- $_input -
- "; - } - echo "
"; - - ?> - -
-
- 洽商进度 -
-
- - -
-
-
-
- 电梯详细资料 -
- - - - - - - - empty($val['attr']['colspan']) ? 1 : $val['attr']['colspan']], $val['label']); - //echo ""; - } - echo ""; - ?> - - - - - $val) { - $cmecRow = " "; - foreach ($con_maintance_examine_clear_columm as $col => $col_def) { - $fieldVal = empty($val) ? "" : $val[$col]; - $_input = $col_def['tag'] == 'select' ? - FormHelper::select($col, $col_def['options'], $fieldVal, $col_def['attr']) - : FormHelper::text($col, $fieldVal, $col_def['attr'], $col_def['tag']); - $cmecRow .= ""; - } - echo $cmecRow . ""; - } - ?> - -
" . $val['label'] . "操作
$_input
- -
- -
-
- 签核操作 -
-
- -
-
-
-
- 签核状态 -
-
- -
- -
- 下位签核者 -
-
- - -
-
- -
- -
-
-
- -
-
-
- - -
- -
- - - - ' . $wf->getNodeDescriptions($as['flow_code']) . ' -
'; - $tmp_code = $as['flow_code']; - ?> -
"> -
- - - - -   - " . $as['position_name'] . " "; ?> - - - - - - -   - 申请人 "; ?> - 退回"; ?> - 会签"; ?> - - - - 签核于: - - - -
-
- -
- -
- -
- - - -
-
- -
-
-
- - -
- - - - - - \ No newline at end of file diff --git a/wms/cont/sign_form.php b/wms/cont/sign_form.php deleted file mode 100644 index 428e3a88..00000000 --- a/wms/cont/sign_form.php +++ /dev/null @@ -1,577 +0,0 @@ -vol_no; -require_once './FormHelper.php'; -require_once '../cont/MICalculator.php'; - -require_once './wf_common.php'; -$flow = new Flow($form_key); -// 當前節點簽核開始 - -$wf = new WorkFlow($flow->system_id, $flow->flow_id, $flow->form_id, $form_key); -#獲取簽核意見 -$assign_opinions = Assign::get_records($form_key); -$flowName = $wf->getFlowName(); - -//表單數據 -#客戶表 -#1.電梯品牌選項 -$sql = "select code_name value ,content label from code where field_name='elevator_brand'"; -$elevator_brand_opt = DB::result($sql); -#2.保養方式 -$sql = "select code_name value ,content label from code where field_name='maintain_kind'"; -$maintain_kind_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 code_name value ,content label from code where field_name='payment_kind'"; -$payment_kind_opt = DB::result($sql); -#5.契約性質 -$sql = "select code_name value ,content label from code where field_name='contract_kind'"; -$contract_kind_opt = DB::result($sql); -#6.是否贈送M1 -$is_m1_bundle_opt = [ - ['label' => '是', 'value' => 'Y'], - ['label' => '否', 'value' => 'N'] -]; -#7.機種 -$sql = "select code_name value ,content label from code where field_name='fp_kind'"; -$fp_kind_opt = DB::result($sql); -$table = 'con_maintance_examine_apply'; -#可編輯的列 -$editableColumn = [ - 'apply_key' => [ - 'label' => "評審單號", "value" => "$apply_key", "tag" => 'text', - 'attr' => [ - 'readonly=true ', - 'class' => 'form-control form-control-sm' - ] - ], - 'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']], - 'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'num' => ['label' => "數量", "value" => "", "tag" => 'number', 'attr' => ['required', 'min=1', 'class' => 'form-control form-control-sm']], - 'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $maintain_kind_opt], - 'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $contract_kind_opt], - 'introducer' => ['label' => "介紹人", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - - 'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt], - -]; -$where = " and form_key='$form_key'"; - -$sql = "SELECT " . implode(',', array_keys($editableColumn)) . - " ,progress_remark FROM $table where 1=1 $where ORDER BY apply_key"; - -$data = []; -list($data) = DB::result($sql); - -#電梯詳細資料 -$con_maintance_examine_clear_columm = [ - 'register_code' => ['label' => "電梯註冊代碼", "value" => "", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', 'class' => 'form-control form-control-sm']], - //'elevator_brand' => ['label' => "品牌", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'elevator_brand[]', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt], - 'elevator_kind' => ['label' => "電梯類型", "value" => "", "tag" => 'select', 'attr' => ['name' => 'elevator_kind[]', 'required', 'colspan' => 2, 'class' => 'form-control form-control-sm'], 'options' => $elevator_kind_opt], - 'spec' => ['label' => "規格型號", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'spec[]', 'class' => 'form-control form-control-sm'], 'options' => $fp_kind_opt], - 'weight' => ['label' => "載重(KG)", "value" => "", "tag" => 'number', 'attr' => ['name' => 'weight[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'speed' => ['label' => "速度(m/min)", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed[]', 'min=0', 'required', 'class' => 'form-control form-control-sm']], - //'stop' => ['label' => "停數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'stop[]', 'class' => 'form-control form-control-sm']], - 'floors' => ['label' => "層數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'floors[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'persons' => ['label' => "人乘", "value" => "", "tag" => 'number', 'attr' => ['name' => 'persons[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - - 'maintain_times' => ['label' => "保養次數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_times[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_months' => ['label' => "保養月數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_months[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_period' => ['label' => "保養周期", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt], - - - // 'elevator_num' => ['label' => "臺數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'brand_num[]', 'class' => 'form-control form-control-sm']], - 'useful_years' => ['label' => "竣工檢查年度", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'required', 'name' => 'useful_years[]', 'class' => 'form-control form-control-sm']], - 'last_check_date' => ['label' => "上次年檢日期", "value" => "", "tag" => 'date', 'attr' => ['required', 'name' => 'last_check_date[]', 'colspan' => 2, 'type' => 'date', 'class' => 'form-control form-control-sm']], - //'speed_governors_check_expense' => ['label' => "限速器校驗費", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed_governors_check_expense[]', 'class' => 'form-control form-control-sm']], - // 'service_expense' => ['label' => "服務費", "value" => "", "tag" => 'text', 'attr' => ['required', 'name' => 'service_expense[]', 'class' => ' form-control form-control-sm ']], - // 'commission_expense' => ['label' => "分成費(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'commission_expense[]', 'class' => 'form-control form-control-sm']], - // 'management_expense' => ['label' => "管理費(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'management_expense[]', 'class' => 'form-control form-control-sm']], - //'annual_survey_expense' => ['label' => "年檢費用(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'annual_survey_expense[]', 'colspan' => 2, 'class' => 'date form-control form-control-sm ']], - //'service_expense' => ['label' => "服務費", "value" => "", "tag" => 'text', 'attr' => ['required', 'name' => 'service_expense[]', 'class' => ' form-control form-control-sm ']], - 'maintain_times' => ['label' => "保養次數", "tag" => 'number', 'attr' => ['name' => 'maintain_times[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_months' => ['label' => "保養月數", "tag" => 'number', 'attr' => ['name' => 'maintain_months[]', "value" => "12", 'min=12', 'required', 'class' => 'form-control form-control-sm']], - 'maintain_period' => ['label' => "保養周期", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']], - 'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt], - 'stand_price' => ['label' => "標準價格(元/月)", "value" => "", "tag" => 'text', 'attr' => ['required', "readonly", 'colspan' => 2, 'name' => 'stand_price[]', 'class' => 'form-control form-control-sm']], - 'contract_price' => ['label' => "契約報價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'contract_price[]', 'class' => 'form-control form-control-sm']], - 'sold_price' => ['label' => "契約成交價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'sold_price[]', 'class' => 'form-control form-control-sm']], - - - 'sold_price' => ['label' => "契約成交價C(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'sold_price[]', 'class' => 'form-control form-control-sm']], - 'mi_cost' => ['label' => "標準成本D(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'mi_cost[]', 'class' => 'form-control form-control-sm']], - 'discount' => ['label' => "折扣率E(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'mi_cost_rate[]', 'class' => 'form-control form-control-sm']], - 'gross_profit' => ['label' => "毛利率F(%)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'gross_profit[]', 'class' => 'form-control form-control-sm']], - -]; -$con_maintance_examine_clear = DB::result("SELECT register_code, - f_return_content('elevator_brand',elevator_brand) elevator_brand, - f_return_content('maintain_elevator_kind',elevator_kind) elevator_kind, - elevator_kind con_elevator_kind, - spec, - weight, - speed, - floors, - persons, - maintain_times, - maintain_months, - maintain_period, - is_m1_bundle, - - useful_years, - last_check_date, - speed_governors_check_expense, - service_expense, - - stand_price, - contract_price, - sold_price, - 0 mi_cost , - 0 discount, - 0 gross_profit - FROM - con_maintance_examine_clear - WHERE - 1 = 1 - AND apply_key='" . $data['apply_key'] . "' and cmstatus='Y'"); - -#總臺數 -$count = count($con_maintance_examine_clear); -$total_sold_price = 0; -#總成交價 -#總標準價格 -$total_stand_price = 0; -#總標準成本 -foreach ($con_maintance_examine_clear as $val) { - $total_sold_price += $val['sold_price']; - $total_stand_price += $val['stand_price']; -} -$total_discount_rate = $total_sold_price == 0 ? 0 - : (100 * round($total_sold_price / $total_stand_price, 4)) . "%"; - -$wf->setFormData(['discount' => substr($total_discount_rate, 0, -1)]); -$assigner = $wf->getAssignerList(); -$assign_status = $wf->getAssignStatus($assigner); - - -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(nextval('$seq_name'),2)) seq_no "); - - - return $seq_no; -} - - -?> - - - - - - - - - - - - - - - - - - - - - - -
- 流程: - - - -
- -
- -
-
- - - ' /> - - - - -
-
-
-

保養契約價格審核單

-
-
- -
-
- 契約信息 -
-
- - "; - foreach ($editableColumn as $key => $val) { - $j = (($i++) % 4); - $fieldVal = empty($data) ? "" : $data[$key]; - - $_input = $val['tag'] == 'select' ? - FormHelper::select("$key", $val['options'], $fieldVal, $val['attr']) : - FormHelper::tag("label", $val['attr'], $fieldVal); - - //""; - if ($i != 1 && $j == 0) { - echo " -
-
- "; - } - echo "
- " . $val['label'] . " -
-
- $_input -
- "; - } - echo "
"; - - ?> - -
-
- 洽商進度 -
-
- - -
-
-
-
- 電梯詳細資料 -
- - - - - - empty($val['attr']['colspan']) - ? 1 : $val['attr']['colspan']], $val['label']); - - if ((++$j % 14) == 0) { - // if ($j == 12) echo ""; - - - echo ""; - } - } - - ?> - - - - - $val) { - $j = 0; - - $cmecRow = " "; - - foreach ($con_maintance_examine_clear_columm as $col => $col_def) { - $fieldVal = empty($val) ? "" : $val[$col]; - if ($col == 'mi_cost') { - $param = [ - 'elevator_type' => $val['con_elevator_kind'], - 'floors' => $val['floors'], - 'speed' => $val['speed'], - 'persons' => $val['persons'], - 'weight' => $val['weight'], - 'maintain_times' => $val['maintain_times'], - 'maintain_months' => $val['maintain_months'], - 'maintain_kind' => $data['maintain_kind'], - 'maintain_period' => $val['maintain_period'], - 'is_m1_bundle' => $val['is_m1_bundle'], - ]; - $mic = new MICalculator(); - $res = $mic->cal($param); - #MI報價 - $con_maintance_examine_clear[$key]['mi_cost'] = $fieldVal = ($res['status'] - == 'ok' ? $res['price'] : $res['message']); - $con_maintance_examine_clear[$key]['gross_profit'] = $val['gross_profit'] = "/"; //$fieldVal==0?0: (round(($val['sold_price'] - $val['mi_cost']) / $fieldVal, 2) * 100) . "%" - #扣率 - $val['discount'] = (100 * round($val['sold_price'] / $val['stand_price'], 4)) . "%"; - } - - $_input = FormHelper::tag("label", ['colspan' => empty($col_def['attr']['colspan']) ? 1 - : $col_def['attr']['colspan']], $fieldVal); - $cmecRow .= ""; - - $cmecRow = (++$j % 14 == 0) ? $cmecRow . "" : $cmecRow; - } - $tr_class = $tr_class == 'odd' ? "even" : "odd"; - echo $cmecRow . ""; - } - ?> - - - - - - - -
操作
$_input
-
- - - - - -
-
- -
- -
-
- 簽核意見 -
- -
- -
-
-
-
- 簽核狀態 -
-
- -
- -
- 下位簽核者 -
-
- - -
-
- -
- -
-
-
- -
-
-
- - -
- -
- - - - ' . $wf->getNodeDescriptions($as['flow_code']) . ' -
'; - $tmp_code = $as['flow_code']; - ?> -
"> -
- - - - -   - " . $as['position_name'] . " "; ?> - - - - - - -   - 申請人 "; ?> - 退回"; ?> - 會簽"; ?> - - - - 簽核於: - - - -
-
- -
- -
- -
- - - -
-
- -
-
-
- - - - - - - - - \ No newline at end of file diff --git a/wms/cont/sign_list.php b/wms/cont/sign_list.php deleted file mode 100644 index d31780b3..00000000 --- a/wms/cont/sign_list.php +++ /dev/null @@ -1,225 +0,0 @@ -'; - // print_r($sql_get); - // echo ''; - - $result = mysqli_query($link, $sql_get); - if ($result == false) { - die(mysqli_error($link)); - } - $res_get = mysqli_fetch_all(mysqli_query($link, $sql_get), MYSQLI_ASSOC); - - - foreach ($res_get as $key => $data) { - // 結案隱藏 - if ($data['flow_code'] !== 'Z') { - $test = $data['form_key']; - // $sql = "SELECT mid FROM pricereview_sign WHERE id = $test"; - // $result = mysqli_fetch_all(mysqli_query($link, $sql), MYSQLI_ASSOC); - // echo '
';
-            // print_r($result);
-            // echo '
'; - $id[] = $test; - } - } - $inClause = implode(',', $id); -} - - -#可編輯的列 -$editableColumn = [ - 'apply_key' => [ - 'label' => "評審單號", "value" => "", "tag" => 'text', - 'attr' => [ - 'readonly=true ', - 'class' => 'form-control form-control-sm' - ] - ], - 'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']], - 'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'num' => ['label' => "電梯臺數", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']], - 'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']], - 'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']], - 'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']], - 'platform_company' => ['label' => "加盟公司名稱", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - 'platforom_company_tel' => ['label' => "加盟公司電話", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']], - //'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt], - -]; -// 設置一個空陣列來放資料 -$data = array(); - -$salesman = empty($_GET['salesman']) ? $user_id : $_GET['salesman']; -//$where = " and salesman like '%'"; -$where = " and salesman = '$salesman'"; - -// 可瀏覽全部資料的部門 -$depart_arr = ["220"]; -$sql = "select department_id from account where accountid = '$user_id'"; -$res = mysqli_query($link, $sql); -$row = mysqli_fetch_row($res); -$user_department_id = $row[0]; -mysqli_free_result($res); -if (in_array($user_department_id, $depart_arr) || $user_id == "M0008" || $user_id == "M0012" || $user_id == "M0006" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "TEST04") $where = ""; - -// 電梯廠牌 -$elevator_brand_arr = []; -$sql = "select code_name ,content from code where field_name='elevator_brand'"; -$res = mysqli_query($link, $sql); -while ($row = mysqli_fetch_row($res)) { - $elevator_brand_arr[$row[0]] = $row[1]; -} -mysqli_free_result($res); -if (!empty($res_get)) { - $sql = "SELECT - apply_key, - vol_no, - address, - case_name, - brand , - num , - f_return_name(salesman) salesman, - f_return_content('maintain_kind',maintain_kind ) maintain_kind, - date_format(contract_begin_date,'%Y/%m/%d') contract_begin_date, - date_format(contract_end_date,'%Y/%m/%d') contract_end_date , - f_return_content('contract_kind',contract_kind ) contract_kind, - platform_company, - platforom_company_tel, - form_key, - - f_return_content('payment_kind',payment_kind ) payment_kind FROM $table WHERE form_key IN ($inClause) "; -} else { - $sql = "SELECT - apply_key, - vol_no, - address, - case_name, - brand , - num , - f_return_name(salesman) salesman, - f_return_content('maintain_kind',maintain_kind ) maintain_kind, - date_format(contract_begin_date,'%Y/%m/%d') contract_begin_date, - date_format(contract_end_date,'%Y/%m/%d') contract_end_date , - f_return_content('contract_kind',contract_kind ) contract_kind, - platform_company, - platforom_company_tel, - form_key, - - f_return_content('payment_kind',payment_kind ) payment_kind FROM $table - where 1=1 $where ORDER BY vol_no"; -} -// echo $sql; -$data = mysqli_query($link, $sql); -// echo '
';
-// print_r($data);
-// echo '
'; -?> - -Please fill up the required field!

"; - } else { - header("Location:repair-index.php"); - } - } - -?> - - -
-
- - - - - - - - -
-

(契約)價審單查詢

-
- - - "; - foreach ($editableColumn as $key => $val) { - - echo ""; - } - echo ""; - // echo ""; - echo ""; - ?> - - - - - $val) { - if ($key == 'apply_key') { - echo ""; - } elseif ($key == 'brand') { - echo ""; - } else { - echo ""; - } - } - //list($signer)=DB::fields("); - //echo " select f_return_name(current_assigner) signer from subflow where form_key='". $row['form_key'] ."'"; ". (is_array($row['form_key'])?'': $row['form_key']) ." - list($signer) = mysqli_fetch_array(mysqli_query($link, "select max(f_return_name(current_assigner) ) signer from subflow where form_key='" . $row['form_key'] . "'")); - - echo ""; - - ?> - - - - -
" . $val['label'] . "是否結案刪除
" . $row[$key] . "" . (!empty($row[$key]) ? $elevator_brand_arr[$row[$key]] : "") . "" . $row[$key] . "" . (empty($signer) ? "結案" : "N") . "
-
- -There is no record!"; -endif; - -#代表結束連線 -mysqli_close($link); - -include "../footer.php"; - -?> \ No newline at end of file diff --git a/wms/cont/submit.php b/wms/cont/submit.php deleted file mode 100644 index ed2766af..00000000 --- a/wms/cont/submit.php +++ /dev/null @@ -1,79 +0,0 @@ -"; - echo "alert('請確認電梯資料或未選擇下位簽核者!');"; - echo "history.go(-1);"; - echo ""; - exit; -} - -//更新表单ConMaintanceExamineApplyModel -$cmea = new ConMaintanceExamineApplyModel(); -$apply_key = $request['apply_key']; -$cmea->update(['apply_key', $apply_key], array_diff_key($request, ['apply_key' => ''])); -//更新电梯列表 -if (!empty($request["reg_del"])) { - $register_code_del_arr = explode(",", rtrim($request["reg_del"], ",")); - foreach ($register_code_del_arr as $val) { - $sql = "UPDATE con_maintance_examine_clear SET cmstatus = 'D' WHERE apply_key = '$apply_key' AND register_code = '$val' AND cmstatus <> 'D'"; - DB::query($sql); - } -} -if (!empty($request['register_code']) && count($request['register_code']) > 0) { - $cmec = new ConMaintanceExamineClearModel(); - for ($i = 0; $i < count($request['register_code']); $i++) { - $data = [ - 'apply_key' => $request['apply_key'] - ]; - $cols = array_diff($cmec->fillable, ['apply_key']); - foreach ($cols as $col) { - $data[$col] = empty($request[$col][$i]) ? '' : $request[$col][$i]; - if ($col == "annual_survey_expense") $data[$col] = '0.00'; - } - $cmec->create($data); - } -} - -//var_dump($_POST); -//var_dump($_GET); - -if ($tosign) { - #流程开始,var_dump($request); - $flow = new Flow($request['form_key']); - // 当前节点签核开始 - $wf = new WorkFlow($flow->system_id, $flow->flow_id, $flow->form_id, $request['form_key']); - $wf->setFormData($request); - $wf->submit($request['next_users'], $request['assign_status'], $request['assign_opinion']); - //当前节点签核结束 - $responses['flowName'] = $wf->getFlowName(); - $responses['form_key'] = $request['form_key']; - //var_dump($request); - #結案發通知給營業員 - if ($request['assign_status'] == 'F4') { - - list($salesman, $case_name) = DB::fields("select salesman ,case_name from con_maintance_examine_apply where apply_key='" . $apply_key . "' "); - $ins_notice_sql = "INSERT INTO `notice` ( `kind`,`title`, `content`, `permission`) - VALUES ( '1', '契約價審單結案通知(" . $case_name . ")', '契約價審單結案通知(" . $case_name . ")', ' $salesman')"; - DB::query($ins_notice_sql); - // echo $ins_notice_sql; - } -} -echo ""; diff --git a/wms/cont/success.php b/wms/cont/success.php deleted file mode 100644 index 96c2a2f2..00000000 --- a/wms/cont/success.php +++ /dev/null @@ -1 +0,0 @@ -

成功提交返回待签

\ No newline at end of file diff --git a/wms/cont/t.php b/wms/cont/t.php deleted file mode 100644 index 180a88c8..00000000 --- a/wms/cont/t.php +++ /dev/null @@ -1,84 +0,0 @@ - 'A', - 'floors' => 7, - 'speed' => 1, - 'persons' => 6, - 'weight' => 1000, - 'maintain_times' => 1, - 'maintain_months' => 12, - 'maintain_kind' => 2, - 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 - 'is_m1_bundle' => 'N', -]; - -//货梯 -$param = [ - - 'elevator_type' => 'B', - 'floors' => 7, - 'speed' => 1, - 'persons' => 6, - 'weight' => 1000, - 'maintain_times' => 1, - 'maintain_months' => 12, - 'maintain_kind' => 2, - 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 - 'is_m1_bundle' => 'N', -]; - - -//病床梯 -$param = [ - - 'elevator_type' => 'C', - 'floors' => 28, - 'speed' => 1, - 'persons' => 6, - 'weight' => 1000, - 'maintain_times' => 2, //病床梯一月2次保养 - 'maintain_months' => 12, - 'maintain_kind' => 2, - 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 - 'is_m1_bundle' => 'N', -]; - -//无机房 -$param = [ - 'elevator_type' => 'D', - 'floors' => 3, - 'speed' => 1, - 'persons' => 6, - 'weight' => 1000, - 'maintain_times' => 1, //病床梯一月2次保养 - 'maintain_months' => 12, - 'maintain_kind' => 3, - 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 - 'is_m1_bundle' => 'N', -]; - - -//家用梯 -$param = [ - 'elevator_type' => 'E', - 'floors' => 3, - 'speed' => 1, - 'persons' => 6, - 'weight' => 1000, - 'maintain_times' => 1, //病床梯一月2次保养 - 'maintain_months' => 60, - 'maintain_kind' => 2, - 'maintain_period' => 1, //默认为1月1次, 2是为2月一次 - 'is_m1_bundle' => 'Y', -]; - -$mic = new MSCalculator(); -$price = $mic->cal($_GET); -echo json_encode($price); diff --git a/wms/cont/test.php b/wms/cont/test.php deleted file mode 100644 index 55f9873a..00000000 --- a/wms/cont/test.php +++ /dev/null @@ -1,174 +0,0 @@ - $regions['content'], - #当月件数 - 'd_item_cnt' => 0, - #当月台数 - 'd_mfg_cnt' => 0, - #直销件数 - 'z_item_cnt' => 0, - #直销台数 - 'z_mfg_cnt' => 0, - #平台件数 - 'p_item_cnt' => 0, - #平台台数 - 'p_mfg_cnt' => 0, - #台数合计 - 'mfg_total' => 0, - #件数合计 - 'item_total' => 0, - #营业人数 - 'persons' => 0, - #人均台数 - 'avg_mfg_total' => 0, - #人均件数 - 'avg_item_total' => 0, - ]; - #遍历大区下面所有分公司 - $res_branch = DB::result("select depart_no,depart_name from depart where regions='" . $regions['code_name'] . "' "); - foreach ($res_branch as $branch) { - #遍历分公司下面所有人 - $depart_data = []; - $res_salesman = DB::result("select employee_no,name from employee - where depart_no='" . $branch['depart_no'] . "' "); - $depart_data = [ - 'depart_name' => $branch['depart_name'], - - ]; - foreach ($res_salesman as $salesman) { - //当月预定成交台数 件数 - $d_item_cnt = $d_mfg_cnt = $z_item_cnt = $z_mfg_cnt = $p_item_cnt = $p_mfg_cnt = 0; - list($d_item_cnt, $d_mfg_cnt) = DB::fields("select count(vol_no) item_cnt ,sum(num) mfg_cnt - From hope_contract_customer where salesman='" . $salesman['employee_no'] . "' - and pre_order_date between DATE_FORMAT(concat('$yyyymm','01'),'%Y-%m-%d') - and LAST_DAY(STR_TO_DATE('$yyyymm', '%Y%m'))"); - // 直销 台数 件数 - list($z_item_cnt, $z_mfg_cnt) = DB::fields("select count(vol_no) z_item_cnt ,sum(num) - z_mfg_cnt From hope_contract_customer where salesman=''" . $salesman['employee_no'] . "' - and customer_kind='1'"); - // 平台 台数 件数 - list($p_item_cnt, $p_mfg_cnt) = DB::fields("select count(vol_no) p_item_cnt ,sum(num) - p_mfg_cnt From hope_contract_customer where salesman='" . $salesman['employee_no'] . "' - and customer_kind!='1' - "); - #当月件数 - $d_item_cnt = empty($d_item_cnt) ? 0 : $d_item_cnt; - #当月台数 - $d_mfg_cnt = empty($d_mfg_cnt) ? 0 : $d_mfg_cnt; - #直销件数 - $z_item_cnt = empty($z_item_cnt) ? 0 : $z_item_cnt; - #直销台数 - $z_mfg_cnt = empty($z_mfg_cnt) ? 0 : $z_mfg_cnt; - #平台件数 - $p_item_cnt = empty($p_item_cnt) ? 0 : $p_item_cnt; - #平台台数 - $p_mfg_cnt = empty($p_mfg_cnt) ? 0 : $p_mfg_cnt; - #台数合计 - $mfg_total = $z_mfg_cnt + $p_mfg_cnt; - #件数合计 - $item_total = $z_item_cnt + $p_item_cnt; - #营业人数 - $persons = 1; - #人均台数 - $avg_mfg_total = $z_mfg_cnt + $p_mfg_cnt; - #人均件数 - $avg_item_total = $z_item_cnt + $p_item_cnt; - - #部门数据 - $depart_data = [ - #当月件数 - 'd_item_cnt' => $depart_data['d_item_cnt'] + $d_item_cnt, - #当月台数 - 'd_mfg_cnt' => $depart_data['d_mfg_cnt'] + $d_mfg_cnt, - #直销件数 - 'z_item_cnt' => $depart_data['z_item_cnt'] + $z_item_cnt, - #直销台数 - 'z_mfg_cnt' => $depart_data['z_mfg_cnt'] + $z_mfg_cnt, - #平台件数 - 'p_item_cnt' => $depart_data['p_item_cnt'] + $p_item_cnt, - #平台台数 - 'p_mfg_cnt' => $depart_data['p_mfg_cnt'] + $p_mfg_cnt, - #台数合计 - 'mfg_total' => $depart_data['mfg_total'] + $mfg_total, - #件数合计 - 'item_total' => $depart_data['item_total'] + $item_total, - #营业人数 - 'persons' => $depart_data['persons'] + $persons, - #人均台数 $z_mfg_cnt + $p_mfg_cnt - 'avg_mfg_total' => ($depart_data['z_mfg_cnt'] + $z_mfg_cnt) / ($depart_data['persons'] + $persons), - #人均件数 - 'avg_item_total' => ($depart_data['z_item_cnt'] + $z_item_cnt) / ($depart_data['persons'] + $persons) - ]; - - - $region_data[$regions['code_name']] = [ - #当月件数 - 'd_item_cnt' => $region_data[$regions['code_name']]['d_item_cnt'] + $depart_data['d_item_cnt'], - #当月台数 - 'd_mfg_cnt' => $region_data[$regions['code_name']]['d_mfg_cnt'] + $depart_data['d_mfg_cnt'], - #直销件数 - 'z_item_cnt' => $region_data[$regions['code_name']]['z_item_cnt'] + $depart_data['z_item_cnt'], - #直销台数 - 'z_mfg_cnt' => $region_data[$regions['code_name']]['z_mfg_cnt'] + $depart_data['z_mfg_cnt'], - #平台件数 - 'p_item_cnt' => $region_data[$regions['code_name']]['p_item_cnt'] + $depart_data['p_item_cnt'], - #平台台数 - 'p_mfg_cnt' => $region_data[$regions['code_name']]['p_mfg_cnt'] + $depart_data['p_mfg_cnt'], - #台数合计 - 'mfg_total' => $region_data[$regions['code_name']]['mfg_total'] + $depart_data['mfg_total'], - #件数合计 - 'item_total' => $region_data[$regions['code_name']]['item_total'] + $depart_data['item_total'], - #营业人数 - 'persons' => $region_data[$regions['code_name']]['persons'] + $depart_data['persons'], - #人均台数 $z_mfg_cnt + $p_mfg_cnt - 'avg_mfg_total' => ($region_data[$regions['code_name']]['z_mfg_cnt']) - / ($region_data[$regions['persons']]), - #人均件数 - 'avg_item_total' => ($region_data[$regions['code_name']]['z_item_cnt']) - / ($region_data[$regions['persons']]), - - ]; - $depart_data['children'][] = [ - 'depart_name' => $salesman['name'], - #当月件数 - 'd_item_cnt' => $d_item_cnt, - #当月台数 - 'd_mfg_cnt' => $d_mfg_cnt, - #直销件数 - 'z_item_cnt' => $z_item_cnt, - #直销台数 - 'z_mfg_cnt' => $z_mfg_cnt, - #平台件数 - 'p_item_cnt' => $p_item_cnt, - #平台台数 - 'p_mfg_cnt' => $p_mfg_cnt, - #台数合计 - 'mfg_total' => $z_mfg_cnt + $p_mfg_cnt, - #件数合计 - 'item_total' => $z_item_cnt + $p_item_cnt, - #营业人数 - 'persons' => 1, - #人均台数 - 'avg_mfg_total' => $z_mfg_cnt + $p_mfg_cnt, - #人均件数 - 'avg_item_total' => $z_item_cnt + $p_item_cnt, - ]; - } - #大区资料 - if (empty($region_data[$regions['code_name']])) $region_data[$regions['code_name']] = []; - if ($region_data[$regions['code_name']]['children']) $region_data[$regions['code_name']]['children'] = []; - array_push($region_data[$regions['code_name']]['children'], $depart_data); - } - echo "
";
-    var_dump($region_data);
-}
diff --git a/wms/cont/wf_common.php b/wms/cont/wf_common.php
deleted file mode 100644
index 519d341f..00000000
--- a/wms/cont/wf_common.php
+++ /dev/null
@@ -1,20 +0,0 @@
- {
             repair_no: '',
             total_price: '',
             sign_date: '',
-            contract_status: ''
+            contract_status: '',
         },
         step: 1,
         isLoading: false,
@@ -874,16 +874,27 @@ const contract_edit = () => {
 
 }
 
-const bonsIndex = () => {
+const bonunsIndexTest = () => {
     return {
         data: {
             contract_no: 'Q23080067',
             client_type: '',
             facility_no: '',
-            bons_verson: '',
+            bonuns_verson: '',
             receiver: '',
             maintain_month: '',
-            maintain_price_toal: ''
+            maintain_price_total: '',
+            payDay: '',
+            bonusArr: [],
+            client_type: '',
+            manager: '',
+            bonus_type: '',
+            bouns_receiver: '',
+            bouns_amount: '',
+            dayDus: '',
+            bouns_regulation: '',
+            contract_manger: 'M0001',
+            user_id: user_id
         },
         step: 1,
         isLoading: false,
@@ -921,17 +932,29 @@ const bonsIndex = () => {
                 if (!this.customize) {
                     this.data.contract_no = res.data.BillNo;
                     this.data.facility_no = res.data.facility;
-                    this.data.bons_verson = res.data.bons_verson;
+                    this.data.bonuns_verson = res.data.bonuns_verson;
                     this.data.receiver = res.data.personId;
-                    this.data.maintain_price_toal = res.data.amount;
-                    this.data.bons_verson = 2;
+                    this.data.maintain_price_total = res.data.amount;
+                    this.data.bonuns_verson = 2;
                     this.data.maintain_month = res.data.maintain_month;
-                }
+                    this.data.payDay = res.data.payDay;
+                    axios.get('./api/getAccount.php?accountid=' + res.data.personId).then(res => {
+                        this.data.manager = res.data.manager;
+                    }).catch(err => {
+                        console.log(err);
+                    })
+                };
                 this.step = 2;
                 this.isLoading = false;
             }).catch(err => {
-
+                errorFn();
             })
+            // axios.get('./api/getAccount.php?accountid=' + this.data.receiver).then(res => {
+            //     console.log(res);
+            //     this.data.manager = res.result.manager;
+            // }).catch(err => {
+            //     console.log(err);
+            // })
         },
         preStepFn() {
             this.step = 1
@@ -940,10 +963,42 @@ const bonsIndex = () => {
             }
         },
         save() {
+            if (this.step == 3) {
+                const form = new FormData();
+                form.append('contract_no', this.data.contract_no);
+                form.append('facility_no', this.data.facility_no);
+                form.append('bonuns_verson', this.data.bonuns_verson);
+                form.append('user_id', this.data.user_id);
+                form.append('bonusArr', JSON.stringify(this.data.bonusArr));
+                axios.post('./api/insertBonus.php', form).then(res => {
+                    console.log(res.data);
+                }).catch(err => {
 
+                })
+            }
         },
         calBons() {
-            console.log('123');
+            console.log(this.step);
+            const form = new FormData();
+            form.append('contract_no', this.data.contract_no);
+            form.append('bonuns_verson', this.data.bonuns_verson);
+            form.append('client_type', this.data.client_type);
+            form.append('maintain_month', this.data.maintain_month);
+            form.append('maintain_price_total', this.data.maintain_price_total);
+            form.append('payDay', this.data.payDay);
+            form.append('receiver', this.data.receiver);
+            form.append('manager', this.data.manager);
+            axios.post('./api/postCalBouns.php', form).then(res => {
+                // console.log(res);
+                this.data.bonusArr = res.data.bonus_array;
+                console.log(this.data.bonusArr);
+                this.step = 3;
+                this.isLoading = false;
+            }).catch(err => {
+                console.log(err.response.data);
+                alert(err.response.data);
+                this.step = 2;
+            })
         },
         errorFn() {
             let msg = '';
@@ -954,4 +1009,13 @@ const bonsIndex = () => {
         },
 
     }
+}
+
+const bonunsIndex = () => {
+    return {
+        data: {
+
+        },
+        step: 1,
+    }
 }
\ No newline at end of file
diff --git a/wms/contract/option/option2.xlsx b/wms/contract/option/option2.xlsx
index 4cf1f87c1b00e5f426ba55fc3ad6a4c1328d4a39..8f9a57a52549bb1ca7be05b3cc3c2abb6d72e843 100644
GIT binary patch
delta 6009
zcmZ8l1yEdFlN~a_26uwX0E0u2;64Nh8r&^717UE>;O+wi*WeI>yGw#I5Ilt7K?fp`
z0D&d@@9y{Sf2&?q*XzEo>()K5`}En;ztpGJeg=F<4!{E70001HKmm`dy9)*YK#bWy
z&H4Z_pgAOfAB9%wR?OgbZt{@Bsavz|Ct(+4U;>}g@M@HZ(XOp++uJHs)+!v8>Cj%^
z^|kx3H<{Zu@;>}Ho#|?pV1#8LQFc=O0zI*RQ(#9OsXr)&$F>G+T={Y3-1sT5KcSH~
zvo;AO`!cC9O4({t%4oI9%u(sh(z`8-4=qLrj6V9r({?Y>uta}Xk!7!MI2p@XS<)w8
zzlVZDQ`cAmxV;YJSkXdYEkW0vN7E2wJwfWDU%ywZ|YK5Jh
zlz>WLFZk0C$pHeWH8Vkyrk>0^+JiyYd92zz(?N;x(G*|!Q8@7C1lT)~`h8zCF1f{1DY&xt}%krovD^q+}#{@ntZ7U(tqcUol`5&R1A3aZ%;9#qFiYTa5a@YENu8jKQO$QXoUuT*oW9+?BIGtE_ko7HdARVD&TEIj{*^zQuRxRe`tJ~XY4`~Mm-44C(>?7w1fA;+v
zwP~Ruh)VfhH_BT8v8Uc>iM6q*k#_LWC?%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O-?~ILB)`Jimj_OBnNA6MtW|$)VPioXlPbDG=CIXc-3szc8a+er
zUv!R{evwt=G@n-14$gfdEx?wPJR=r6L|@b6Ev)ab(&1Sn_xK&dujrS3R5>YwZe2&x
zh%o(N5y+YEL;a`Pwwla_zT1vIN|6t%PeJr=rR?2iqV2!AeSBEx(dkoUl6CCeQU4Vr
zo1_PFW)9uU@AgN-?~AcSo-E}dDr8iy`Tm=*2}JYus}28B2b-o@PEHIM81zMqI%XN?
zL2WoBuN3V^{y_=+~Ivu>`GCqCfzvK(!uK+Wbm-oC7OndaAEZhC?duU7B>ROa1#$fcK9Zm}9NcISBFF`&@z~2vdQ_`EpD(x|h
zz&sQxr|4IM7Hg+g*nN6LDPL|@Z_359P+;4*7S=}
zU@Im3)P#_i*vmXG^qiiLK<8KGkGJpFX6o+BWO#-;)jaMVK{sYQLMIaa>3yA=-GW|oH007zFH2tr-kV8OD)_>dw0AT#r
z{JYyC0058(LPjA&5C*0&;2*gD2TA|{`u}%?ffzYS%!qX67r^wOMk1(akX8KTy#GFC
z007DV({nKa06}h|zJ9@OFOVDpG)(_|3GnyA|67hoG66oO|DB+}-bL|$+kk5%LO=-v
VjvNzUA|(V60^olYPl5lD{0{>iG "ok", "err" => "", "errCode" => "");
-echo '123';
 /**
  * 表單列表
  */
diff --git a/wms/fun_global.php b/wms/fun_global.php
index cd4271b2..627fd90b 100644
--- a/wms/fun_global.php
+++ b/wms/fun_global.php
@@ -99,36 +99,37 @@ function pricereview_class($rate, $user_id, &$ret = [], $special_fee, $i = 0)
             return $ret;
             exit;
         } else {
-            // 若為第一層且使用者ID為區經理,直接訂好接下來的簽核人員並跳出。
-            if ($i == 0 && ($user_id == 'M0033' || $user_id == "M0137" || $user_id == 'M0029' || $user_id == 'M0054' || $user_id == "M0086")) {
-                $ret[1] = $user_id . ",,";
-                $ret[2] = "M0107,,<##>M0175,,";         // 業務部專員:M0175陳君敏、M0107許紓晴(第2關有多位審核人)
-                $ret[3] = "M0060,,";                    // 業務協理
-                if ($rate < 80 || $special_fee > 0) {
-                    $ret[4] = "M0006,,";    // 總經理
-                }
-                return $ret;
-                exit;
-            }
-            if ($row["manager"] != "M0060" && $row["manager"] != "M0006" && $row["manager"] != "M0008") {
-                // 新梯的部分 桃竹本該給陳家文,改為劉永德
-                if ($row["manager"] == 'M0029') {
-                    $ret[1] = "M0137,,";
-                    $i++;
-                    pricereview_class($rate, $row["manager"], $ret,  $special_fee, $i);
-                } else {
-                    $ret[1] = $row["manager"] . ",,";
-                    $i++;
-                    pricereview_class($rate, $row["manager"], $ret,  $special_fee, $i);
-                }
-            } else {
-                
-                $ret[2] = "M0107,,<##>M0175,,";         // 業務部專員:M0175陳君敏、M0107許紓晴(第2關有多位審核人)
-                $ret[3] = "M0060,,";                    // 業務協理
-                if ($rate < 80 || $special_fee > 0) {
-                    $ret[4] = "M0006,,";    // 總經理
-                }
+            // // 若為第一層且使用者ID為區經理,直接訂好接下來的簽核人員並跳出。
+            // if ($i == 0 && ($user_id == 'M0033' || $user_id == "M0137" || $user_id == 'M0029' || $user_id == 'M0054' || $user_id == "M0086")) {
+            //     $ret[1] = $user_id . ",,";
+            //     $ret[2] = "M0107,,<##>M0175,,";         // 業務部專員:M0175陳君敏、M0107許紓晴(第2關有多位審核人)
+            //     $ret[3] = "M0060,,";                    // 業務協理
+            //     if ($rate < 80 || $special_fee > 0) {
+            //         $ret[4] = "M0006,,";    // 總經理
+            //     }
+            //     return $ret;
+            //     exit;
+            // }
+            // if ($row["manager"] != "M0060" && $row["manager"] != "M0006" && $row["manager"] != "M0008") {
+            //     // 新梯的部分 桃竹本該給陳家文,改為劉永德
+            //     if ($row["manager"] == 'M0029') {
+            //         $ret[1] = "M0137,,";
+            //         $i++;
+            //         pricereview_class($rate, $row["manager"], $ret,  $special_fee, $i);
+            //     } else {
+            //         $ret[1] = $row["manager"] . ",,";
+            //         $i++;
+            //         pricereview_class($rate, $row["manager"], $ret,  $special_fee, $i);
+            //     }
+            // } else {
+            // $ret[1] = '';
+            // $ret[2] = "M0107,,<##>M0175,,";         // 業務部專員:M0175陳君敏、M0107許紓晴(第2關有多位審核人)
+            // $ret[2] = '';
+            $ret[3] = "M0060,,";                    // 業務協理
+            if ($rate < 80 || $special_fee > 0) {
+                $ret[4] = "M0006,,";    // 總經理
             }
+            // }
 
             return $ret;
         }
diff --git a/wms/mkt/pricereview-edit.php b/wms/mkt/pricereview-edit.php
index 3868a44f..fda6c9b4 100644
--- a/wms/mkt/pricereview-edit.php
+++ b/wms/mkt/pricereview-edit.php
@@ -653,6 +653,8 @@ foreach ($res as $data) {
             $('#btnadd3').click(function() {
                 $('#tb3 tr:last').prev().after($("tr[name='except_templ']").last().clone().find('input').val('').end());
                 $("tr[name='except_templ']").last().find('input[name=except_act]').val('I');
+                $('#tb3 tr:last').prev().find('td[name=Exclusions]').html('');
+
                 //$('#tb3 tr:last').prev().find('td').first().html($("tr[name='except_templ']").length);
                 //$('#tb3 tr:last').prev().find('td').eq(1).find('a').attr('id', $("tr[name='except_templ']").length);
             });
@@ -1020,12 +1022,14 @@ foreach ($res as $data) {
                     mnKindArr.push($(this).val());
                 })
                 $('#mn_kind_all').val(mnKindArr);
-                var mnSeatArr = [];
+                var nmExclusions = [];
+
                 $("td[name='Exclusions']").each(function() {
-                    exRelateFacilArr.push($(this).html());
+                    nmExclusions.push($(this).val());
                 })
-                $('#Exclusions_all').val(exRelateFacilArr);
-                var exSpecArr = [];
+                $('#Exclusions_all').val(nmExclusions);
+
+                var mnSeatArr = [];
                 $("select[name='mn_seat']").each(function() {
                     mnSeatArr.push($(this).val());
                 })