From e676526be4022e34fd51c96e10d879becb2f90d6 Mon Sep 17 00:00:00 2001 From: Cheng Date: Tue, 23 Jan 2024 17:56:42 +0800 Subject: [PATCH] =?UTF-8?q?0123=E6=96=B0=E6=A2=AF=E5=83=B9=E5=AF=A9?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/contract-repair/api/bpmAPI.php | 6 +- wms/contract/api/T8salIncomeApply.php | 32 ++ wms/contract/api/postContractData.php | 23 +- wms/contract/api/testT8API.php | 123 +---- wms/css/function.js | 738 +++++++++++++------------- wms/frame/api_getdata.php | 3 +- wms/mkt/pricereview-index.php | 77 ++- wms/mkt/pricereview-record-check.php | 7 +- workflow/lib/DB.php | 2 +- 9 files changed, 518 insertions(+), 493 deletions(-) diff --git a/wms/contract-repair/api/bpmAPI.php b/wms/contract-repair/api/bpmAPI.php index b6b686be..a6d9d76e 100644 --- a/wms/contract-repair/api/bpmAPI.php +++ b/wms/contract-repair/api/bpmAPI.php @@ -1,4 +1,6 @@ execute(); $result = $stmt->fetch(PDO::FETCH_ASSOC); // echo '
';
-// print_r(json_encode($result));
+// print_r($result);
 // echo '
'; -return json_encode($result); +echo json_encode($result, JSON_UNESCAPED_UNICODE); diff --git a/wms/contract/api/T8salIncomeApply.php b/wms/contract/api/T8salIncomeApply.php index b0f4e018..96246a7c 100644 --- a/wms/contract/api/T8salIncomeApply.php +++ b/wms/contract/api/T8salIncomeApply.php @@ -39,3 +39,35 @@ function T8API($data) curl_close($ch); } // T8API($data); + +function pending($user_id, $token) +{ + $api_url = 'localhost:3000/wms/frame/api_getdata'; + $data = [ + 'p' => 'pending', + 'token' => $token + ]; + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $api_url); // 设置请求的URL + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + // curl_setopt($ch, CURLOPT_HTTPHEADER, $header); + curl_setopt($ch, CURLOPT_POST, 1); // 使用 POST + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); + $response = curl_exec($ch); + if ($response === false) { + echo 'Curl error: ' . curl_error($ch); + } else { + $result = json_decode($response, true); + // 若 API 傳入失敗。 + if ($result['Status'] == 'Erroe') { + echo 'API傳入失敗,' . $result['ErrorMsg']; + return $result; + } else { + echo '
';
+            print_r($result);
+            echo '
'; + return $result; + } + } +} diff --git a/wms/contract/api/postContractData.php b/wms/contract/api/postContractData.php index 3b00d2a9..d9b9f8b8 100644 --- a/wms/contract/api/postContractData.php +++ b/wms/contract/api/postContractData.php @@ -524,29 +524,34 @@ function T8insert($data, $facilityno) // 分期代碼計算 $IncomeId = [ - 'A40006' => 1, - 'A40007' => 4, - 'A40003' => 12, - 'A40004' => 6, - 'A40005' => 2 + 'A40006' => 1, //年繳 + 'A40007' => 4, //季繳 + 'A40003' => 12, //月繳 + 'A40004' => 6, //雙月繳 + 'A40005' => 2 //半年繳 ]; //分幾期 => 總共保養月 / 分期月 $SQuantity = $elevator['maintain_months'] / $IncomeId[$payType]; // 依每台電梯去加入各個的付款項 - for ($i = 1; $i <= $IncomeId[$payType]; $i++) { + for ($i = 0; $i < $IncomeId[$payType]; $i++) { + // 計算分期款的收款月份 + $paymonth = $i * $SQuantity; + $payday = date('Y-m-d', strtotime("$date_1 + $paymonth months")); + $rows_data = [ "BillNo" => "$contractno", "IncomeId" => "$payType", "TaxId" => "ST005", - "RowCode" => $i, - "RowNo" => $i, + "RowCode" => $i + 1, + "RowNo" => $i + 1, "ItemType" => 1, "SPrice" => $elevator['sold_price'], "SQuantity" => $SQuantity, "ProjectId" => "$contractno", "FromSourceTag" => 0, - "CU_MaterialId" => "$facilityno[$index]" + "CU_MaterialId" => "$facilityno[$index]", + "CU_EstPayDate" => "$payday" ]; $salIncomeApplyDetail_rows[] = $rows_data; } diff --git a/wms/contract/api/testT8API.php b/wms/contract/api/testT8API.php index d9481e16..3718df5d 100644 --- a/wms/contract/api/testT8API.php +++ b/wms/contract/api/testT8API.php @@ -1,109 +1,14 @@ -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   
   
  
-
公式加載
-
-
-
-
    -
  • -

    -
  • -
  • -

    -
  • -
  • -

    -
  • -
-
-
-
  
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-      -
-
請選擇要上傳的文件
-
-
圖片上傳
-
-
-
-
- - - - - - - - - -
-
  
-
-
-
全選
刪除 -
-
添加行上移下移
-
批量導出批量導入
-
-
-
  
\ No newline at end of file +'; + print_r($date1); + echo ''; +} diff --git a/wms/css/function.js b/wms/css/function.js index 1d952871..f34e8971 100644 --- a/wms/css/function.js +++ b/wms/css/function.js @@ -1,369 +1,371 @@ -function tan(ty){ - alert('确定添加?'); - if(ty=='f'){ - var p= document.getElementById('facility'); - var newfacility='
\n' + - '
\n' + - ' \n' + - ' \n' + - '
\n' + - '\n' + - '
\n' + - ' \n' + - ' \n' + - '\n' + - '
\n' + - '\n' + - '
\n' + - ' \n' + - ' \n' + - '\n' + - '
\n' + - '\n' + - '
\n' + - ' \n' + - ' \n' + - '\n' + - '
\n' + - '
\n' + - '
\n' + - '
\n' + - ' \n' + - ' \n' + - '
\n' + - '\n' + - '
\n' + - ' \n' + - ' \n' + - '\n' + - '
\n' + - '\n' + - '
\n' + - ' \n' + - ' \n' + - '
\n' + - '\n' + - '
\n' + - ' \n' + - ' \n' + - '
\n' + - '\n' + - '
\n' + - '
\n' + - '
\n' + - ' \n' + - ' \n' + - '\n' + - '
\n' + - '\n' + - '
\n' + - ' \n' + - ' \n' + - '\n' + - '
\n' + - '\n' + - '\n' + - '\n' + - '
\n' + - ' \n' + - ' \n' + - '
\n' + - '\n' + - '
\n' + - ' \n' + - ' \n' + - '
\n' + - '\n' + - '
' - p.innerHTML+=newfacility; - - }else if(ty=='s'){ - var s= document.getElementById('schedule'); - var newschedule='
\n' + - '
\n' + - ' \n' + - ' \n' + - '
\n' + - '\n' + - '
\n' + - ' \n' + - ' \n' + - '
\n' + - '
\n' + - ' \n' + - ' \n' + - '\n' + - '
\n' + - '
\n' + - ' \n' + - ' \n' + - '
\n' + - '\n' + - '
\n' + - ' \n' + - ' \n' + - '
\n' + - '\n' + - '
' - s.innerHTML+=newschedule; - }else{ - alert('非法操作') - } -} - -function tijiao(){ - //作番号 - var facilitynoslist = []; - $(".facilitynos").each(function () { - facilitynoslist.push($(this).val()); - }); - console.log('11111'); - console.log(facilitynoslist); - console.log('22222'); - - console.log('数据'); - - - //重量 - var weightslist = []; - $(".weights").each(function () { - weightslist.push($(this).val()); - }); - //停数 - var numberofstopslist=[]; - $(".numberofstops").each(function () { - numberofstopslist.push($(this).val()); - }); - //楼层数 - var numberoffloorslist=[]; - $(".numberoffloors").each(function () { - numberoffloorslist.push($(this).val()); - }); - //开门方式 - var opentypeslist=[]; - $(".opentypes").each(function () { - opentypeslist.push($(this).val()); - }); - //速度 - var speedslist=[]; - $(".speeds").each(function () { - speedslist.push($(this).val()); - }); - //维护形态 - var repairtypeslist=[]; - $(".repairtypes").each(function () { - repairtypeslist.push($(this).val()); - }); - //地址 - var addressslist=[]; - $(".addresss").each(function () { - addressslist.push($(this).val()); - }); - //经度 - var longitudeslist=[]; - $(".longitudes").each(function () { - longitudeslist.push($(this).val()); - }); - //维度 - var latitudeslist=[]; - $(".latitudes").each(function () { - latitudeslist.push($(this).val()); - }); - //维护工号 - var repaireridslist=[]; - $(".repairerids").each(function () { - repaireridslist.push($(this).val()); - }); - //维护人员姓名 - var repairernameslist=[]; - $(".repairernames").each(function () { - repairernameslist.push($(this).val()); - }); - - //合约号 - var contractno = $('.contractno').val(); - //客户编号 - var customerid = $('.customerid').val(); - //建档人 - var creater = $('.creater').val(); - //创建时间 - var create_at = $('.create_at').val(); - var type = $('.type').val(); - var url = "facilityapi.php"; - - //提交创建 - $.ajax({ - method: 'post', - url: url, - data: { - facilitynos: JSON.stringify(facilitynoslist), - weights: JSON.stringify(weightslist), - numberofstops:JSON.stringify(numberofstopslist), - numberoffloors:JSON.stringify(numberoffloorslist), - opentypes:JSON.stringify(opentypeslist), - speeds:JSON.stringify(speedslist), - repairtypes:JSON.stringify(repairtypeslist), - addresss:JSON.stringify(addressslist), - longitudes:JSON.stringify(longitudeslist), - latitudes:JSON.stringify(latitudeslist), - repairerids:JSON.stringify(repaireridslist), - repairernames:JSON.stringify(repairernameslist), - type:type, - contractno:contractno, - customerid:customerid, - creater:creater, - create_at:create_at - }, - success: function (data) { - - var res=eval('('+data+')'); - if(res.code=='200'){ - window.location.href='custom-create-schedule.php?accountid='+customerid+'&contractno='+contractno; - }else{ - alert('添加失败'); - } - - - } - }); - - - -} - -function tijiaosch(){ - - //作番号 - var facilitynoslist = []; - $(".facilitynos").each(function () { - facilitynoslist.push($(this).val()); - }); - //保养套餐 - var combonoslist=[]; - $(".combonos").each(function () { - combonoslist.push($(this).val()); - }); - - //保养日期duedates - var duedateslist=[]; - $(".duedates").each(function () { - duedateslist.push($(this).val()); - }); - - //保养工号 - var repaireridslist=[]; - $(".repairerids").each(function () { - repaireridslist.push($(this).val()); - }); - //保养人姓名 - var repairernameslist=[]; - $(".repairernames").each(function () { - repairernameslist.push($(this).val()); - }); - - //合约号 - var contractno = $('.contractno').val(); - //建档人 - var creater = $('.creater').val(); - //创建时间 - var create_at = $('.create_at').val(); - var type = $('.type').val(); - var url = "scheduleapi.php"; - - //提交创建 - $.ajax({ - method: 'post', - url: url, - data: { - facilitynos: JSON.stringify(facilitynoslist), - combonos:JSON.stringify(combonoslist), - duedates:JSON.stringify(duedateslist), - repairerids:JSON.stringify(repaireridslist), - repairernames:JSON.stringify(repairernameslist), - type:type, - contractno:contractno, - creater:creater, - create_at:create_at - }, - success: function (data) { - var res=eval('('+data+')'); - if(res.code=='200'){ - window.location.href='index.php'; - }else{ - alert('添加失败,请检查数据'); - } - - } - }); - - - -} - -function show(id){ - //removeClass - var t = document.getElementById('account');//选取id为test的div元素 - t.style.display = 'none';// 隐藏选择的元素 - t.style.display = 'block';// 以块级样式显示 -} - -function login(){ - var account = $('.account').val(); - var password = $('.password').val(); - var url = "loginapi.php"; - $.ajax({ - method: 'post', - url: url, - data: { - account:account, - password:password - }, - success: function (data) { - console.log('返回的结果'); - res=eval("("+data+")"); - console.log(res); - console.log(window.location.host); - console.log(res.code); - if(res.code=='200'){ - var token=res.token; - var name=res.name; - var login=res.login; - var menu=res.menu; - //console.log(token); - //window.localStorage.setItem("token",token); - //window.localStorage.setItem("name",name); - //window.localStorage.setItem("login",login); - window.localStorage.setItem("menu_"+res.uid,menu); - window.location.href='index.php?token='+token; - }else{ - window.location.href='login.php?errno=1'; - } - - - } - }); - -} - -function settoken(v){ - window.localStorage.setItem("token",v); -} - -function gettoken(v){ - window.localStorage.getItem("token"); -} - -function tttt(){ - //alert('無權限操作'); - return "err"; +function tan(ty) { + alert('确定添加?'); + if (ty == 'f') { + var p = document.getElementById('facility'); + var newfacility = '
\n' + + '
\n' + + ' \n' + + ' \n' + + '
\n' + + '\n' + + '
\n' + + ' \n' + + ' \n' + + '\n' + + '
\n' + + '\n' + + '
\n' + + ' \n' + + ' \n' + + '\n' + + '
\n' + + '\n' + + '
\n' + + ' \n' + + ' \n' + + '\n' + + '
\n' + + '
\n' + + '
\n' + + '
\n' + + ' \n' + + ' \n' + + '
\n' + + '\n' + + '
\n' + + ' \n' + + ' \n' + + '\n' + + '
\n' + + '\n' + + '
\n' + + ' \n' + + ' \n' + + '
\n' + + '\n' + + '
\n' + + ' \n' + + ' \n' + + '
\n' + + '\n' + + '
\n' + + '
\n' + + '
\n' + + ' \n' + + ' \n' + + '\n' + + '
\n' + + '\n' + + '
\n' + + ' \n' + + ' \n' + + '\n' + + '
\n' + + '\n' + + '\n' + + '\n' + + '
\n' + + ' \n' + + ' \n' + + '
\n' + + '\n' + + '
\n' + + ' \n' + + ' \n' + + '
\n' + + '\n' + + '
' + p.innerHTML += newfacility; + + } else if (ty == 's') { + var s = document.getElementById('schedule'); + var newschedule = '
\n' + + '
\n' + + ' \n' + + ' \n' + + '
\n' + + '\n' + + '
\n' + + ' \n' + + ' \n' + + '
\n' + + '
\n' + + ' \n' + + ' \n' + + '\n' + + '
\n' + + '
\n' + + ' \n' + + ' \n' + + '
\n' + + '\n' + + '
\n' + + ' \n' + + ' \n' + + '
\n' + + '\n' + + '
' + s.innerHTML += newschedule; + } else { + alert('非法操作') + } +} + +function tijiao() { + //作番号 + var facilitynoslist = []; + $(".facilitynos").each(function () { + facilitynoslist.push($(this).val()); + }); + console.log('11111'); + console.log(facilitynoslist); + console.log('22222'); + + console.log('数据'); + + + //重量 + var weightslist = []; + $(".weights").each(function () { + weightslist.push($(this).val()); + }); + //停数 + var numberofstopslist = []; + $(".numberofstops").each(function () { + numberofstopslist.push($(this).val()); + }); + //楼层数 + var numberoffloorslist = []; + $(".numberoffloors").each(function () { + numberoffloorslist.push($(this).val()); + }); + //开门方式 + var opentypeslist = []; + $(".opentypes").each(function () { + opentypeslist.push($(this).val()); + }); + //速度 + var speedslist = []; + $(".speeds").each(function () { + speedslist.push($(this).val()); + }); + //维护形态 + var repairtypeslist = []; + $(".repairtypes").each(function () { + repairtypeslist.push($(this).val()); + }); + //地址 + var addressslist = []; + $(".addresss").each(function () { + addressslist.push($(this).val()); + }); + //经度 + var longitudeslist = []; + $(".longitudes").each(function () { + longitudeslist.push($(this).val()); + }); + //维度 + var latitudeslist = []; + $(".latitudes").each(function () { + latitudeslist.push($(this).val()); + }); + //维护工号 + var repaireridslist = []; + $(".repairerids").each(function () { + repaireridslist.push($(this).val()); + }); + //维护人员姓名 + var repairernameslist = []; + $(".repairernames").each(function () { + repairernameslist.push($(this).val()); + }); + + //合约号 + var contractno = $('.contractno').val(); + //客户编号 + var customerid = $('.customerid').val(); + //建档人 + var creater = $('.creater').val(); + //创建时间 + var create_at = $('.create_at').val(); + var type = $('.type').val(); + var url = "facilityapi.php"; + + //提交创建 + $.ajax({ + method: 'post', + url: url, + data: { + facilitynos: JSON.stringify(facilitynoslist), + weights: JSON.stringify(weightslist), + numberofstops: JSON.stringify(numberofstopslist), + numberoffloors: JSON.stringify(numberoffloorslist), + opentypes: JSON.stringify(opentypeslist), + speeds: JSON.stringify(speedslist), + repairtypes: JSON.stringify(repairtypeslist), + addresss: JSON.stringify(addressslist), + longitudes: JSON.stringify(longitudeslist), + latitudes: JSON.stringify(latitudeslist), + repairerids: JSON.stringify(repaireridslist), + repairernames: JSON.stringify(repairernameslist), + type: type, + contractno: contractno, + customerid: customerid, + creater: creater, + create_at: create_at + }, + success: function (data) { + + var res = eval('(' + data + ')'); + if (res.code == '200') { + window.location.href = 'custom-create-schedule.php?accountid=' + customerid + '&contractno=' + contractno; + } else { + alert('添加失败'); + } + + + } + }); + + + +} + +function tijiaosch() { + + //作番号 + var facilitynoslist = []; + $(".facilitynos").each(function () { + facilitynoslist.push($(this).val()); + }); + //保养套餐 + var combonoslist = []; + $(".combonos").each(function () { + combonoslist.push($(this).val()); + }); + + //保养日期duedates + var duedateslist = []; + $(".duedates").each(function () { + duedateslist.push($(this).val()); + }); + + //保养工号 + var repaireridslist = []; + $(".repairerids").each(function () { + repaireridslist.push($(this).val()); + }); + //保养人姓名 + var repairernameslist = []; + $(".repairernames").each(function () { + repairernameslist.push($(this).val()); + }); + + //合约号 + var contractno = $('.contractno').val(); + //建档人 + var creater = $('.creater').val(); + //创建时间 + var create_at = $('.create_at').val(); + var type = $('.type').val(); + var url = "scheduleapi.php"; + + //提交创建 + $.ajax({ + method: 'post', + url: url, + data: { + facilitynos: JSON.stringify(facilitynoslist), + combonos: JSON.stringify(combonoslist), + duedates: JSON.stringify(duedateslist), + repairerids: JSON.stringify(repaireridslist), + repairernames: JSON.stringify(repairernameslist), + type: type, + contractno: contractno, + creater: creater, + create_at: create_at + }, + success: function (data) { + var res = eval('(' + data + ')'); + if (res.code == '200') { + window.location.href = 'index.php'; + } else { + alert('添加失败,请检查数据'); + } + + } + }); + + + +} + +function show(id) { + //removeClass + var t = document.getElementById('account');//选取id为test的div元素 + t.style.display = 'none';// 隐藏选择的元素 + t.style.display = 'block';// 以块级样式显示 +} + +function login() { + var account = $('.account').val(); + var password = $('.password').val(); + var url = "loginapi.php"; + $.ajax({ + method: 'post', + url: url, + data: { + account: account, + password: password + }, + success: function (data) { + // console.log(data); + console.log('返回的结果'); + res = eval("(" + data + ")"); + // console.log(res); + // console.log(window.location.host); + // console.log(res.code); + if (res.code == '200') { + var token = res.token; + var name = res.name; + var login = res.login; + var menu = res.menu; + //console.log(token); + //window.localStorage.setItem("token",token); + //window.localStorage.setItem("name",name); + //window.localStorage.setItem("login",login); + window.localStorage.setItem("menu_" + res.uid, menu); + window.location.href = 'index.php?token=' + token; + } else { + window.location.href = 'login.php?errno=1'; + + } + + + } + }); + +} + +function settoken(v) { + window.localStorage.setItem("token", v); +} + +function gettoken(v) { + window.localStorage.getItem("token"); +} + +function tttt() { + //alert('無權限操作'); + return "err"; } \ No newline at end of file diff --git a/wms/frame/api_getdata.php b/wms/frame/api_getdata.php index c19b8758..cfcee966 100644 --- a/wms/frame/api_getdata.php +++ b/wms/frame/api_getdata.php @@ -22,7 +22,7 @@ */ $json = array("st" => "ok", "err" => "", "errCode" => ""); - +echo '123'; /** * 表單列表 */ @@ -220,3 +220,4 @@ try { } echo json_encode($json, JSON_UNESCAPED_UNICODE); +return json_encode($json, JSON_UNESCAPED_UNICODE); diff --git a/wms/mkt/pricereview-index.php b/wms/mkt/pricereview-index.php index 3b9a7557..0c00475f 100644 --- a/wms/mkt/pricereview-index.php +++ b/wms/mkt/pricereview-index.php @@ -2,7 +2,7 @@ include "../header.php"; // if($user_id == "M0107" || $user_id == "M0174" || $user_id == "M0225"){ - + // }else{ // echo "維護中.."; // exit; @@ -37,7 +37,7 @@ if (!empty($_GET['system_id']) && !empty($_GET['flow_id'])) { // echo '
';
     // print_r($sql_get);
     // echo '
'; - + // exit; $result = mysqli_query($link, $sql_get); if ($result == false) { die(mysqli_error($link)); @@ -93,6 +93,7 @@ if (!empty($res_get)) { $data = mysqli_query($link, $sql); $para = "function_name=pricereview&" . $token_link; + ?>