Browse Source

'合約入立(修理)進T8'

main
Cheng 1 year ago
parent
commit
44b04b4fa7
  1. 2
      prv/pricereview-record-submit.php
  2. 36
      wms/T8_APItest.php
  3. 157
      wms/contract-repair/api/putContractData.php
  4. 4
      wms/contract-repair/js/alpine.js
  5. 1
      wms/contract/api/postContractData.php
  6. 10
      wms/fun_global.php
  7. 4
      wms/mkt/pricereview-index.php
  8. 4
      wms/mkt/pricereview-record-submit.php
  9. 37
      wms/mkt/pricereview_renovate-check.php
  10. 41
      wms/mkt/pricereview_renovate-create.php
  11. 6
      wms/mkt/pricereview_renovate-edit.php
  12. 40
      wms/mkt/pricereview_renovate-index.php
  13. 2
      wms/mkt/pricereview_renovate-record-submit.php

2
prv/pricereview-record-submit.php

@ -1,3 +1,5 @@
<?php <?php
require_once "database.php"; require_once "database.php";
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") {

36
wms/T8_APItest.php

@ -12,42 +12,42 @@ echo "ii";
console.log(validation); console.log(validation);
// var corsurl = 'http://cors-anywhere.herokuapp.com/'; // var corsurl = 'http://cors-anywhere.herokuapp.com/';
var apiurl = 'https:127.0.0.1:780/twWebAPI/V1/SALINCOMEAPPLY/PostERPData'; var apiurl = 'https://erp.masada.com.tw:780/twWebAPI/V1/SALINCOMEAPPLY/PostERPData';
headerParam = { headerParam = {
CHI_Authorization: `${validation}`, CHI_Authorization: `${validation}`,
}; };
var body = [{ var body = [{
"name": "salIncomeApplyMaster", "name": "salIncomeApplyMaster",
"rows": [{ "rows": [{
"BillNo": "Z001", "BillNo": "B23100061",
"BillDate": 20160811, "BillDate": 20231220,
"OrgId": "1000", "OrgId": "1000",
"FOrgId": "1000", "FOrgId": "1000",
"TypeId": "RR", "TypeId": "RAS",
"BpOrgId": "1000", "BpOrgId": "1000",
"BizPartnerId": "C002", "BizPartnerId": "B23100061",
"CurrId": "RMB", "CurrId": "TWD",
"CurrOAmount": 1, "CurrOAmount": 1,
"CurrLAmount": 1, "CurrLAmount": 1,
"PersonId": "T001", "PersonId": "M0065",
"DtOrgId": "1000", "DtOrgId": "1000",
"DueToId": "C002", "DueToId": "B23100061",
"TaxId": "123", "TaxId": "ST005",
"CompId": "1000" "CompId": "1001"
}] }]
}, },
{ {
"name": "salIncomeApplyDetail", "name": "salIncomeApplyDetail",
"rows": [{ "rows": [{
"BillNo": "Z001", "BillNo": "B23100061",
"IncomeId": "F203", "IncomeId": "A40003",
"TaxId": "ST003", "TaxId": "ST005",
"RowCode": 1, "RowCode": 1,
"ItemType": "1", "ItemType": "1",
"SPrice": 50, "SPrice": 10000,
"SQuantity": 1, "SQuantity": 2,
"FromSourceTag": 0, "FromSourceTag": 0,
"FromBillNo": "123" "FromBillNo": ""
}] }]
} }
]; ];
@ -56,9 +56,9 @@ echo "ii";
type: 'POST', type: 'POST',
// url: `${corsurl}${apiurl}`, // url: `${corsurl}${apiurl}`,
url: `${apiurl}`, url: `${apiurl}`,
// dataType: 'json', dataType: 'json',
headers: headerParam, headers: headerParam,
// data: json, data: json,
// dataType: "json", // dataType: "json",
success: function(res) { success: function(res) {
console.log(res.Status); console.log(res.Status);

157
wms/contract-repair/api/putContractData.php

@ -6,7 +6,7 @@ ini_set('date.timezone', 'Asia/Taipei');
if (isset($_POST['contracttype']) && $_POST['contracttype'] == 'r' && isset($_POST["id"]) && $_POST['id'] != "") { if (isset($_POST['contracttype']) && $_POST['contracttype'] == 'r' && isset($_POST["id"]) && $_POST['id'] != "") {
try { try {
$create_date = date('Y-m-d H:i:s'); $create_date = date('Y-m-d H:i:s');
$repair_no = !empty($POST['repair_no']) ? $_POST['repair_no'] : null; $repair_no = !empty($_POST['repair_no']) ? $_POST['repair_no'] : null;
$contractno = !empty($_POST['contractno']) ? $_POST['contractno'] : null; $contractno = !empty($_POST['contractno']) ? $_POST['contractno'] : null;
$company = !empty($_POST['company']) ? $_POST['company'] : null; $company = !empty($_POST['company']) ? $_POST['company'] : null;
$taxid = !empty($_POST['taxid']) ? $_POST['taxid'] : null; $taxid = !empty($_POST['taxid']) ? $_POST['taxid'] : null;
@ -21,7 +21,7 @@ if (isset($_POST['contracttype']) && $_POST['contracttype'] == 'r' && isset($_PO
$fail_arr = []; $fail_arr = [];
// if (empty($repair_no)) $fail_arr[] = '號為必填'; // if (empty($repair_no)) $fail_arr[] = '號為必填';
if (empty($contractno)) $fail_arr[] = '合約號為必填'; // if (empty($contractno)) $fail_arr[] = '合約號為必填';
if (empty($company)) $fail_arr[] = '客戶名稱為必填'; if (empty($company)) $fail_arr[] = '客戶名稱為必填';
if (empty($taxid)) $fail_arr[] = '統一編號為必填'; if (empty($taxid)) $fail_arr[] = '統一編號為必填';
if (empty($facilityno)) $fail_arr[] = '電梯號為必填'; if (empty($facilityno)) $fail_arr[] = '電梯號為必填';
@ -35,7 +35,7 @@ if (isset($_POST['contracttype']) && $_POST['contracttype'] == 'r' && isset($_PO
echo json_encode($fail_arr); echo json_encode($fail_arr);
exit(); exit();
} }
// $conn->beginTransaction(); $conn->beginTransaction();
$sql = "UPDATE contract_r_signed_back SET $sql = "UPDATE contract_r_signed_back SET
repaireid = :repaireid,facilityno= :facilityno, invoice=:invoice, taxid=:taxid, address=:address,type=:type,contract_status=:contract_status,update_user=:update_user,update_date=:update_date repaireid = :repaireid,facilityno= :facilityno, invoice=:invoice, taxid=:taxid, address=:address,type=:type,contract_status=:contract_status,update_user=:update_user,update_date=:update_date
@ -56,135 +56,50 @@ if (isset($_POST['contracttype']) && $_POST['contracttype'] == 'r' && isset($_PO
// echo json_encode($sql); // echo json_encode($sql);
// exit; // exit;
$stmt->execute(); $stmt->execute();
t8Insert($_POST);
// header("HTTP/1.1 204 NO Content"); // header("HTTP/1.1 204 NO Content");
// $conn->commit(); $conn->commit();
} catch (PDOException $e) { } catch (PDOException $e) {
// $conn->rollback(); // $conn->rollback();
header("HTTPP/1.1 500 Internal Server Error"); header("HTTPP/1.1 500 Internal Server Error");
die('Error!:' . $e->getMessage()); die('Error!:' . $e->getMessage());
} }
} }
// if (isset($_POST['contractno']) && $_POST['contractno'] != "" && isset($_POST["id"]) && $_POST['id'] != "") {
// try {
// $created_at = date('Y-m-d H:i:s');
// $created_by = $_POST['user_id'];
// $id = $_POST["id"];
// $contract_no = !empty($_POST['contractno']) ? $_POST['contractno'] : null;
// $customer = !empty($_POST['customer']) ? $_POST['customer'] : null;
// $manager = !empty($_POST['manager']) ? $_POST['manager'] : null;
// $vat = !empty($_POST['vat']) ? $_POST['vat'] : null;
// $case_name = !empty($_POST['case_name']) ? $_POST['case_name'] : null;
// $linkman = !empty($_POST['linkman']) ? $_POST['linkman'] : null;
// $lm_tel = !empty($_POST['lm_tel']) ? $_POST['lm_tel'] : null;
// $address = !empty($_POST['address']) ? $_POST['address'] : null;
// $salesman = !empty($_POST['salesman']) ? $_POST['salesman'] : null;
// $qc = !empty($_POST['qc']) ? $_POST['qc'] : null;
// $deletefiles = !empty($_POST['deletefiles']) ? $_POST['deletefiles'] : null;
// $files_id = !empty($_POST['files_id']) ? $_POST['files_id'] : null;
// $files = !empty($_FILES['files']) ? $_FILES['files'] : null;
// $deletefilesArr = explode(',', $_POST['deletefiles']);
// $fail_arr = []; function t8Insert($data)
// if (empty($contract_no)) $fail_arr[] = '合約號為必填'; {
// if (empty($customer)) $fail_arr[] = '客戶名稱為必填'; require_once('../../contract/connt8.php');
// if (empty($manager)) $fail_arr[] = '負責人為必填'; $create_date = date('Y-m-dH-i-s');
// if (empty($vat)) $fail_arr[] = '統編/身分證為必填'; $repair_no = !empty($data['repair_no']) ? $data['repair_no'] : null; // 報價單號
// if (empty($case_name)) $fail_arr[] = '案名為必填'; $company = !empty($data['company']) ? $data['company'] : null; //立約人
// if (empty($linkman)) $fail_arr[] = '聯絡人為必填'; $repaireid = !empty($data['repaireid']) ? $data['repaireid'] : null; //維保人員
// if (empty($lm_tel)) $fail_arr[] = '聯絡人電話為必填'; $facilityno = !empty($data['facilityno']) ? $data['facilityno'] : null; // 電梯編號
// if (empty($address)) $fail_arr[] = '地址為必填'; $type = !empty($data['type']) ? $data['type'] : null; //工程進度
// if (empty($salesman)) $fail_arr[] = '營業員為必填'; $sign_date = !empty($data['sign_date']) ? $data['sign_date'] : null; //簽訂時間
// if (empty($qc)) $fail_arr[] = '請選擇QC或管檢'; $invoice = !empty($data['invoice']) ? $data['invoice'] : null; // 發票抬頭
// if (count($fail_arr) > 0) { $taxid = !empty($data['taxid']) ? $data['taxid'] : null; //統編
// header("HTTP/1.1 422 Unprocessable Entity"); $address = !empty($data['address']) ? $data['address'] : null; //工程地址
// echo json_encode($fail_arr); $contract_status = !empty($data['contract_status']) ? $data['contract_status'] : null;
// exit(); $user_id = !empty($_data['user_id']) ? $data['user_id'] : null;
// }
// $conn->beginTransaction(); $sign = str_replace("-", '', $sign_date);
$create = str_replace('-', '', $create_date);
// $sql_str = "UPDATE contract_m_signed_back SET contract_no=:contract_no, customer=:customer, manager=:manager, vat=:vat, case_name=:case_name, linkman=:linkman, lm_tel=:lm_tel, address=:address, salesman=:salesman, qc_official_type=:qc WHERE id = :id"; $sql = "INSERT INTO comBusinessPartner
// $stmt = $conn->prepare($sql_str); (BizPartnerId,BizPartnerName,BusinessAttr,CountryId,BizToDate,TaxNo,ContactAddress,CreatorId,CreateTime,BizPartnerTypeId)
// $stmt->bindParam(':contract_no', $contract_no); VALUES(:BizPartnerId,:BizPartnerName,1,'TW',99999999,:TaxNo,:ContactAddress,:CreatorId,:CreateTime,'10')";
// $stmt->bindParam(':customer', $customer); $stmt = $connT8->prepare($sql);
// $stmt->bindParam(':manager', $manager); $stmt->bindParam(':BizPartnerId', $repair_no); //報價單編號
// $stmt->bindParam(':vat', $vat); $stmt->bindParam(':BizPartnerName', $company);
// $stmt->bindParam(':case_name', $case_name); $stmt->bindParam(':TaxNo', $taxid);
// $stmt->bindParam(':linkman', $linkman); $stmt->bindParam(':ContactAddress', $address);
// $stmt->bindParam(':lm_tel', $lm_tel); $stmt->bindParam(':CreatorId', $user_id);
// $stmt->bindParam(':address', $address); $stmt->bindParam(':CreateTime', $create);
// $stmt->bindParam(':salesman', $salesman); $stmt->execute();
// $stmt->bindParam(':qc', $qc);
// $stmt->bindParam(':id', $id);
// $stmt->execute();
// if (!empty($deletefiles)) {
// $sql_str = "DELETE FROM contract_back_files WHERE id IN ($deletefiles)";
// $stmt = $conn->prepare($sql_str);
// $stmt->execute();
// }
// if (!empty($files)) {
// $englisharr = range('a', 'z');
// $files = $_FILES['files'];
// $newfiles = [];
// foreach ($files as $file) {
// $i = 0; //新陣列的索引編號
// foreach ($file as $key => $val) {
// $newfiles[$i]['name'] = $files['name'][$key];
// $newfiles[$i]['type'] = $files['type'][$key];
// $newfiles[$i]['tmp_name'] = $files['tmp_name'][$key];
// $newfiles[$i]['error'] = $files['error'][$key];
// $newfiles[$i]['size'] = $files['size'][$key];
// $i++;
// } //foreach 第2層 end
// }
// $max_size = 4096 * 4096; //設定允許上傳檔案容量的最大值(1M)
// $allow_ext = array('jpeg', 'jpg', 'png', 'JPG', 'JPEG', 'PNG', 'GIF'); //設定允許上傳檔案的類型
// $path = '../images/contracts/';
// if (!file_exists($path)) {
// mkdir($path);
// }
// $msg_result = ''; //負責接收所有檔案檢測後的回傳訊息
// $datetime = (string)date('YmdHis');
// $files_id = ($files_id !== null) ? $files_id : 'm' . $datetime; // 新梯=>m + 日期時間
// foreach ($newfiles as $key => $file) {
// $randNum = rand(1000, 9999);
// $randEnglish = $englisharr[rand(0, 25)];
// $file_name = 'm' . (string)date('YmdHis') . $randNum . $randEnglish . $randNum . $file['name'];
// $msg = upload_chk($file, $path, $max_size, $allow_ext, $file_name);
// if ($msg == 1) {
// $msg = '檔案傳送成功!';
// $sql_str = "INSERT INTO contract_back_files (files_id, file_name, file_mime, file_size, created_at, created_by) VALUES (:files_id, :file_name, :file_mime, :file_size, :created_at, :created_by)";
// $stmt = $conn->prepare($sql_str);
// $stmt->bindParam(':files_id', $files_id);
// $stmt->bindParam(':file_name', $file_name);
// $stmt->bindParam(':file_mime', $file['type']);
// $stmt->bindParam(':file_size', $file['size']);
// $stmt->bindParam(':created_at', $created_at);
// $stmt->bindParam(':created_by', $created_by);
// $stmt->execute();
// } else {
// throw new PDOException('檔案上傳失敗:' . $msg);
// }
// $msg_result .= '第' . ($key + 1) . '個上傳檔案的結果:' . $msg . '<br/>';
// $src_name = $path . $file['name'];
// if (file_exists($src_name)) {
// //副檔名
// $extname = pathinfo($src_name, PATHINFO_EXTENSION);
// //主檔名
// $basename = basename($src_name, '.' . $extname);
// }
// }
// } else {
// $files = null;
// }
// $conn->commit();
// } catch (PDOException $e) { $connT8->commit();
// $conn->rollback(); }
// header("HTTP/1.1 500 Internal Server Error");
// die('Error!:' . $e->getMessage());
// }
// }

4
wms/contract-repair/js/alpine.js

@ -328,7 +328,7 @@ const contractRepair = () => {
nextStepFn() { nextStepFn() {
if (this.data.contractno == '') return alert('合約號為必填') if (this.data.repair_no == '') return alert('合約號為必填')
this.isLoading = true this.isLoading = true
if (this.step == 1) { if (this.step == 1) {
this.getContractDate(); this.getContractDate();
@ -503,7 +503,7 @@ const contractInput = () => {
fail_arr: [], fail_arr: [],
nextStepFn() { nextStepFn() {
if (this.step == 1) { if (this.step == 1) {
if (this.data.repair_no == '') return alert('請輸入合約號'); if (this.data.contractno == '') return alert('請輸入合約號');
this.isLoading = true this.isLoading = true
this.getContractDate(); this.getContractDate();
} else if (this.step == 2) { } else if (this.step == 2) {

1
wms/contract/api/postContractData.php

@ -374,6 +374,7 @@ function T8insert($data, $facilityno)
$endDate = str_replace("-", '', $contract_end_date); $endDate = str_replace("-", '', $contract_end_date);
if ($contractno == '') { if ($contractno == '') {
echo 'Error'; echo 'Error';
exit;
} }
if (empty($result)) { if (empty($result)) {
// 若 客戶資料為空,新增一筆到 comCustomer // 若 客戶資料為空,新增一筆到 comCustomer

10
wms/fun_global.php

@ -129,13 +129,14 @@ function pricereview_renovate_class($rate, $user_id, $renovate_flag)
} }
} }
mysqli_free_result($res); mysqli_free_result($res);
$ret[2] = 'M0012';
if ($renovate_flag == "REN") { if ($renovate_flag == "REN") {
if ($rate < 80) $ret[3] = "M0008"; // 詹總 // $ret[2] = 'M0012';
if ($rate < 60) $ret[4] = "M0006"; // 總經理 if ($rate < 1000) $ret[3] = "M0008"; // 詹總
if ($rate < 75) $ret[4] = "M0006"; // 總經理
} else { } else {
// 全汰改 // 全汰改
if ($rate < 80) $ret[3] = "M0008"; // 詹總 if ($rate < 1000) $ret[3] = "M0008"; // 詹總
if ($rate < 75) $ret[4] = "M0006"; // 總經理 if ($rate < 75) $ret[4] = "M0006"; // 總經理
} }
@ -622,5 +623,4 @@ function collect_month($contractday)
} else { } else {
return 0; return 0;
} }
} }

4
wms/mkt/pricereview-index.php

@ -246,6 +246,10 @@ if ($data) :
} elseif ($data["status"] == "YS") { } elseif ($data["status"] == "YS") {
?> ?>
<a href="specsurvey-create.php?mid=<?= $data['id']; ?>&function_name=specsurvey&token=<?= $token; ?>" class="btn btn-danger btn-sm">填規調</a> <a href="specsurvey-create.php?mid=<?= $data['id']; ?>&function_name=specsurvey&token=<?= $token; ?>" class="btn btn-danger btn-sm">填規調</a>
<?php
} elseif ($data['status'] == 'YN') {
?>
<a href="specsurvey-create.php?mid=<?= $data['id']; ?>&function_name=specsurvey&token=<?= $token; ?>" class="btn btn-danger btn-sm">重填規調</a>
<?php <?php
} }
} }

4
wms/mkt/pricereview-record-submit.php

@ -1,6 +1,7 @@
<?php <?php
if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") {
//print_r($_POST);exit; print_r($_POST);
exit;
foreach ($_POST as $k => $v) { foreach ($_POST as $k => $v) {
$$k = htmlspecialchars(stripslashes(trim($v))); $$k = htmlspecialchars(stripslashes(trim($v)));
} }
@ -334,4 +335,3 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
echo "</script>"; echo "</script>";
} }
} }
?>

37
wms/mkt/pricereview_renovate-check.php

@ -358,28 +358,44 @@ $(function () {
$('button[name=status]').click(function() { $('button[name=status]').click(function() {
var itemNoArr = []; var itemNoArr = [];
$("input[name='item_no']").each(function(){ itemNoArr.push($(this).val()); }) $("input[name='item_no']").each(function() {
itemNoArr.push($(this).val());
})
$('#item_no_all').val(itemNoArr); $('#item_no_all').val(itemNoArr);
var itemPriceArr = []; var itemPriceArr = [];
$("input[name='item_price']").each(function(){ itemPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_price']").each(function() {
itemPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_price_all').val(itemPriceArr); $('#item_price_all').val(itemPriceArr);
var pvRateArr = []; var pvRateArr = [];
$("input[name='pv_rate']").each(function(){ pvRateArr.push($(this).val()); }) $("input[name='pv_rate']").each(function() {
pvRateArr.push($(this).val());
})
$('#pv_rate_all').val(pvRateArr); $('#pv_rate_all').val(pvRateArr);
var allocateArr = []; var allocateArr = [];
$("input[name='allocate']").each(function(){ allocateArr.push($(this).val()); }) $("input[name='allocate']").each(function() {
allocateArr.push($(this).val());
})
$('#allocate_all').val(allocateArr); $('#allocate_all').val(allocateArr);
var grossProfitArr = []; var grossProfitArr = [];
$("input[name='gross_profit']").each(function(){ grossProfitArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='gross_profit']").each(function() {
grossProfitArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#gross_profit_all').val(grossProfitArr); $('#gross_profit_all').val(grossProfitArr);
var grossProfitRateArr = []; var grossProfitRateArr = [];
$("input[name='gross_profit_rate']").each(function(){ grossProfitRateArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='gross_profit_rate']").each(function() {
grossProfitRateArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#gross_profit_rate_all').val(grossProfitRateArr); $('#gross_profit_rate_all').val(grossProfitRateArr);
var noteArr = []; var noteArr = [];
$("input[name='note']").each(function(){ noteArr.push($(this).val()); }) $("input[name='note']").each(function() {
noteArr.push($(this).val());
})
$('#note_all').val(noteArr); $('#note_all').val(noteArr);
var miFixArr = []; var miFixArr = [];
$("input[name='mi_fix']").each(function(){ miFixArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='mi_fix']").each(function() {
miFixArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#mi_fix_all').val(miFixArr); $('#mi_fix_all').val(miFixArr);
}); });
$('#btn_close').click(function() { $('#btn_close').click(function() {
@ -394,19 +410,24 @@ $(function () {
.container { .container {
width: 1350px; width: 1350px;
} }
.nextline { .nextline {
width: 100%; width: 100%;
height: 0; height: 0;
} }
.modal-dialog { .modal-dialog {
width: 1200px; width: 1200px;
} }
.modal-content { .modal-content {
height: 660px; height: 660px;
} }
.dollar-right { .dollar-right {
text-align: right; text-align: right;
} }
hr { hr {
border: 0; border: 0;
border-bottom: 1px dashed #ccc; border-bottom: 1px dashed #ccc;

41
wms/mkt/pricereview_renovate-create.php

@ -2,6 +2,15 @@
include "../header.php"; include "../header.php";
$vol_no = $_REQUEST["vol_no"]; // 從有望客戶過來:卷號 $vol_no = $_REQUEST["vol_no"]; // 從有望客戶過來:卷號
$id = $_GET['id'];
// $sql = "SELECT * FROM pricereview_main WHERE id = $id";
// $result1 = mysqli_query($link, $sql);
// if (!empty($result1)) {
// $sql = "UPDATE pricereview_main SET status = 'D' WHERE id = $id";
// $result = mysqli_query($link, $sql);
// }
// 營業員只建自己客戶的價審單 // 營業員只建自己客戶的價審單
$sql = "select pre_order_date, case_name from hope_elevator_customer where salesman = '$user_id' and vol_no = '$vol_no'"; $sql = "select pre_order_date, case_name from hope_elevator_customer where salesman = '$user_id' and vol_no = '$vol_no'";
@ -1311,32 +1320,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
*/ */
?> ?>
<form class="form-inline" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data"> <form class="form-inline" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data">
<!--
<div>
<label for="contractno">卷號</label>
<input type="text" name="contractno" id="contractno" maxlength="7" required>
</div>
<div>
<label for="person">營業員</label>
<input type="text" name="person" id="person">
</div>
<div>
<label for="company">客戶名稱</label>
<input type="text" name="company" id="company" required>
</div>
<div>
<label for="case_name">案件名稱</label>
<input type="text" name="case_name" id="case_name" required>
</div>
<div>
<label for="address">工地地址</label>
<input type="text" name="address" id="address" required>
</div>
<div>
<label for="compete">競爭對手</label>
<input type="text" name="compete" id="compete">
</div>
-->
<div class="table-responsive"> <div class="table-responsive">
<table id="tb1" class="table table-bordered"> <table id="tb1" class="table table-bordered">
<thead> <thead>
@ -2476,7 +2460,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
<input type="text" name="qty_total" id="qty_total" value="<?php echo $qty_total; ?>" readonly> <input type="text" name="qty_total" id="qty_total" value="<?php echo $qty_total; ?>" readonly>
</div> </div>
<div> <div>
<label for="special_fee">特殊費用</label> <label for="special_fee">服務費</label>
<input type="text" name="special_fee" id="special_fee" value="<?php if (isset($last_pr_arr["special_fee"])) echo number_format($last_pr_arr["special_fee"]); ?>"> <input type="text" name="special_fee" id="special_fee" value="<?php if (isset($last_pr_arr["special_fee"])) echo number_format($last_pr_arr["special_fee"]); ?>">
</div> </div>
<div> <div>
@ -2529,7 +2513,8 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
</div> </div>
<ul> <ul>
<li>業務員權限>=80%以上;<80-75%呈至業務協理審核<75%以下呈至總經理審核< /li> <li>營業權限>=85%以上;<85-80%呈至區處長審核<80%以下呈至總經理審核< /li>
</ul> </ul>
<div class="nextline"></div> <div class="nextline"></div>
<label for="attatch1">報價單</label> <label for="attatch1">報價單</label>

6
wms/mkt/pricereview_renovate-edit.php

@ -1,5 +1,4 @@
<?php <?php
phpinfo();
include "../header.php"; include "../header.php";
$id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.'); $id = isset($_GET['id']) ? $_GET['id'] : die('ERROR: Record ID not found.');
@ -2054,7 +2053,7 @@ foreach ($res as $data) {
<input type="text" name="qty_total" id="qty_total" readonly> <input type="text" name="qty_total" id="qty_total" readonly>
</div> </div>
<div> <div>
<label for="special_fee">特殊費用</label> <label for="special_fee">服務費</label>
<input type="text" name="special_fee" id="special_fee" value="<?php echo number_format($data["special_fee"]); ?>"> <input type="text" name="special_fee" id="special_fee" value="<?php echo number_format($data["special_fee"]); ?>">
</div> </div>
<div> <div>
@ -2103,9 +2102,8 @@ foreach ($res as $data) {
</tbody> </tbody>
</table> </table>
</div> </div>
<ul> <ul>
<li>業務員權限>=80%以上;<80-75%呈至業務協理審核<75%以下呈至總經理審核< /li> <li>營業員權限85%以上;85-80%呈至業務協理審核;80%以下呈至總經理審核。</li>
</ul> </ul>
<div class="nextline"></div> <div class="nextline"></div>
<label for="attatch1">報價單</label> <label for="attatch1">報價單</label>

40
wms/mkt/pricereview_renovate-index.php

@ -137,7 +137,7 @@ if ($data) :
?> ?>
<link rel="stylesheet" href="common.css"> <link rel="stylesheet" href="common.css">
<div style="overflow-x:auto; white-space:nowrap;"> <div style="overflow-x:auto; white-space:nowrap;">
<table id="table_index2" class="table table-striped table-bordered" style="width:100%"> <table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead> <thead>
<tr> <tr>
<th>項次</th> <th>項次</th>
@ -154,7 +154,8 @@ if ($data) :
<th>建檔時間</th> <th>建檔時間</th>
<th>功能</th> <th>功能</th>
<th>區經理</th> <th>區經理</th>
<th>工務副總</th> <th>服務助理</th>
<th>服務副總</th>
<th>總經理</th> <th>總經理</th>
<th>狀態</th> <th>狀態</th>
<th>合約書下載</th> <th>合約書下載</th>
@ -208,15 +209,30 @@ if ($data) :
<?php <?php
//if ($oneself && !($data["status"] == "YY" || $data["status"] == "YN")) { // 自己可以進行規調 //if ($oneself && !($data["status"] == "YY" || $data["status"] == "YN")) { // 自己可以進行規調
if ($oneself) { if ($oneself) {
// 重填價審只能有最新一筆,填規調只有最新一筆可以填。
$contractno = $data['contractno'];
$sql = "SELECT MAX(id),COUNT(*) FROM pricereview_main WHERE contractno = '$contractno' ORDER BY id DESC";
$result = mysqli_query($link, $sql);
$row = mysqli_fetch_row($result);
$maxContractID = $row[0];
$countContract = $row[1];
// echo '<pre>';
// print_r($maxContractID);
// echo '</pre>';
if ($data["status"] == "Y1") { if ($data["status"] == "Y1") {
?> ?>
<a href="pricereview_renovate-edit.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-primary btn-sm">修改</a> <a href="pricereview_renovate-edit.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-primary btn-sm">修改</a>
<a href="pricereview_renovate-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-secondary btn-sm" onClick="return confirm('Are you sure you want to delete?')">刪除</a> <a href="pricereview_renovate-delete.php?id=<?php echo $data['id']; ?>&<?php echo $token_link; ?>" class="btn btn-secondary btn-sm" onClick="return confirm('Are you sure you want to delete?')">刪除</a>
<?php <?php
} elseif ($data["status"] == "YS") { } elseif ($data["status"] == "YS" && $countContract == 0) {
?> ?>
<a href="specsurvey_renovate-create.php?mid=<?= $data['id']; ?>&function_name=specsurvey_renovate&token=<?= $token; ?>" class="btn btn-danger btn-sm">填規調</a> <a href="specsurvey_renovate-create.php?mid=<?= $data['id']; ?>&function_name=specsurvey_renovate&token=<?= $token; ?>" class="btn btn-danger btn-sm">填規調</a>
<?php <?php
} elseif ($data['status'] == "YN" && $data['id'] == $maxContractID) {
?>
<a href="pricereview_renovate-create.php?vol_no=<?= $data['contractno']; ?>&id=<?= $data['id'] ?>&function_name=pricereview_renovate&token=<?= $token; ?>" class="btn btn-danger btn-sm">重填價審</a>
<?php
} }
} }
?> ?>
@ -271,6 +287,24 @@ if ($data) :
//echo $str; //echo $str;
?> ?>
</td> </td>
<td>
<?php
$str = $uperson = $ustatus = $udtte = "";
if (!empty($sign2)) list($uperson, $ustatus, $udtte) = explode(",", $sign2);
if ($ustatus) {
if ($ustatus == "Y") $str = "<span class=\"glyphicon glyphicon-ok\" title=\"同意\"></span>";
elseif ($ustatus == "N") $str = "<span class=\"glyphicon glyphicon-ban-circle\" title=\"不同意\"></span>";
$str .= "<br>" . $accountname_arr[$uperson] . "<br>" . $udtte;
} else {
if ($sign_st == 2 && $sign_nt == $user_id && $data["status"] == "YS") {
$str = "<span class=\"glyphicon glyphicon-user\"></span>";
$str = "待簽核";
$str = "<a href=\"pricereview_renovate-check.php?st=2&id=" . $data["id"] . "&" . $para . "\" class=\"btn btn-primary btn-sm\">" . $str . "</a>";
} else $str = "--";
}
echo $str;
?>
</td>
<td> <td>
<?php <?php
$str = $uperson = $ustatus = $udtte = ""; $str = $uperson = $ustatus = $udtte = "";

2
wms/mkt/pricereview_renovate-record-submit.php

@ -1,4 +1,5 @@
<?php <?php
/** /**
* 沒有選擇M1/M4的-->全汰改 * 沒有選擇M1/M4的-->全汰改
*/ */
@ -346,4 +347,3 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
echo "</script>"; echo "</script>";
} }
} }
?>
Loading…
Cancel
Save