Browse Source

0123新梯價審更新

main
Cheng 1 year ago
parent
commit
e676526be4
  1. 6
      wms/contract-repair/api/bpmAPI.php
  2. 32
      wms/contract/api/T8salIncomeApply.php
  3. 23
      wms/contract/api/postContractData.php
  4. 123
      wms/contract/api/testT8API.php
  5. 738
      wms/css/function.js
  6. 3
      wms/frame/api_getdata.php
  7. 77
      wms/mkt/pricereview-index.php
  8. 7
      wms/mkt/pricereview-record-check.php
  9. 2
      workflow/lib/DB.php

6
wms/contract-repair/api/bpmAPI.php

@ -1,4 +1,6 @@
<?php
header("Access-Control-Allow-Origin: https://bpm.masada.com.tw");
require_once("../conn.php");
$sql = "SELECT * FROM account WHERE accountid = 'M0225'";
@ -7,7 +9,7 @@ $stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
// echo '<pre>';
// print_r(json_encode($result));
// print_r($result);
// echo '</pre>';
return json_encode($result);
echo json_encode($result, JSON_UNESCAPED_UNICODE);

32
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 '<pre>';
print_r($result);
echo '</pre>';
return $result;
}
}
}

23
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;
}

123
wms/contract/api/testT8API.php

@ -1,109 +1,14 @@
&nbsp;
<link rel="stylesheet" name="dynamicTableStyle" type="text/css" href="/sys/xform/designer/standardtable/tablestyle/tb_normal_lightweight/standardtable.css">
<table id="fd_3c93363caa751c" formdesign="landray" align="center" class="tb_normal_lightweight" style="width: 98%;" layout2col="undefined" fd_values="{id:&quot;fd_3c93363caa751c&quot;,label:&quot;主表&quot;,isDefault:&quot;true&quot;,tableStyle:&quot;{quot;pathProfixquot;:quot;sys/xform/designer/standardtable/tablestyle/tb_normal_lightweightquot;,quot;tbClassNamequot;:quot;tb_normal_lightweightquot;}&quot;}" fd_type="standardTable" tablestyle="{quot;pathProfixquot;:quot;sys/xform/designer/standardtable/tablestyle/tb_normal_lightweightquot;,quot;tbClassNamequot;:quot;tb_normal_lightweightquot;}">
<tbody>
<tr style="height: 30px;">
<td row="0" column="0" class="td_normal_title" style="width: auto; height: auto;">&nbsp;</td>
<td row="0" column="1" class="" style="">&nbsp;</td>
<td row="0" column="2">&nbsp;</td>
</tr>
<tr>
<td row="1" column="0">&nbsp;</td>
<td row="1" column="1">&nbsp;</td>
<td row="1" column="2">&nbsp;</td>
</tr>
<tr style="height: 30px;">
<td row="2" column="0" class="" style=""><label formdesign="landray" class="xform_new_address" style="display: inline-block; width: 166px;" fd_values="{id:&quot;fd_3c93374e32374e&quot;,width:&quot;120&quot;,_label_bind:&quot;false&quot;,label:&quot;&quot;,_label_bind_id:&quot;&quot;,_org_person:&quot;true&quot;,_orgType:&quot;ORG_TYPE_PERSON&quot;,new_addressCustomType:&quot;org&quot;,new_address_select_value_id:&quot;&quot;,new_address_select_value_name:&quot;&quot;}" fd_type="new_address"><input id="fd_3c93374e32374e" class="inputsgl" canshow="true" "="" thousandshow=" true" _readonly="false" style="width:120px" required="false" _required="false" summary="false" ismark="false" tablename="fd_3c93363caa751c" label="" businesstype="addressDialog" multiselect="false" orgtype="ORG_TYPE_PERSON" scope="11" readonly=""><label>&nbsp;<a style="">選擇</a></label></label></td>
<td row="2" column="1">&nbsp;</td>
<td row="2" column="2">&nbsp;</td>
</tr>
<tr style="height: 30px;">
<td row="3" column="0">
<div formdesign="landray" id="fd_3c9337572bd274" label="" _width="200" class="xform_formula_load" loadtype="" returntype="select" datatype="undefined" scale="0" thousandshow="undefined" displayformat="undefined" controlids="" expression_mode="notRow" fd_values="{id:&quot;fd_3c9337572bd274&quot;,_label_bind:&quot;false&quot;,label:&quot;&quot;,_label_bind_id:&quot;&quot;,width:&quot;200&quot;,loadType:&quot;&quot;,returnType:&quot;select&quot;,decimal:&quot;0&quot;}" fd_type="formula_calculation" style="display: inline-flex; width: 215px;"><label class="select_tag_left"><label class="select_tag_right"> <label class="select_tag_face" style="width: 100px;"> --- 請選擇 --- </label> </label></label> <a href="javascript:void(0);" style="white-space: nowrap;">公式加載</a></div>
<div formdesign="landray" id="fd_3c933771241e32" class="xform_dateFormat" canshow="true" tablename="fd_3c93363caa751c" label="" dateformat_mode="notRow" fd_values="{id:&quot;fd_3c933771241e32&quot;,width:&quot;200&quot;,_label_bind:&quot;false&quot;,label:&quot;&quot;,_label_bind_id:&quot;&quot;}" fd_type="dateFormat" style="display: inline-block; width: 219px;"><input type="text" class="inputsgl" readonly="" style="width: 200px;"></div>
<div formdesign="landray" style="display: inline-block; width: 100%; min-width: 400px;" fd_values="{id:&quot;fd_3c93377a0f1596&quot;,tableStyle:&quot;{quot;pathProfixquot;:quot;sys/xform/designer/standardtable/tablestyle/tb_normal_solidborder_radius_bgcolorquot;,quot;tbClassNamequot;:quot;tb_normal_solidborder_radius_bgcolorquot;}&quot;}" fd_type="stageDiagram" tablestyle="{quot;pathProfixquot;:quot;sys/xform/designer/standardtable/tablestyle/tb_normal_solidborder_radius_bgcolorquot;,quot;tbClassNamequot;:quot;tb_normal_solidborder_radius_bgcolorquot;}">
<div class="lui-flow-rotundity">
<ul class="lui-flow-rotundity-list">
<li><span class="spot"></span>
<p class="title"></p>
</li>
<li><span class="spot" style=""></span>
<p class="title"></p>
</li>
<li><span class="spot" style=""></span>
<p class="title"></p>
</li>
</ul>
</div>
</div>
</td>
<td row="3" column="1">&nbsp;</td>
<td row="3" column="2">&nbsp;</td>
</tr>
<tr>
<td row="4" column="0">
<table label="明細表1" id="fd_3c93375a6e8256" formdesign="landray" align="center" class="tb_normal" tablename="fd_3c93363caa751c" style="width: 100%;" data-multihead="false" width="100%" showindex="true" showrow="1" showstatisticrow="undefined" showcopyopt="undefined" dataentrymode="multipleRow" required="undefined" excelexport="undefined" excelimport="undefined" defaultfreezetitle="undefined" defaultfreezecol="undefined" showfold="undefined" layout2col="undefined" fd_values="{cell:&quot;6&quot;,_label_bind:&quot;false&quot;,label:&quot;明細表1&quot;,id:&quot;fd_3c93375a6e8256&quot;,width:&quot;100%&quot;,showRow:&quot;1&quot;,columnIndex:&quot;null&quot;}" fd_type="detailsTable">
<tbody>
<tr class="tr_normal_title" type="titleRow" style="height: 33px;">
<td row="0" column="0" align="center" class="td_normal_title" coltype="selectCol" style="width: 15px;"></td>
<td row="0" column="1" align="center" class="td_normal_title" coltype="noTitle" style="width: 25px; white-space: nowrap;"><label attach="fd_3c93375a6e8256">序號</label></td>
<td row="0" column="2" align="center" class="td_normal_title"></td>
<td row="0" column="3" align="center" class="td_normal_title"></td>
<td row="0" column="4" align="center" class="td_normal_title"></td>
<td row="0" column="5" align="center" class="td_normal_title" coltype="blankTitleCol" style="width: 48px;"></td>
</tr>
<tr type="templateRow">
<td row="1" column="0" align="center" coltype="selectCol" style="width: 15px;"><input type="checkbox" name="DocList_Selected"></td>
<td row="1" column="1" align="center" coltype="noTemplate" style="width: 25px;"><label attach="fd_3c93375a6e8256">1</label></td>
<td row="1" column="2" align="center"></td>
<td row="1" column="3" align="center"></td>
<td row="1" column="4" align="center"></td>
<td row="1" column="5" align="center" coltype="copyCol" style="width: 48px;">
<nobr><img class="copyIcon" src="style/img/icon_copy.png" title="复制行">&nbsp;&nbsp;<img class="delIcon" src="style/img/icon_del.png" title="刪除行">&nbsp;&nbsp;</nobr>
</td>
</tr>
<tr type="statisticRow">
<td row="2" column="0" align="center" coltype="selectCol" style="width: 15px;"></td>
<td row="2" column="1" align="center" coltype="noFoot" style="width: 25px;"><label attach="fd_3c93375a6e8256">&nbsp;</label></td>
<td row="2" column="2" align="center" class="" style="">
<div formdesign="landray" id="fd_3c933764473d64" enabledfiletype="" fdmulti="true" label="" required="false" isshowdownloadcount="true" othercannotdelete="false" allcannotdelete="false" slidedown="true" widthcontent="undefined" tablename="fd_3c93375a6e8256" fd_values="{id:&quot;fd_3c933764473d64&quot;,_label_bind:&quot;true&quot;,label:&quot;&quot;,_label_bind_id:&quot;&quot;}" fd_type="attachment" style="display: inline-block; width: 280px; text-align: left;"> <button onclick="return false;" class="btnopt" style="width: 71px; height: 25px;">上傳</button> <span style="padding-left:8px;display:inline-block">請選擇要上傳的文件</span></div>
<div formdesign="landray" id="fd_3c933766738938" fdmulti="false" hidepicname="false" label="" required="false" width="200" widthcontent="240" height="150" mobilepicdisplaythumb="true" class="lui_upload_img_box" tablename="fd_3c93375a6e8256" fd_values="{width:&quot;200&quot;,height:&quot;150&quot;,widthContent:&quot;240&quot;,id:&quot;fd_3c933766738938&quot;,_label_bind:&quot;true&quot;,label:&quot;&quot;,_label_bind_id:&quot;&quot;}" fd_type="docimg" style="display: inline-block; width: 240px;">
<div class="lui_upload_img_item lui_upload_img" style="width:100%;height:180px;margin: 0px;" align="center"><span class="lui_upload_img_txt" style="width:240px;height:180px;margin: 0px;"><i class="icon icon-plus" style="margin-top:45px"></i>圖片上傳</span></div>
</div>
<div formdesign="landray" id="fd_3c9337682f649c" style="display: inline-block; width: 39px;" fd_values="{id:&quot;fd_3c9337682f649c&quot;,_label_bind:&quot;false&quot;,label:&quot;&quot;,_label_bind_id:&quot;&quot;}" fd_type="hidden"><label title="隱藏字段" label="" style="background: url(&quot;style/img/hidden.png&quot;) no-repeat; width: 24px; height: 24px; display: inline-block;"></label></div>
<div formdesign="landray" id="fd_3c93376b1bdd94" fd_values="{id:&quot;fd_3c93376b1bdd94&quot;}" fd_type="right" style="border: 1px dotted orange; width: 100%; min-height: 18px; padding: 1px; height: auto;">
<div class="rightIconBar" style="background-color: red; height: 10px; width: 10px; position: relative; cursor: move;"></div>
<table class="righBar" cellpadding="1" style="border-collapse: collapse; border: none; display: none;">
<tbody>
<tr style="height: 18px;">
<td style="border: 1px solid red; background-color: rgb(251, 212, 180); width: 36px;"><button type="button" onmousedown="Designer_Control_Right_CancelBubbleFun(event);" class="modeCell" title="只讀" mode_g="view" mode_d="view" ondblclick="Designer_Control_Right_CancelBubbleFun(event);" style="float: left; cursor: pointer; width: 16px; height: 16px; background: url(&quot;style/img/right_icon.gif&quot;) 0px -48px no-repeat; border: 0px;" onclick="Designer_Control_Right_SetModeCellValue(this);">&nbsp;&nbsp;&nbsp;</button><button type="button" onmousedown="Designer_Control_Right_CancelBubbleFun(event);" class="defaultCell" title="隨默認權限" ondblclick="Designer_Control_Right_CancelBubbleFun(event);" style="float: right; cursor: pointer; width: 16px; height: 16px; background: url(&quot;style/img/right_icon.gif&quot;) 0px -80px no-repeat; border: 0px; display: none;" onclick="Designer_Control_Right_SetDefaultCellValue(this);">&nbsp;&nbsp;&nbsp;</button></td>
<td style="border: 1px solid red; background-color: rgb(251, 212, 180); word-break: keep-all; display: none;"><button type="button" onmousedown="Designer_Control_Right_CancelBubbleFun(event);" class="readerCell" title="未設置讀者" readerids="" readernames="" ondblclick="Designer_Control_Right_CancelBubbleFun(event);" style="cursor:pointer;width:16px;height:16px;background:url(style/img/right_icon.gif) no-repeat 0px -16px;border:0px;" onclick="Designer_Control_Right_SetReaderCellValue(this);">&nbsp;&nbsp;&nbsp;</button></td>
<td style="border: none; padding: 0px 2px 0px 0px;">&nbsp;<span ondblclick="Designer_Control_Right_CancelBubbleFun(event); Designer_Control_Right_ShowLabelEditor(this);" style="padding:0;margin:0;border:0;line-height:16px;">權限區段1</span></td>
</tr>
</tbody>
</table>
</div>
</td>
<td row="2" column="3" align="center">&nbsp;</td>
<td row="2" column="4" align="center">&nbsp;</td>
<td row="2" column="5" align="center" coltype="emptyCell" style="width: 48px;"><label attach="fd_3c93375a6e8256">&nbsp;</label></td>
</tr>
<tr type="optRow" class="tr_normal_opt">
<td row="3" column="0" align="center" coltype="optCol" colspan="6" style=""><label attach="fd_3c93375a6e8256" style="display:none;">&nbsp;</label>
<div name="tr_normal_opt_content" style="WIDTH: 100%; POSITION: relative; color:#fff;white-space: nowrap;">
<div name="tr_normal_opt_l" style="POSITION: absolute; LEFT: 0px; TOP: 0px">
<div style="display:inline-block; line-height: 20px; vertical-align: top;"><input style="position: relative; top: 6px;" type="checkbox" onclick="return false;"><span style="display:inline-block;position: relative;top:2px;margin-left:6px;">全選</span></div><span style="margin-left:15px; display:inline-block; line-height: 20px;"><span style="display:inline-block;width:20px;height:20px;background:url(style/img/normal_opt_sprite.png) no-repeat 0 0;background-position: 0 0;position: relative;top:2px;" "=""></span><span style=" display:inline-block;vertical-align: text-bottom;margin-left:6px;">刪除</span></span>
</div>
<div name="tr_normal_opt_c"><span style="display:inline-block; line-height: 20px;"><span style="display:inline-block;width:20px;height:20px;background:url(style/img/normal_opt_sprite.png) no-repeat 0 0;background-position: -20px 0;position: relative;top:2px;" title="添加行"></span><span style="display:inline-block;vertical-align: text-bottom;margin-left:6px;">添加行</span></span><span style="margin-left:15px; display:inline-block; line-height: 20px;"><span style="display:inline-block;width:20px;height:20px;background:url(style/img/normal_opt_sprite.png) no-repeat 0 0;background-position: -40px 0;position: relative;top:2px;" title="上移"></span><span style="display: inline-block; vertical-align: text-bottom; margin-left: 6px;">上移</span></span><span style="margin-left: 15px; display: inline-block; line-height: 20px;"><span style="display: inline-block; width: 20px; height: 20px; background: url(&quot;style/img/normal_opt_sprite.png&quot;) -60px 0px no-repeat; position: relative; top: 2px;" title="下移"></span><span style="display:inline-block;vertical-align: text-bottom;margin-left:6px;">下移</span></span></div>
<div name="tr_normal_opt_r" style="POSITION: absolute; RIGHT: 0px; TOP: 0px"><span name="excelExport" style="display: none; line-height: 20px;"><span style="display:inline-block;width:20px;height:20px;background:url(style/img/normal_opt_sprite.png) no-repeat 0 0;background-position: -100px 0; margin-right:6px;position: relative;top:2px;" "=""></span><span style=" display:inline-block;vertical-align: text-bottom;">批量導出</span></span><span name="excelImport" style="margin-left: 15px; display: none; line-height: 20px;"><span style="display:inline-block;width:20px;height:20px;background:url(style/img/normal_opt_sprite.png) no-repeat 0 0;background-position: -80px 0; margin-right:6px;position: relative;top:2px;" "=""></span><span style=" display:inline-block;vertical-align: text-bottom;">批量導入</span></span></div>
</div>
</td>
</tr>
</tbody>
</table>
</td>
<td row="4" column="1">&nbsp;</td>
<td row="4" column="2">&nbsp;</td>
</tr>
</tbody>
</table>
<?php
$date = Date('Y-m-d');
$date1 = Date('Y-m-d', strtotime("$date +1 months"));
$a = 1;
$b = 12 / $a;
for ($i = 0; $i < $b; $i++) {
$c = $i * $a;
$date1 = Date('Y-m-d', strtotime("$date + $c months"));
echo '<pre>';
print_r($date1);
echo '</pre>';
}

738
wms/css/function.js

@ -1,369 +1,371 @@
function tan(ty){
alert('确定添加?');
if(ty=='f'){
var p= document.getElementById('facility');
var newfacility='<div class="form-group">\n' +
' <div class="col-md-3">\n' +
' <label for="facilityno">作番号(必填)</label>\n' +
' <input class="form-control facilitynos" type="text" name="facilityno" id="facilityno" required>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="weight">重量(必填)</label>\n' +
' <input class="form-control weights " type="text" name="weight" id="weight" onkeyup="if(value<0)value=0;if(value.length>4)value=value.slice(0,4);value=value.replace(/^\\D*(\\d*(?:\\.\\d)?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="numberofstop">停数(必填)</label>\n' +
' <input class="form-control numberofstops" type="text" name="numberofstop" id="numberofstop" onkeyup="if(value<0)value=0;if(value.length>3)value=value.slice(0,3);value=value.replace(/^\\D*(\\d*(?:\\.\\d)?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3" >\n' +
' <label for="numberoffloor">楼层数(必填)</label>\n' +
' <input class="form-control numberoffloors" type="text" name="numberoffloor" id="numberoffloor" onkeyup="if(value<0)value=0;if(value.length>3)value=value.slice(0,3);value=value.replace(/^\\D*(\\d*(?:\\.\\d)?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div>\n' +
' </div>\n' +
' <div class="form-group">\n' +
' <div class="col-md-3" >\n' +
' <label for="opentype">开门方式(必填)</label>\n' +
' <Select class="form-control opentypes" name="opentype" id="opentype" required>\n' +
' <option selected="selected" disabled="disabled" style="display: none" value=""></option>\n' +
' <Option Value="CO">CO</Option>\n' +
' <Option Value="SO">SO</Option>\n' +
' <Option Value="CO-SO">CO-SO</Option>\n' +
' </Select>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="speed">速度(必填)</label>\n' +
' <input class="form-control speeds" type="text" name="speed" id="speed" onkeyup="if(value<0)value=0;if(value.length>4)value=value.slice(0,4);value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,1})?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div class="col-md-3">\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="repairtype">维修型态(必填)</label>\n' +
' <Select class="form-control repairtypes" name="repairtype" id="repairtype" required>\n' +
' <option selected="selected" disabled="disabled" style="display: none" value=""></option>\n' +
' <Option Value="A">定期保养</Option>\n' +
' <Option Value="B">单次保养</Option>\n' +
' <Option Value="C">单次维修</Option>\n' +
' </Select>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="address">地址</label>\n' +
' <input class="form-control addresss" type="text" name="address" id="address" >\n' +
' </div>\n' +
'\n' +
' </div>\n' +
' <div class="form-group">\n' +
' <div class="col-md-3">\n' +
' <label for="longitude">经度(必填)</label>\n' +
' <input class="form-control longitudes" type="text" name="longitude" id="longitude" onkeyup="if(value<0)value=0;if(value.length>11)value=value.slice(0,11);value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,7})?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="latitude">纬度(必填)</label>\n' +
' <input class="form-control latitudes" type="latitude" name="latitude" id="latitude" onkeyup="if(value<0)value=0;if(value.length>11)value=value.slice(0,11);value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,7})?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div>\n' +
'\n' +
'\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="repairerid">维修人员工号(必填)</label>\n' +
' <input class="form-control repairerids" type="text" name="repairerid" id="repairerid" required>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="repairername">维修人员姓名(必填)</label>\n' +
' <input class="form-control repairernames" type="text" name="repairername" id="repairername" required>\n' +
' </div>\n' +
'\n' +
' </div>'
p.innerHTML+=newfacility;
}else if(ty=='s'){
var s= document.getElementById('schedule');
var newschedule='<div class="form-group" >\n' +
' <div class="col-md-3">\n' +
' <label for="facilityno">作番号(必填)</label>\n' +
' <input class="form-control facilitynos" type="text" id="facilityno" required>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-2">\n' +
' <label for="combono">保养套餐编号(必填)</label>\n' +
' <input class="form-control combonos" type="text" id="combono" required>\n' +
' </div>\n' +
' <div class="col-md-2">\n' +
' <label for="duedate">应保养日期(必填)</label>\n' +
' <input class="form-control duedates" type="text " id="duedate" required>\n' +
'\n' +
' </div>\n' +
' <div class="col-md-2">\n' +
' <label for="repairerid">保养人员工号(必填)</label>\n' +
' <input class="form-control repairerids" type="text" id="repairerid" required>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="repairername">保养人员姓名(必填)</label>\n' +
' <input class="form-control repairernames" type="text" id="repairername" required>\n' +
' </div>\n' +
'\n' +
' </div>'
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 = '<div class="form-group">\n' +
' <div class="col-md-3">\n' +
' <label for="facilityno">作番号(必填)</label>\n' +
' <input class="form-control facilitynos" type="text" name="facilityno" id="facilityno" required>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="weight">重量(必填)</label>\n' +
' <input class="form-control weights " type="text" name="weight" id="weight" onkeyup="if(value<0)value=0;if(value.length>4)value=value.slice(0,4);value=value.replace(/^\\D*(\\d*(?:\\.\\d)?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="numberofstop">停数(必填)</label>\n' +
' <input class="form-control numberofstops" type="text" name="numberofstop" id="numberofstop" onkeyup="if(value<0)value=0;if(value.length>3)value=value.slice(0,3);value=value.replace(/^\\D*(\\d*(?:\\.\\d)?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3" >\n' +
' <label for="numberoffloor">楼层数(必填)</label>\n' +
' <input class="form-control numberoffloors" type="text" name="numberoffloor" id="numberoffloor" onkeyup="if(value<0)value=0;if(value.length>3)value=value.slice(0,3);value=value.replace(/^\\D*(\\d*(?:\\.\\d)?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div>\n' +
' </div>\n' +
' <div class="form-group">\n' +
' <div class="col-md-3" >\n' +
' <label for="opentype">开门方式(必填)</label>\n' +
' <Select class="form-control opentypes" name="opentype" id="opentype" required>\n' +
' <option selected="selected" disabled="disabled" style="display: none" value=""></option>\n' +
' <Option Value="CO">CO</Option>\n' +
' <Option Value="SO">SO</Option>\n' +
' <Option Value="CO-SO">CO-SO</Option>\n' +
' </Select>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="speed">速度(必填)</label>\n' +
' <input class="form-control speeds" type="text" name="speed" id="speed" onkeyup="if(value<0)value=0;if(value.length>4)value=value.slice(0,4);value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,1})?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div class="col-md-3">\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="repairtype">维修型态(必填)</label>\n' +
' <Select class="form-control repairtypes" name="repairtype" id="repairtype" required>\n' +
' <option selected="selected" disabled="disabled" style="display: none" value=""></option>\n' +
' <Option Value="A">定期保养</Option>\n' +
' <Option Value="B">单次保养</Option>\n' +
' <Option Value="C">单次维修</Option>\n' +
' </Select>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="address">地址</label>\n' +
' <input class="form-control addresss" type="text" name="address" id="address" >\n' +
' </div>\n' +
'\n' +
' </div>\n' +
' <div class="form-group">\n' +
' <div class="col-md-3">\n' +
' <label for="longitude">经度(必填)</label>\n' +
' <input class="form-control longitudes" type="text" name="longitude" id="longitude" onkeyup="if(value<0)value=0;if(value.length>11)value=value.slice(0,11);value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,7})?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="latitude">纬度(必填)</label>\n' +
' <input class="form-control latitudes" type="latitude" name="latitude" id="latitude" onkeyup="if(value<0)value=0;if(value.length>11)value=value.slice(0,11);value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,7})?).*$/g, \'$1\')" required>\n' +
'\n' +
' </div>\n' +
'\n' +
'\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="repairerid">维修人员工号(必填)</label>\n' +
' <input class="form-control repairerids" type="text" name="repairerid" id="repairerid" required>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="repairername">维修人员姓名(必填)</label>\n' +
' <input class="form-control repairernames" type="text" name="repairername" id="repairername" required>\n' +
' </div>\n' +
'\n' +
' </div>'
p.innerHTML += newfacility;
} else if (ty == 's') {
var s = document.getElementById('schedule');
var newschedule = '<div class="form-group" >\n' +
' <div class="col-md-3">\n' +
' <label for="facilityno">作番号(必填)</label>\n' +
' <input class="form-control facilitynos" type="text" id="facilityno" required>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-2">\n' +
' <label for="combono">保养套餐编号(必填)</label>\n' +
' <input class="form-control combonos" type="text" id="combono" required>\n' +
' </div>\n' +
' <div class="col-md-2">\n' +
' <label for="duedate">应保养日期(必填)</label>\n' +
' <input class="form-control duedates" type="text " id="duedate" required>\n' +
'\n' +
' </div>\n' +
' <div class="col-md-2">\n' +
' <label for="repairerid">保养人员工号(必填)</label>\n' +
' <input class="form-control repairerids" type="text" id="repairerid" required>\n' +
' </div>\n' +
'\n' +
' <div class="col-md-3">\n' +
' <label for="repairername">保养人员姓名(必填)</label>\n' +
' <input class="form-control repairernames" type="text" id="repairername" required>\n' +
' </div>\n' +
'\n' +
' </div>'
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";
}

3
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);

77
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 '<pre>';
// print_r($sql_get);
// echo '</pre>';
// 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;
?>
<style>
#table_index2 {
@ -188,6 +189,77 @@ $para = "function_name=pricereview&" . $token_link;
</p>
-->
<?php
function get_pending($token)
{
global $link;
if (!$token) throw new \Exception("token empty", 802);
list($user_id) = explode(".", $token);
$i = 1;
$data = [];
$sql = "
SELECT
t.system_id,
t.system_name,
t.flow_id,
t.flow_name,
COUNT(*)
FROM (
SELECT s.form_key,
m.system_id,
y.system_name,
m.flow_id,
m.flow_name,
m.path
FROM subflow s,
flow f,
flow_main m,
system_main y
WHERE 1=1
AND m.flow_id NOT IN ('wws04')
AND EXISTS (
SELECT form_key,
MAX(seq)
FROM subflow
GROUP BY form_key
HAVING SUBSTRING(s.form_key, 1, 10) = form_key
AND s.seq = max(seq)
)
AND SUBSTRING(s.form_key, 1, 10) = f.form_key
AND f.flow_id = m.flow_id
AND f.system_id = y.system_id
AND s.current_assigner = '$user_id'
AND f.flow_code != 'Z'
) t
GROUP BY t.system_id,
t.flow_id,
t.system_name,
t.flow_name
LIMIT 0, 6
";
$res = mysqli_query($link, $sql);
while ($row = mysqli_fetch_row($res)) {
// print_r($row);
$data[$i]["sid"] = $row[0];
$data[$i]["sname"] = $row[1];
$data[$i]["fid"] = $row[2];
$data[$i]["fname"] = $row[3];
$data[$i]["cnt"] = $row[4];
$i++;
}
mysqli_free_result($res);
return $data;
}
$result = get_pending($token);
// echo '<pre>';
// print_r($result);
// echo '</pre>';
if ($data) :
/*
if($_SERVER["REQUEST_METHOD"] == "POST"){
@ -201,6 +273,7 @@ if ($data) :
?>
<link rel="stylesheet" href="common.css">
<div style="overflow-x:auto; white-space:nowrap;">
<a href="/wms/mkt/pricereview-index.php?system_id=<?= $result[1]['sid'] ?>&flow_id=<?= $result[1]['fid'] ?>&function_name=pricereview&token=<?php echo $token; ?>" class=" btn btn-primary btn-sm"> 待我簽核</a>
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>

7
wms/mkt/pricereview-record-check.php

@ -140,7 +140,12 @@ if (isset($_POST['status'])) {
if ($fromsign == 1) {
echo "location.href='../sign/list.php?system_id=prm&flow_id=prm01&function_name=show&" . $token_link . "';";
} else {
echo "location.href='pricereview-check.php?id=" . $id . "&function_name=pricereview&" . $token_link . "';";
if ($user_id == "M0060") {
echo "alert('簽核成功!!!');";
echo "location.href='../sign/list.php?system_id=prm&flow_id=prm01&function_name=show&" . $token_link . "';";
} else {
echo "location.href='pricereview-check.php?id=" . $id . "&function_name=pricereview&" . $token_link . "';";
}
}
echo "</script>";
}

2
workflow/lib/DB.php

@ -19,7 +19,7 @@ if (file_exists($envFile)) {
class DB
{
private static $ds = array(
'default' => array('host' => '127.0.0.1', 'db_name' => 'appwms', 'user' => 'masadaroot', 'pwd' => 'x6h5E5p#u8y')
'default' => array('host' => '127.0.0.1', 'db_name' => 'appwms', 'user' => 'masadaroot', 'pwd' => '')
);
public static $instance;
/**

Loading…
Cancel
Save