Browse Source

新梯合約書申請:新增待簽通知、審核人改為業務部(M0175)一人

gary
10994015 1 year ago
parent
commit
af80c76a1c
  1. 325
      wms/cont/css/pricereview.css
  2. 1
      wms/cont/css/pricereview.css.map
  3. 343
      wms/cont/css/pricereview.scss
  4. 5
      wms/cont/js/alpinejs/cdn.min.js
  5. 7
      wms/cont/js/pricereviewAlpine.js
  6. 4
      wms/cont/pricereviewCheck.php
  7. 143
      wms/cont/pricereviewCreate.php
  8. 2
      wms/contract/api/postContractData.php
  9. 39
      wms/contract/api/postContractNewApplyData.php
  10. 58
      wms/contract/api/postFlow.php
  11. 67
      wms/contract/contract-new-apply.php
  12. 13
      wms/contract/js/alpine.js
  13. 2
      wms/crm/crmm02-index.php
  14. 2
      wms/crm/crmm06_submit.php
  15. 7
      wms/fun_global.php
  16. 3
      wms/login.php

325
wms/cont/css/pricereview.css

@ -0,0 +1,325 @@
@charset "UTF-8";
#pricereviewCreate input[type=text], #pricereviewCreate input[type=number], #pricereviewCreate select {
margin: 1px;
}
#pricereviewCreate textarea {
resize: vertical;
}
#pricereviewCreate select {
-webkit-appearance: none; /* 針對 Chrome, Safari, Opera */
-moz-appearance: none; /* 針對 Firefox */
appearance: none; /* 標準語法 */
}
#pricereviewCreate > .modal {
padding: 20px;
}
#pricereviewCreate > .modal table, #pricereviewCreate > .modal th, #pricereviewCreate > .modal td {
border: 1px #ccc solid;
}
#pricereviewCreate > .modal table > thead tr th {
color: #A52A2A;
}
#pricereviewCreate > .modal table > tbody .selected {
background-color: #E7FEFB;
}
#pricereviewCreate .container table, #pricereviewCreate .container th, #pricereviewCreate .container td {
border: 1px #ccc solid;
padding: 9px;
}
#pricereviewCreate .container table.noborder, #pricereviewCreate .container table .noborder th, #pricereviewCreate .container table .noborder td, #pricereviewCreate .container th.noborder, #pricereviewCreate .container th .noborder th, #pricereviewCreate .container th .noborder td, #pricereviewCreate .container td.noborder, #pricereviewCreate .container td .noborder th, #pricereviewCreate .container td .noborder td {
border: none;
}
#pricereviewCreate .container table thead th {
background-color: #6D9EEB;
}
#pricereviewCreate .container table tbody td input {
font-size: 14px;
}
#pricereviewCreate .container table tbody th {
background-color: #CCE4F8;
font-size: 14px;
padding: 15px 2px;
min-width: 100px;
text-align: center;
}
#pricereviewCreate .container table input {
font-size: 13px;
}
#pricereviewCreate .container .pricreviewmain {
background-color: #F2F2F2;
padding: 20px;
border-radius: 6px;
margin: 30px 0;
}
#pricereviewCreate .container .pricreviewmain button {
color: #fff;
width: 55px;
height: 30px;
padding: 0;
margin-left: 6px;
margin-bottom: 2px;
font-size: 13px;
}
#pricereviewCreate .container .pricreviewmain button.addbtn {
background-color: #337AB7;
width: 30px;
}
#pricereviewCreate .container .pricreviewmain button.deleteBtn {
background-color: #D9534F;
color: #fff;
font-size: 12px;
width: 30px;
}
#pricereviewCreate .container .pricreviewmain button.selectElevator {
background-color: #D9534F;
color: #fff;
}
#pricereviewCreate .container .pricreviewmain > .divitem {
border: 1px #ccc solid;
padding: 10px;
border-radius: 4px;
}
#pricereviewCreate .container .pricreviewmain > .divitem .title {
display: flex;
align-items: center;
border-bottom: 1px #ccc solid;
padding: 10px 0;
margin-bottom: 10px;
}
#pricereviewCreate .container .pricreviewmain > .divitem .title h6 {
font-weight: 600;
}
#pricereviewCreate .container .pricreviewmain > .divitem table, #pricereviewCreate .container .pricreviewmain > .divitem th, #pricereviewCreate .container .pricreviewmain > .divitem td {
font-size: 14px;
background-color: transparent;
}
#pricereviewCreate .container .pricreviewmain > .divitem table input, #pricereviewCreate .container .pricreviewmain > .divitem table select, #pricereviewCreate .container .pricreviewmain > .divitem th input, #pricereviewCreate .container .pricreviewmain > .divitem th select, #pricereviewCreate .container .pricreviewmain > .divitem td input, #pricereviewCreate .container .pricreviewmain > .divitem td select {
font-size: 13px;
padding: 0 13px;
}
#pricereviewCreate .container .pricreviewmain > .divitem table textarea, #pricereviewCreate .container .pricreviewmain > .divitem th textarea, #pricereviewCreate .container .pricreviewmain > .divitem td textarea {
font-size: 13px;
}
#pricereviewCreate .container .pricreviewmain > .divitem table input[type=number]::-webkit-outer-spin-button,
#pricereviewCreate .container .pricreviewmain > .divitem table input[type=number]::-webkit-inner-spin-button, #pricereviewCreate .container .pricreviewmain > .divitem th input[type=number]::-webkit-outer-spin-button,
#pricereviewCreate .container .pricreviewmain > .divitem th input[type=number]::-webkit-inner-spin-button, #pricereviewCreate .container .pricreviewmain > .divitem td input[type=number]::-webkit-outer-spin-button,
#pricereviewCreate .container .pricreviewmain > .divitem td input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
#pricereviewCreate .container .pricreviewmain > .divitem table tr:hover .deleteBtn, #pricereviewCreate .container .pricreviewmain > .divitem table tr:hover .copyBtn {
opacity: 1;
}
#pricereviewCreate .container .pricreviewmain > .divitem table .copyBtn {
width: 30px;
height: 30px;
}
#pricereviewCreate .container .pricreviewmain > .divitem table .saletd {
position: relative;
}
#pricereviewCreate .container .pricreviewmain > .divitem table .saletd > .deleteBtn {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 2px;
opacity: 0;
transition: 0.3s;
}
#pricereviewCreate .container .pricreviewmain > .divitem table .saletd > .copyBtn {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 38px;
opacity: 0;
transition: 0.3s;
width: 30px;
height: 30px;
}
#pricereviewCreate .container .pricreviewmain > .divitem table textarea {
height: auto;
min-height: 50px;
}
#pricereviewCreate .container .pricreviewmain > .filediv {
display: flex;
flex-direction: column;
margin-top: 20px;
}
#pricereviewCreate .container .pricreviewmain > .filediv label {
display: flex;
align-items: center;
margin: 10px 0;
}
#pricereviewCreate .container .pricreviewmain > .filediv label p {
width: 100px;
font-size: 15px;
font-weight: 600;
}
#pricereviewCreate .container .pricreviewmain > .filediv label input[type=file] {
width: 400px;
}
#pricereviewCreate .container .pricreviewmain > .filediv label a, #pricereviewCreate .container .pricreviewmain > .filediv label button {
width: 100px;
height: 35px;
margin: 0;
margin-right: 15px;
margin-top: 20px;
}
.container-fluid, .container {
max-width: 1400px !important;
width: 100%;
}
.container-fluid h4, .container h4 {
font-weight: 600;
}
.container-fluid .btn-secondary, .container .btn-secondary {
background-color: #6C757D;
}
[x-cloak][data-type=window-modal],
[x-cloak][data-type=errortext] {
display: none !important;
}
.errortext {
font-size: 12px !important;
color: red !important;
font-weight: 600 !important;
}
.window-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9;
padding: 20px;
}
@keyframes fade-in {
0% {
transform: translate(-50%, -60%);
opacity: 0;
}
100% {
transform: translate(-50%, -55%);
opacity: 1;
}
}
.window-modal table, .window-modal th, .window-modal td {
border: 1px #ccc solid;
}
.window-modal table > thead tr th {
color: #A52A2A;
}
.window-modal table > tbody .selected {
background-color: #E7FEFB;
}
.window-modal#optionModal .window-modal-content {
max-height: 80vh;
}
.window-modal#optionModal .window-modal-content .window-modal-body {
height: 400px;
overflow-y: scroll;
}
.window-modal#toElevatorModal .window-modal-content {
min-height: 270px;
height: auto;
}
.window-modal#toElevatorModal .window-modal-content .window-modal-body {
height: auto;
}
.window-modal .window-modal-content {
z-index: 9;
background-color: #fff;
border-radius: 10px;
position: absolute;
width: 90%;
padding: 30px;
top: 50%;
left: 50%;
transform: translate(-50%, -55%);
box-shadow: 0 5px 5px #222;
animation: fade-in 0.2s linear;
}
.window-modal .window-modal-content.modal-xl {
max-width: 1200px;
}
.window-modal .window-modal-content.modal-lg {
max-width: 800px;
}
.window-modal .window-modal-content.modal-m {
max-width: 450px;
}
.window-modal .window-modal-content .window-modal-header {
display: flex;
flex-direction: column;
}
.window-modal .window-modal-content .window-modal-header button.btn-close {
position: absolute;
top: 10px;
right: 10px;
background-color: transparent;
border: none;
outline: none;
border-radius: 50%;
}
.window-modal .window-modal-content .window-modal-header > div > input {
width: 250px;
}
.window-modal .window-back {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: transparent;
}
#pricereviewCheck > .container {
background-color: #F2F2F2;
border-radius: 15px;
padding: 20px;
}
#pricereviewCheck > .container .historytable {
max-height: 0;
overflow: hidden;
}
#pricereviewCheck > .container textarea {
resize: vertical;
}
#pricereviewCheck > .container table, #pricereviewCheck > .container th, #pricereviewCheck > .container td {
border: 1px #ccc solid;
}
#pricereviewCheck > .container table.noborder {
border: none !important;
}
#pricereviewCheck > .container table.noborder th, #pricereviewCheck > .container table.noborder td {
border: none !important;
}
#pricereviewCheck > .container .customerinfo-table input {
background-color: #EEE5E5;
}
#pricereviewCheck > .container .mi-table th {
font-weight: 600;
}
#pricereviewCheck > .container .mi-table input[type=text] {
background-color: #EEEEEE;
cursor: not-allowed;
padding: 6px 12px;
font-size: 14px;
}
#pricereviewCheck > .container .mi-table .mi-info {
font-size: 14px;
}
#pricereviewCheck > .container .mi-table .mi-info span {
font-size: 15px;
font-weight: 600;
}
#pricereviewCheck > .container .mi-table .mi-info .line {
width: 100%;
height: 0.5px;
margin: 30px 0;
background-color: #ccc;
}/*# sourceMappingURL=pricereview.css.map */

1
wms/cont/css/pricereview.css.map

@ -0,0 +1 @@
{"version":3,"sources":["pricereview.css","pricereview.scss"],"names":[],"mappings":"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","file":"pricereview.css"}

343
wms/cont/css/pricereview.scss

@ -0,0 +1,343 @@
#pricereviewCreate{
input[type='text'], input[type='number'], select{
margin: 1px;
}
textarea{
resize: vertical;
}
select{
-webkit-appearance: none; /* 針對 Chrome, Safari, Opera */
-moz-appearance: none; /* 針對 Firefox */
appearance: none; /* 標準語法 */
}
>.modal{
padding: 20px;
table, th, td{
border:1px #ccc solid;
}
table > thead tr th{
color:#A52A2A;
}
table > tbody .selected{
background-color: #E7FEFB;
}
table > tbody .selected td{
}
}
.container{
table, th, td{
border:1px #ccc solid;
padding: 9px;
&.noborder, .noborder th, .noborder td{
border:none;
}
}
table{
thead th{
background-color: #6D9EEB;
}
tbody {
td input{
font-size: 14px;
}
th{
background-color: #CCE4F8;
font-size: 14px;
padding: 15px 2px;
min-width: 100px;
text-align: center;
}
}
input{
font-size: 13px;
}
}
.pricreviewmain{
background-color: #F2F2F2;
padding: 20px;
border-radius: 6px ;
margin:30px 0;
button{
color:#fff;
width: 55px;
height: 30px;
padding: 0;
margin-left: 6px;
margin-bottom: 2px;
font-size: 13px;
&.addbtn{
background-color: #337AB7;
width: 30px;
}
&.deleteBtn{
background-color: #D9534F;
color:#fff;
font-size: 12px;
width: 30px;
}
&.selectElevator{
background-color: #D9534F;
color:#fff;
}
}
>.divitem{
border:1px #ccc solid;
padding: 10px;
border-radius: 4px ;
.title{
display: flex;
align-items: center;
border-bottom: 1px #ccc solid;
padding: 10px 0;
margin-bottom: 10px;
h6{
font-weight: 600;
}
}
table, th, td{
font-size: 14px;
background-color: transparent;
input, select{
font-size: 13px;
padding: 0 13px;
}
textarea{
font-size: 13px;
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
}
table {
tr:hover .deleteBtn ,tr:hover .copyBtn{
opacity: 1;
}
.copyBtn{
width: 30px;
height: 30px;
}
.saletd{
position: relative;
>.deleteBtn{
position: absolute;
top: 50%;
transform: translateY(-50%);
right:2px;
opacity: 0;
transition: .3s;
}
>.copyBtn{
position: absolute;
top: 50%;
transform: translateY(-50%);
right:38px;
opacity: 0;
transition: .3s;
width: 30px;
height: 30px;
}
}
textarea{
height: auto;
min-height: 50px;
}
}
}
>.filediv{
display: flex;
flex-direction: column;
margin-top: 20px;
label{
display: flex;
align-items: center;
margin:10px 0;
p{
width:100px;
font-size: 15px;
font-weight: 600;
}
input[type="file"]{
width:400px
}
a, button{
width:100px;
height: 35px;
margin:0;
margin-right: 15px;
margin-top: 20px;
}
}
}
}
}
}
.container-fluid, .container{
max-width:1400px !important;
width: 100%;
h4{
font-weight: 600;
}
.btn-secondary{
background-color: #6C757D;
}
}
[x-cloak][data-type="window-modal"],
[x-cloak][data-type="errortext"]
{
display: none !important;
}
.errortext{
font-size:12px !important;
color:red !important;
font-weight:600 !important;
}
.window-modal{
position: fixed;
top: 0;
left:0;
width: 100%;
height: 100vh;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9;
padding: 20px;
// display: none;
@keyframes fade-in {
0%{
transform: translate(-50%, -60%);
opacity: 0;
}
100%{
transform: translate(-50%, -55%);
opacity: 1;
}
}
table, th, td{
border:1px #ccc solid;
}
table > thead tr th{
color:#A52A2A;
}
table > tbody .selected{
background-color: #E7FEFB;
}
&#optionModal .window-modal-content{
max-height: 80vh;
.window-modal-body{
height: 400px;
overflow-y: scroll;
}
}
&#toElevatorModal .window-modal-content{
min-height: 270px;
height: auto;
.window-modal-body{
height: auto;
}
}
.window-modal-content{
z-index: 9;
background-color: #fff;
border-radius: 10px;
position: absolute;
width:90%;
padding: 30px;
top: 50%;
left:50%;
transform: translate(-50%, -55%);
box-shadow: 0 5px 5px #222;
animation: fade-in .2s linear;
&.modal-xl{
max-width:1200px;
}
&.modal-lg{
max-width:800px;
}
&.modal-m{
max-width:450px;
}
.window-modal-header{
display: flex;
flex-direction: column;
button.btn-close{
position: absolute;
top: 10px;
right:10px;
background-color: transparent;
border:none;
outline: none;
border-radius: 50%;
}
>div > input{
width: 250px;
}
}
}
.window-back{
position: absolute;
top: 0;
left:0;
width: 100%;
height: 100%;
background-color: transparent;
}
}
#pricereviewCheck{
>.container{
background-color: #F2F2F2;
border-radius: 15px;
padding: 20px;
.historytable{
max-height: 0;
overflow: hidden;
}
textarea{
resize: vertical;
}
table, th, td{
border:1px #ccc solid;
}
table.noborder{
border:none !important;
th ,td{
border:none !important;
}
}
.customerinfo-table{
input{
background-color: #EEE5E5;
}
}
.mi-table{
th{
font-weight: 600;
}
input[type=text]{
background-color: #EEEEEE;
cursor: not-allowed;
padding: 6px 12px;
font-size: 14px;
}
.mi-info{
font-size: 14px;
span{
font-size: 15px;
font-weight: 600;
}
.line{
width: 100%;
height: .5px;
margin:30px 0;
background-color: #ccc;
}
}
}
}
}

5
wms/cont/js/alpinejs/cdn.min.js

File diff suppressed because one or more lines are too long

7
wms/cont/js/pricereviewAlpine.js

@ -0,0 +1,7 @@
const pricereviewCreate = ()=>{
return {
init(){
console.log(123);
},
}
}

4
wms/cont/pricereviewCheck.php

@ -0,0 +1,4 @@
<?php
include_once "../header.php";
require_once('../mkt/conn.php');

143
wms/cont/pricereviewCreate.php

@ -0,0 +1,143 @@
<?php
include_once "../header.php";
require_once "../mkt/conn.php";
?>
<link rel="stylesheet" href="./css/pricereview.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.5.0/axios.min.js" integrity="sha512-aoTNnqZcT8B4AmeCFmiSnDlc4Nj/KPaZyB5G7JnOnUEkdNpCZs1LCankiYi01sLTyWy+m2P+W4XM+BuQ3Q4/Dg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script defer src="./js/alpinejs/cdn.min.js"></script>
<script src="./js/pricereviewAlpine.js"></script>
<div id="pricereviewCreate" x-data=pricereviewCreate()>
<div class="container">
<table class="table" border="1">
<thead >
<tr class="" >
<th scope="col" class="text-center " colspan="8">有望客戶(契約)基本資料</th>
</tr>
</thead>
<tbody>
<tr>
<th>評審單號</th>
<td><input class="form-control" type="text" disabled value="" /></td>
<th>卷號</th>
<td><input class="form-control" type="text" disabled value="" /></td>
<th>現場地址</th>
<td><input class="form-control" type="text" disabled value="" /></td>
<th>現場名稱</th>
<td><input class="form-control" type="text" disabled value="" /></td>
</tr>
<tr>
<th>電梯品牌</th>
<td><input class="form-control" type="text" disabled value="" /></td>
<th>數量</th>
<td><input class="form-control" type="number" disabled value="" /></td>
<th>營業員</th>
<td><input class="form-control" type="text" disabled value="" /></td>
<th>保養方式</th>
<td>
<select class="form-control" disabled>
<option value=""></option>
</select>
</td>
</tr>
<tr>
<th>契約期限開始</th>
<td><input class="form-control" type="date" disabled value="" /></td>
<th>契約期限結束</th>
<td><input class="form-control" type="date" disabled value="" /></td>
<th>契約性質</th>
<td>
<select class="form-control" disabled>
<option value=""></option>
<option value="">新簽約</option>
<option value="">免保轉有費</option>
<option value="">續約</option>
</select>
</td>
<th>介紹人</th>
<td><input class="form-control" type="text" disabled value="" /></td>
</tr>
<tr>
<th>付款方式</th>
<td>
<select class="form-control" disabled>
<option value=""></option>
<option value="">月付</option>
<option value="">季付</option>
<option value="">半年付</option>
<option value="">年付</option>
</select>
</td>
<th></th>
<td></td>
<th></th>
<td></td>
<th></th>
<td></td>
</tr>
</tbody>
</table>
<table class="table" border="1">
<thead >
<tr class="" >
<th scope="col" class="text-center " colspan="8">洽商進度</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan=8>
<textarea class="form-control" name="progress" id="progress" cols="20" rows="5" disabled ></textarea>
</td>
</tr>
</tbody>
</table>
<table class="table" border="1">
<thead >
<tr class="" >
<th scope="col" class="text-center " colspan="8">電梯詳細資料</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan=8>
<textarea class="form-control" name="progress" id="progress" cols="20" rows="6" disabled>註意事項:
1.速度單位是 米/分.
2.選擇贈送M1,保養月數需填寫60.
3.標準價格未帶出,請聯係業務部建立該規格報價.
4.無機房速度20~60米 以60米為標準.
</textarea>
</td>
</tr>
</tbody>
</table>
<div class="pricreviewmain container">
<div class="divitem">
<div class="title">
<h4>整機單價</h4>
<button class="addbtn btn" x-ref="addElevatorBtn" @click="openCreateElevatorModal()" >+</button>
</div>
<table class="table" border=1>
<thead>
<tr>
<th>項次</th>
<th>電梯</th>
<th>人乘</th>
<th>載重(KG)</th>
<th>停數</th>
<th>速度(m/min)</th>
<th>開門方式</th>
<th>規格</th>
<th>公司發布價(台)</th>
<th>數量</th>
<th>公司發布價(總價)</th>
<th>售價(台)</th>
<th>售價(總價) </th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>

2
wms/contract/api/postContractData.php

@ -213,7 +213,7 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$ADuseful_date = implode("-", $click); $ADuseful_date = implode("-", $click);
$sql_str = "INSERT INTO facility (contractno, define, facilityno, latitude, longitude, customerid, weight, numberofpassenger, numberofstop, numberoffloor, opentype, speed, repairtype, maintainance, facility_kind, address, repairerid, repairername, creater, create_at, area, takecertificatedate, licensedate) $sql_str = "INSERT INTO facility (contractno, define, facilityno, latitude, longitude, customerid, weight, numberofpassenger, numberofstop, numberoffloor, opentype, speed, repairtype, maintainance, facility_kind, address, repairerid, repairername, creater, create_at, area, takecertificatedate, licensedate)
VALUES (:contractno, :define, :facilityno, :latitude, :longitude, :customerid, :weight, :numberofpassenger, :numberofstop, :numberoffloor, :opentype, :speed, :repairtype, :maintainance, :facility_kind, :address, :repairerid, :repairername, :creater, :create_at, :area, :takecertificatedate, :licensedate)"; VALUES (:contractno, :define, :facilityno, :latitude, :longitude, :customerid, :weight, :numberofpassenger, :numberofstop, :numberoffloor, :opentype, :speed, :repairtype, :maintainance, :facility_kind, :address, :repairerid, :repairername, :creater, :create_at, :area, :takecertificatedate, :licensedate)";
$stmt = $conn->prepare($sql_str); $stmt = $conn->prepare($sql_str);
$stmt->bindParam(':contractno', $contractno); $stmt->bindParam(':contractno', $contractno);
$stmt->bindParam(':define', $define); $stmt->bindParam(':define', $define);

39
wms/contract/api/postContractNewApplyData.php

@ -4,6 +4,7 @@ use function Symfony\Component\String\s;
require_once("../conn.php"); require_once("../conn.php");
include_once("./upload_chk.php"); include_once("./upload_chk.php");
include_once "./postFlow.php";
ini_set('date.timezone', 'Asia/Taipei'); ini_set('date.timezone', 'Asia/Taipei');
if ($_SERVER['REQUEST_METHOD'] != 'POST') { if ($_SERVER['REQUEST_METHOD'] != 'POST') {
exit(); exit();
@ -42,6 +43,8 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] ==
$status = $_POST['status']; // 0:暫存 1:送審 2:退回 3:完成 $status = $_POST['status']; // 0:暫存 1:送審 2:退回 3:完成
$pays = json_decode($pays, true); $pays = json_decode($pays, true);
$form_key = $_POST['form_key'];
$files = !empty($_FILES['files']) ? $_FILES['files'] : null; $files = !empty($_FILES['files']) ? $_FILES['files'] : null;
@ -160,6 +163,14 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] ==
} }
} }
// -----處理檔案上傳 END----- // -----處理檔案上傳 END-----
if($status == 1){
$current_assigner = "M0175";
$flow_code = "A";
$ekind = "新梯";
createFlow($mid, $current_assigner, $flow_code, $ekind, $form_key);
}
header("HTTP/1.1 201 success!"); header("HTTP/1.1 201 success!");
$conn->commit(); $conn->commit();
} else { } else {
@ -211,7 +222,6 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] ==
} }
$deleted_at = date("Y-m-d H:i:s"); $deleted_at = date("Y-m-d H:i:s");
$removefiles = isset($_POST['removefiles']) ? json_decode($_POST['removefiles'], true) : []; $removefiles = isset($_POST['removefiles']) ? json_decode($_POST['removefiles'], true) : [];
print_r($removefiles);
if(count($removefiles) > 0){ if(count($removefiles) > 0){
foreach($removefiles as $file){ foreach($removefiles as $file){
$sql_str = "UPDATE contract_apply_files SET deleted_at = :deleted_at WHERE id = :fileid"; $sql_str = "UPDATE contract_apply_files SET deleted_at = :deleted_at WHERE id = :fileid";
@ -221,9 +231,18 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] ==
$stmt ->execute(); $stmt ->execute();
} }
} }
if($status == 1){
$current_assigner = "M0175";
$flow_code = "A";
$ekind = "新梯";
createFlow($mid, $current_assigner, $flow_code, $ekind, $form_key);
}
header("HTTP/1.1 201 success!"); header("HTTP/1.1 201 success!");
$conn->commit(); $conn->commit();
} }
} catch (PDOException $e) { } catch (PDOException $e) {
$conn->rollback(); $conn->rollback();
header("HTTP/1.1 500 failed!"); header("HTTP/1.1 500 failed!");
@ -268,6 +287,8 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] ==
$progress = $_POST['progress']; $progress = $_POST['progress'];
$review_comment = $_POST['review_comment']; $review_comment = $_POST['review_comment'];
$user_id = $_POST['review_person_id']; $user_id = $_POST['review_person_id'];
$form_key = $_POST['form_key'];
$mid = $contract_new_apply_id;
$review_date = date('Y-m-d H:i:s'); $review_date = date('Y-m-d H:i:s');
$conn->beginTransaction(); $conn->beginTransaction();
try { try {
@ -280,6 +301,13 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] ==
$stmt->bindParam(':review_person_id', $user_id); $stmt->bindParam(':review_person_id', $user_id);
$stmt->bindParam(':review_date', $review_date); $stmt->bindParam(':review_date', $review_date);
$stmt->execute(); $stmt->execute();
//發送待簽通知
$current_assigner = "00000";
$flow_code = "Z";
$ekind = "新梯";
createFlow($mid, $current_assigner, $flow_code, $ekind, $form_key);
header("HTTP/1.1 200 success!"); header("HTTP/1.1 200 success!");
$conn->commit(); $conn->commit();
} catch (PDOException $e) { } catch (PDOException $e) {
@ -297,6 +325,8 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] ==
$progress = $_POST['progress']; $progress = $_POST['progress'];
$review_comment = $_POST['review_comment']; $review_comment = $_POST['review_comment'];
$user_id = $_POST['review_person_id']; $user_id = $_POST['review_person_id'];
$form_key = $_POST['form_key'];
$mid = $contract_new_apply_id;
echo $user_id; echo $user_id;
$review_date = date('Y-m-d H:i:s'); $review_date = date('Y-m-d H:i:s');
$conn->beginTransaction(); $conn->beginTransaction();
@ -310,6 +340,13 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] ==
$stmt->bindParam(':review_person_id', $user_id); $stmt->bindParam(':review_person_id', $user_id);
$stmt->bindParam(':review_date', $review_date); $stmt->bindParam(':review_date', $review_date);
$stmt->execute(); $stmt->execute();
//發送待簽通知
$current_assigner = "00000";
$flow_code = "A";
$ekind = "新梯";
createFlow($mid, $current_assigner, $flow_code, $ekind, $form_key);
header("HTTP/1.1 200 success!"); header("HTTP/1.1 200 success!");
$conn->commit(); $conn->commit();
} catch (PDOException $e) { } catch (PDOException $e) {

58
wms/contract/api/postFlow.php

@ -0,0 +1,58 @@
<?php
require_once("../conn.php");
function createFlow($mid, $current_assigner, $flow_code, $ekind, $form_key=null){
global $conn;
$form_id = $mid;
$seq = 0;
$system_id = "cta";
if($ekind == "新梯") $flow_id = "cta01";
if($ekind == "汰改") $flow_id = "cta02";
if($ekind == "保養") $flow_id = "cta03";
if($form_key == null){
$sql_str = "SELECT appwms.nextval('form_key') form_key";
$stmt = $conn->prepare($sql_str);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
$form_key = $result['form_key'];
$seq = 0;
$sql_str = "INSERT INTO flow (system_id, flow_id, form_id, form_key, flow_code)
VALUES (:system_id, :flow_id, :form_id, :form_key, :flow_code)";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':system_id', $system_id);
$stmt->bindParam(':flow_id', $flow_id);
$stmt->bindParam(':form_id', $form_id);
$stmt->bindParam(':form_key', $form_key);
$stmt->bindParam(':flow_code', $flow_code);
$stmt->execute();
}else{
$sql_str = "UPDATE flow SET flow_code = :flow_code WHERE form_key = :form_key";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':form_key', $form_key);
$stmt->bindParam(':flow_code', $flow_code);
$stmt->execute();
$sql_str = "SELECT MAX(seq) AS max_seq FROM subflow WHERE form_key = :form_key";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':form_key', $form_key);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
$seq = $result['max_seq'];
$seq ++;
}
$created_at = date("Y-m-d H:i:s");
$sql_str = "INSERT INTO subflow (form_key, seq, current_assigner, update_date,create_date)
VALUES (:form_key, :seq, :current_assigner, :update_date,:create_date)";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':form_key', $form_key);
$stmt->bindParam(':seq', $seq);
$stmt->bindParam(':current_assigner', $current_assigner);
$stmt->bindParam(':update_date', $created_at);
$stmt->bindParam(':create_date', $created_at);
$stmt->execute();
return $form_key;
}

67
wms/contract/contract-new-apply.php

@ -1,13 +1,45 @@
<?php <?php
include_once("../header.php"); include_once("../header.php");
require_once("./conn.php"); require_once("./conn.php");
if (!(isset($_GET['id']) && !empty($_GET['id']))) { if (!(isset($_GET['id']) && !empty($_GET['id'])) && !(isset($_GET['form_key']) && !empty($_GET['form_key']))) {
$para = "function_name=pricereview&" . $token_link; $para = "function_name=pricereview&" . $token_link;
echo "<script>alert('非法訪問!!!');</script>"; echo "<script>alert('非法訪問!!!');</script>";
echo "<script>window.history.go(-1);</script>"; echo "<script>window.history.go(-1);</script>";
exit; exit;
} }
$id = $_GET["id"]; $id = null;
if(isset($_GET['id'])){
$id = $_GET["id"];
}
$form_key = null;
if(isset($_GET['form_key'])){
$form_key = $_GET['form_key'];
}
if($form_key != null){
$sql_str = "SELECT form_id FROM flow WHERE system_id = 'cta' AND flow_id = 'cta01' AND form_key = :form_key";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':form_key', $form_key);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
$id = $result['form_id'];
}
if(!$id){
$para = "function_name=pricereview&" . $token_link;
echo "<script>alert('非法訪問!!!');</script>";
echo "<script>window.history.go(-1);</script>";
exit;
}
$sql_str = "SELECT form_key FROM flow WHERE system_id = 'cta' AND flow_id = 'cta01' AND form_id = :id";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':id', $id);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
if($result){
$form_key = $result['form_key'];
}
$sql_str = "SELECT contract_new_apply.*, person_account.name AS review_person_name, person_final_account.name AS review_final_person_name $sql_str = "SELECT contract_new_apply.*, person_account.name AS review_person_name, person_final_account.name AS review_final_person_name
FROM contract_new_apply FROM contract_new_apply
@ -439,7 +471,13 @@ $para = "function_name=pricereview&" . $token_link;
<tr> <tr>
<td>第二期款交貨期限(日)</td> <td>第二期款交貨期限(日)</td>
<td> <td>
<input type="number" class="form-control" x-model="data.secondPayDeadline" /> <select class="form-control" x-model="data.secondPayDeadline">
<option value="">請選擇</option>
<option value="30">30天</option>
<option value="60">60天</option>
<option value="90">90天</option>
<option value="120">120天</option>
</select>
<p class="alerttext" x-show="data.secondPayDeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> <p class="alerttext" x-show="data.secondPayDeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td> </td>
</tr> </tr>
@ -513,8 +551,8 @@ $para = "function_name=pricereview&" . $token_link;
<?php endif; ?> <?php endif; ?>
</td> </td>
</tr> </tr>
<tr> <tr x-show="false">
<td>業務承辦人</td> <td>業務部審核</td>
<td><span><?php echo (!isset($contract['review_person_name']) || empty($contract['review_person_name'])) ? "---" : $contract['review_person_name'] . "(" . $contract['review_person_id'] . ")"; ?></span></td> <td><span><?php echo (!isset($contract['review_person_name']) || empty($contract['review_person_name'])) ? "---" : $contract['review_person_name'] . "(" . $contract['review_person_id'] . ")"; ?></span></td>
<td> <td>
<?php if (($status == 1 || $status == 3) && $progress >= 2) : ?><span class="successtext">已同意</span><?php endif; ?> <?php if (($status == 1 || $status == 3) && $progress >= 2) : ?><span class="successtext">已同意</span><?php endif; ?>
@ -525,15 +563,15 @@ $para = "function_name=pricereview&" . $token_link;
<td><?php echo $contract['review_date'] ?? "---"; ?></td> <td><?php echo $contract['review_date'] ?? "---"; ?></td>
</tr> </tr>
<tr> <tr>
<td>業務部協理</td> <td>業務部審核</td>
<td><span><?php echo (!isset($contract['review_final_person_name']) || empty($contract['review_final_person_name'])) ? "---" : $contract['review_final_person_name'] . "(" . $contract['review_final_person_id'] . ")"; ?></span></td> <td><span><?php echo (!isset($contract['review_final_person_name']) || empty($contract['review_final_person_name'])) ? "---" : $contract['review_final_person_name'] . "(" . $contract['review_final_person_id'] . ")"; ?></span></td>
<td> <td>
<?php if ($status == 3) : ?><span class="successtext">結案同意</span><?php endif; ?> <?php if ($status == 3) : ?><span class="successtext">結案同意</span><?php endif; ?>
<?php if ($status == 2) : ?><span class="failtext">結案不同意</span><?php endif; ?> <?php if ($status == 2) : ?><span class="failtext">結案不同意</span><?php endif; ?>
<?php if ($status < 2) : ?><span>---</span><?php endif; ?> <?php if ($status < 2) : ?><span>---</span><?php endif; ?>
</td> </td>
<td colspan=2><?php echo $contract['review_final_comment'] ?? "---"; ?></td> <td colspan=2><?php echo $contract['review_comment'] ?? "---"; ?></td>
<td><?php echo $contract['review_final_date'] ?? "---"; ?></td> <td><?php echo $contract['review_date'] ?? "---"; ?></td>
</tr> </tr>
<!-- <tr> <!-- <tr>
<td colspan="2" style="font-weight:bold">業務部承辦人</td> <td colspan="2" style="font-weight:bold">業務部承辦人</td>
@ -554,10 +592,10 @@ $para = "function_name=pricereview&" . $token_link;
</tbody> </tbody>
</table> </table>
<button @click="window.history.go(-1)" type="button" class="btn btn-primary btn-lg pull-right savebtn">回前頁</button> <button @click="window.history.go(-1)" type="button" class="btn btn-primary btn-lg pull-right savebtn">回前頁</button>
<?php if (($isFirst == 1 && ($person == $user_id || $user_id == "M0174")) || ($isFirst == 0 && $status == 0 && ($person == $user_id || $user_id == "M0174"))) : ?> <?php if (($isFirst == 1 && ($person == $user_id || $user_id == "M0174")) || ($isFirst == 0 && ($status == 0 || $status == 2) && ($person == $user_id || $user_id == "M0174"))) : ?>
<button x-show="true" x-on:click="submit()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn"> <button x-show="true" x-on:click="submit()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading"> <template x-if="!isLoading">
<span>送審</span> <span><?php if($status==2) echo "重新"; ?>送審</span>
</template> </template>
<template x-if="isLoading"> <template x-if="isLoading">
<div class="loader"></div> <div class="loader"></div>
@ -578,7 +616,7 @@ $para = "function_name=pricereview&" . $token_link;
<span> <span>
<?php <?php
if (($user_id === "M0175" || $user_id == "TEST02") && $contract['progress'] <= 1) { if (($user_id === "M0175" || $user_id == "TEST02") && $contract['progress'] <= 1) {
echo "同意(上呈)"; echo "同意(結案)";
} elseif (($user_id === "M0060" || $user_id == "TEST03") && $contract['progress'] == 2) { } elseif (($user_id === "M0060" || $user_id == "TEST03") && $contract['progress'] == 2) {
echo "同意(結案)"; echo "同意(結案)";
} }
@ -629,7 +667,7 @@ $para = "function_name=pricereview&" . $token_link;
const price_b = <?php echo $price_b ?? ''; ?>; const price_b = <?php echo $price_b ?? ''; ?>;
const items = [...<?php echo json_encode($items) ?? []; ?>]; const items = [...<?php echo json_encode($items) ?? []; ?>];
const user_id = '<?php echo $user_id ?>'; const user_id = '<?php echo $user_id ?>';
const mid = '<?php echo $_GET['id']; ?>'; const mid = '<?php echo $id; ?>';
const pays = [...<?php echo json_encode($pays) ?? []; ?>]; const pays = [...<?php echo json_encode($pays) ?? []; ?>];
const secondPayDeadline = ''; const secondPayDeadline = '';
const tradeaddress = '<?php echo $contract['address'] ?? ''; ?>'; const tradeaddress = '<?php echo $contract['address'] ?? ''; ?>';
@ -662,7 +700,7 @@ $para = "function_name=pricereview&" . $token_link;
const price_b = <?php echo $contract['install_fee'] ?? ''; ?>; const price_b = <?php echo $contract['install_fee'] ?? ''; ?>;
const items = [...<?php echo json_encode($items) ?? []; ?>]; const items = [...<?php echo json_encode($items) ?? []; ?>];
const user_id = '<?php echo $user_id ?? ''; ?>'; const user_id = '<?php echo $user_id ?? ''; ?>';
const mid = '<?php echo $_GET['id']; ?>'; const mid = '<?php echo $id; ?>';
const pays = [...<?php echo json_encode($pays) ?? []; ?>]; const pays = [...<?php echo json_encode($pays) ?? []; ?>];
const isFirst = <?php echo $isFirst; ?>; const isFirst = <?php echo $isFirst; ?>;
const tradeaddress = '<?php echo $contract['trade_address'] ?? ''; ?>'; const tradeaddress = '<?php echo $contract['trade_address'] ?? ''; ?>';
@ -682,7 +720,7 @@ $para = "function_name=pricereview&" . $token_link;
</script> </script>
<?php endif; ?> <?php endif; ?>
<?php if ($status > 0 || ($person != $user_id && $user_id != "M0174")) : ?> <?php if ($status ==1 || $status == 3 || ($person != $user_id && $user_id != "M0174")) : ?>
<script> <script>
window.onload = () => { window.onload = () => {
const input = document.querySelectorAll('input'); const input = document.querySelectorAll('input');
@ -714,4 +752,5 @@ $para = "function_name=pricereview&" . $token_link;
alert("請先暫存或送審文件!") alert("請先暫存或送審文件!")
} }
} }
const form_key = '<?php echo $form_key; ?>';
</script> </script>

13
wms/contract/js/alpine.js

@ -1465,6 +1465,7 @@ const contractNewApply = () => {
form.append('review_comment', this.data.review_comment); form.append('review_comment', this.data.review_comment);
form.append('description', this.data.description); form.append('description', this.data.description);
form.append('progress', 0); form.append('progress', 0);
form.append('form_key', form_key);
for (var i = 0; i < this.data.files.length; i++) { for (var i = 0; i < this.data.files.length; i++) {
form.append('files[]', this.data.files[i]); form.append('files[]', this.data.files[i]);
} }
@ -1490,7 +1491,7 @@ const contractNewApply = () => {
let newstatus = 0; let newstatus = 0;
if (this.progress <= 1) { if (this.progress <= 1) {
newprogress = 2; newprogress = 3;
} else if (this.progress == 2) { } else if (this.progress == 2) {
newprogress = 3; newprogress = 3;
} }
@ -1498,7 +1499,7 @@ const contractNewApply = () => {
if (this.status == 1 && this.progress == 2) { if (this.status == 1 && this.progress == 2) {
newstatus = 3 newstatus = 3
} else { } else {
newstatus = 1 newstatus = 3
} }
console.log(newstatus); console.log(newstatus);
console.log(newprogress) console.log(newprogress)
@ -1511,6 +1512,7 @@ const contractNewApply = () => {
form.append('review_comment', this.data.review_comment); form.append('review_comment', this.data.review_comment);
form.append('review_person_id', user_id); form.append('review_person_id', user_id);
form.append('progress', newprogress); form.append('progress', newprogress);
form.append('form_key', form_key);
axios.post('./api/postContractNewApplyData.php', form).then(res => { axios.post('./api/postContractNewApplyData.php', form).then(res => {
if (res.status === 200) { if (res.status === 200) {
alert('審核成功'); alert('審核成功');
@ -1518,11 +1520,13 @@ const contractNewApply = () => {
} }
this.isLoading = false this.isLoading = false
}).catch(error => { }).catch(error => {
alert('審核失敗!可能為以下錯誤:\n' + error.response.data) console.log('審核失敗!可能為以下錯誤:\n' + error.response.data)
alert('審核失敗!')
this.isLoading = false this.isLoading = false
}) })
}, },
disagree() { disagree() {
console.log(user_id);
if (!confirm('確定退回嗎?')) return; if (!confirm('確定退回嗎?')) return;
this.isLoading = true this.isLoading = true
const form = new FormData(); const form = new FormData();
@ -1532,11 +1536,12 @@ const contractNewApply = () => {
form.append('review_comment', this.data.review_comment); form.append('review_comment', this.data.review_comment);
form.append('review_person_id', user_id); form.append('review_person_id', user_id);
form.append('progress', 0); form.append('progress', 0);
form.append('form_key', form_key);
axios.post('./api/postContractNewApplyData.php', form).then(res => { axios.post('./api/postContractNewApplyData.php', form).then(res => {
if (res.status === 200) { if (res.status === 200) {
alert('退回成功'); alert('退回成功');
console.log(res.data); console.log(res.data);
// window.location.reload(); window.location.reload();
} }
this.isLoading = false this.isLoading = false
}).catch(error => { }).catch(error => {

2
wms/crm/crmm02-index.php

@ -170,7 +170,7 @@ if ($data) :
<span class="glyphicon glyphicon-pencil"></span> <span class="glyphicon glyphicon-pencil"></span>
</a> </a>
<?php if ($user_name === $row['salesman'] || $user_id = 'M0225') : ?> <?php if ($user_name === $row['salesman'] || $user_id = 'M0225') : ?>
<a href="../mkt/pricereviewMaintainCreate.php?function_name=customer&token=<?= $token_link ?>&vol_no=<?= $row['vol_no'] ?>" class="btn btn-info btn-sm"> <a href="../cont/pricereviewCheck.php?function_name=sign_list&<?= $token_link ?>&vol_no=<?= $row['vol_no'] ?>" class="btn btn-info btn-sm">
轉價審 轉價審
</a> </a>
<?php endif ?> <?php endif ?>

2
wms/crm/crmm06_submit.php

@ -17,4 +17,4 @@ foreach ($cols as $col) {
$hecm->create($data); $hecm->create($data);
echo "<script>alert('已保存');</script>"; echo "<script>alert('已保存');</script>";
header("Location:" . "localhost/wms/crm/crmm02-index.php?token=" . $request['token']); header("Location:" . "crmm02-index.php?token=" . $request['token']);

7
wms/fun_global.php

@ -201,12 +201,13 @@ function check_user_permission($user_id, $token)
'/wms/test.php', '/wms/test.php',
'/wms/delivery_kpi.php', '/wms/delivery_kpi.php',
'/wms/contract_m-index.php', '/wms/contract_m-index.php',
'/wms/contract_b-index.php' '/wms/contract_b-index.php',
]; ];
if (in_array($_SERVER["SCRIPT_NAME"], $ignore_url_arr)) return; if (in_array($_SERVER["SCRIPT_NAME"], $ignore_url_arr)) return;
$do = ""; $do = "";
$sql = "select accounttype from account where accountid = '$user_id'"; $sql = "select accounttype from account where accountid = '$user_id'";
$res = mysqli_query($link, $sql); $res = mysqli_query($link, $sql);
if ($row = mysqli_fetch_assoc($res)) { if ($row = mysqli_fetch_assoc($res)) {
if ($row["accounttype"] == "E") $do = 3; // 管理員 if ($row["accounttype"] == "E") $do = 3; // 管理員
@ -215,8 +216,8 @@ function check_user_permission($user_id, $token)
$res2 = mysqli_query($link, $sql2); $res2 = mysqli_query($link, $sql2);
if ($row2 = mysqli_fetch_assoc($res2)) { if ($row2 = mysqli_fetch_assoc($res2)) {
$arr = json_decode(urldecode($row2["permission"]), true); $arr = json_decode(urldecode($row2["permission"]), true);
//print_r($arr);
//echo "#".str_replace("/wms/", "", $_SERVER["SCRIPT_NAME"]);exit;
$do = $arr[str_replace("/wms/", "", $_SERVER["SCRIPT_NAME"])]; $do = $arr[str_replace("/wms/", "", $_SERVER["SCRIPT_NAME"])];
} }
mysqli_free_result($res2); mysqli_free_result($res2);

3
wms/login.php

@ -89,6 +89,7 @@
</div> </div>
</div> </div>
<span style="color:red">
<?php <?php
if (!empty($_GET['errno'])) { if (!empty($_GET['errno'])) {
if ($_GET['errno'] == 1) { if ($_GET['errno'] == 1) {
@ -102,7 +103,7 @@
} }
} }
?> ?>
</span>
</div> </div>

Loading…
Cancel
Save