Browse Source

1211 merge

gary
10994015 1 year ago
parent
commit
288487bc13
  1. 142
      wms/contract/api/postContractNewApplyData.php
  2. 198
      wms/contract/contract-new-apply.php
  3. 121
      wms/contract/js/alpine.js
  4. 102
      wms/contract/styles/style.css
  5. 2
      wms/contract/styles/style.css.map
  6. 14
      wms/contract/styles/style.scss
  7. 8
      wms/mkt/price_option-index.php
  8. 11
      wms/mkt/price_option-select.php
  9. BIN
      wms/mkt/specsurvey-edit.zip

142
wms/contract/api/postContractNewApplyData.php

@ -1,10 +1,13 @@
<?php <?php
use function Symfony\Component\String\s;
require_once("../conn.php"); require_once("../conn.php");
ini_set ( 'date.timezone' , 'Asia/Taipei' ); ini_set ( 'date.timezone' , 'Asia/Taipei' );
if(isset($_POST['vol_no']) && !empty($_POST['vol_no'])){ //暫存、送審
if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 0 || $_POST['status'] == 1) ){
$mid = $_POST['mid']; $mid = $_POST['mid'];
$vol_no = $_POST['vol_no']; $vol_no = $_POST['vol_no'];
$salesman = $_POST['salesman']; $salesman = $_POST['salesman'];
$salesmanname = $_POST['salesmanname'];
$apply_date = $_POST['apply_date']; $apply_date = $_POST['apply_date'];
$apply_type = $_POST['apply_type']; $apply_type = $_POST['apply_type'];
$case_name = $_POST['case_name']; $case_name = $_POST['case_name'];
@ -21,15 +24,23 @@ if(isset($_POST['vol_no']) && !empty($_POST['vol_no'])){
$freedeadline = $_POST['freedeadline']; $freedeadline = $_POST['freedeadline'];
$trade_address = $_POST['tradeaddress']; $trade_address = $_POST['tradeaddress'];
$tradedeadline = $_POST['tradedeadline']; $tradedeadline = $_POST['tradedeadline'];
$pays = $_POST['pays'];
$status = $_POST['status']; // 0:暫存 1:送審 2:退回 3:完成
$pays = json_decode($pays, true);
$submit_date = ($status == 1) ? date("Y-m-d H:i:s") : null;
$progress = 0; $progress = 0;
$status = 0; $status = $_POST['status'];
$created_at = date('Y-m-d H:i:s'); $created_at = date('Y-m-d H:i:s');
$updated_at = date('Y-m-d H:i:s');
$created_by = $_POST['user_id']; $created_by = $_POST['user_id'];
$updated_by = $_POST['user_id'];
$isFirst = $_POST['isFirst']; $isFirst = $_POST['isFirst'];
$conn->beginTransaction(); $conn->beginTransaction();
try{ try{
if($isFirst == 1){ if($isFirst == 1){
$sql_str = "INSERT INTO contract_new_apply (mid, contractno, sales_man, apply_date, apply_type, case_name, customer, manager, vat, total_price, buy_fee, install_fee, contact_address, workdeadline_a, workdeadline_b, test_time, freedeadline, trade_address, tradedeadline, progress, status, created_at, created_by) VALUES (:mid, :contractno, :sales_man, :apply_date, :apply_type, :case_name, :customer, :manager, :vat, :total_price, :buy_fee, :install_fee, :contact_address, :workdeadline_a, :workdeadline_b, :test_time, :freedeadline, :trade_address, :tradedeadline, :progress, :status, :created_at, :created_by)"; $sql_str = "INSERT INTO contract_new_apply (mid, contractno, sales_man, apply_date, apply_type, case_name, customer, manager, vat, total_price, buy_fee, install_fee, contact_address, workdeadline_a, workdeadline_b, test_time, freedeadline, trade_address, tradedeadline, progress, status, person, personname, submit_date, created_at, created_by) VALUES (:mid, :contractno, :sales_man, :apply_date, :apply_type, :case_name, :customer, :manager, :vat, :total_price, :buy_fee, :install_fee, :contact_address, :workdeadline_a, :workdeadline_b, :test_time, :freedeadline, :trade_address, :tradedeadline, :progress, :status, :person, :personname, :submit_date, :created_at, :created_by)";
$stmt = $conn -> prepare($sql_str); $stmt = $conn -> prepare($sql_str);
$stmt ->bindParam(':mid', $mid); $stmt ->bindParam(':mid', $mid);
$stmt ->bindParam(':contractno', $vol_no); $stmt ->bindParam(':contractno', $vol_no);
@ -52,17 +63,142 @@ if(isset($_POST['vol_no']) && !empty($_POST['vol_no'])){
$stmt ->bindParam(':tradedeadline', $tradedeadline); $stmt ->bindParam(':tradedeadline', $tradedeadline);
$stmt ->bindParam(':progress', $progress); $stmt ->bindParam(':progress', $progress);
$stmt ->bindParam(':status', $status); $stmt ->bindParam(':status', $status);
$stmt ->bindParam(':person', $salesman);
$stmt ->bindParam(':personname', $salesmanname);
$stmt ->bindParam(':submit_date', $submit_date);
$stmt ->bindParam(':created_at', $created_at);
$stmt ->bindParam(':created_by', $created_by);
$stmt ->execute();
$contract_apply_id = $conn->lastInsertId();
foreach($pays as $idx=>$pay){
$kind = $idx;
$sql_str = "INSERT INTO contract_new_apply_pays (contract_apply_id, mid, pay_kind, pay_scale, pay_amount, pay_period, condition_date, created_at, created_by) VALUES (:contract_apply_id, :mid, :pay_kind, :pay_scale, :pay_amount, :pay_period, :condition_date, :created_at, :created_by)";
$stmt = $conn -> prepare($sql_str);
$stmt ->bindParam(':contract_apply_id', $contract_apply_id);
$stmt ->bindParam(':mid', $mid);
$stmt ->bindParam(':pay_kind', $kind);
$stmt ->bindParam(':pay_scale', $pay['scale']);
$stmt ->bindParam(':pay_amount', $pay['amount']);
$stmt ->bindParam(':pay_period', $pay['pay_period']);
$stmt ->bindParam(':condition_date', $pay['condition_date']);
$stmt ->bindParam(':created_at', $created_at); $stmt ->bindParam(':created_at', $created_at);
$stmt ->bindParam(':created_by', $created_by); $stmt ->bindParam(':created_by', $created_by);
$stmt ->execute(); $stmt ->execute();
}
header("HTTP/1.1 201 success!");
$conn->commit();
}else{
$sql_str = "UPDATE contract_new_apply SET status = :status, apply_date=:apply_date, apply_type=:apply_type, case_name=:case_name, customer=:customer, manager=:manager, vat=:vat, total_price=:total_price, buy_fee=:buy_fee, install_fee=:install_fee, contact_address=:contact_address, trade_address=:trade_address, workdeadline_a=:workdeadline_a, workdeadline_b=:workdeadline_b, test_time=:test_time, freedeadline=:freedeadline, trade_address=:trade_address, trade_address=:trade_address, tradedeadline=:tradedeadline, progress=:progress, person=:person, personname=:personname, submit_date=:submit_date, updated_at=:updated_at, updated_by=:updated_by WHERE mid = :mid";
$stmt = $conn -> prepare($sql_str);
$stmt ->bindParam(':mid', $mid);
$stmt ->bindParam(':status', $status);
$stmt ->bindParam(':apply_date', $apply_date);
$stmt ->bindParam(':apply_type', $apply_type);
$stmt ->bindParam(':case_name', $case_name);
$stmt ->bindParam(':customer', $customer);
$stmt ->bindParam(':manager', $manager);
$stmt ->bindParam(':vat', $vat);
$stmt ->bindParam(':total_price', $total_price);
$stmt ->bindParam(':buy_fee', $buy_fee);
$stmt ->bindParam(':install_fee', $install_fee);
$stmt ->bindParam(':contact_address', $contact_address);
$stmt ->bindParam(':workdeadline_a', $workdeadline_a);
$stmt ->bindParam(':workdeadline_b', $workdeadline_b);
$stmt ->bindParam(':test_time', $test_time);
$stmt ->bindParam(':freedeadline', $freedeadline);
$stmt ->bindParam(':trade_address', $trade_address);
$stmt ->bindParam(':tradedeadline', $tradedeadline);
$stmt ->bindParam(':progress', $progress);
$stmt ->bindParam(':person', $salesman);
$stmt ->bindParam(':personname', $salesmanname);
$stmt ->bindParam(':submit_date', $submit_date);
$stmt ->bindParam(':updated_at', $updated_at);
$stmt ->bindParam(':updated_by', $updated_by);
$stmt ->execute();
foreach($pays as $idx=>$pay){
$kind = $idx;
$sql_str = "UPDATE contract_new_apply_pays SET pay_scale = :pay_scale, pay_amount = :pay_amount, pay_period = :pay_period, condition_date = :condition_date, updated_at = :updated_at, updated_by = :updated_by WHERE mid = :mid AND pay_kind = :pay_kind";
$stmt = $conn -> prepare($sql_str);
$stmt ->bindParam(':mid', $mid);
$stmt ->bindParam(':pay_kind', $kind);
$stmt ->bindParam(':pay_scale', $pay['scale']);
$stmt ->bindParam(':pay_amount', $pay['amount']);
$stmt ->bindParam(':pay_period', $pay['pay_period']);
$stmt ->bindParam(':condition_date', $pay['condition_date']);
$stmt ->bindParam(':updated_at', $updated_at);
$stmt ->bindParam(':updated_by', $updated_by);
$stmt ->execute();
}
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!");
echo $e->getMessage(); echo $e->getMessage();
die('Error!:'.$e->getMessage()); die('Error!:'.$e->getMessage());
} }
} }
//結案同意
if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 3) ){
$status = $_POST['status'];
$vol_no = $_POST['vol_no'];
$contract_new_apply_id = $_POST['contract_new_apply_id'];
$progress = $_POST['progress'];
$review_comment = $_POST['review_comment'];
$user_id = $_POST['review_person_id'];
$review_date = date('Y-m-d H:i:s');
$conn->beginTransaction();
try{
$sql_str = "UPDATE contract_new_apply SET status = :status, progress = :progress, review_comment=:review_comment, review_person_id=:review_person_id, review_date=:review_date WHERE id = :contract_new_apply_id";
$stmt = $conn -> prepare($sql_str);
$stmt ->bindParam(':status', $status);
$stmt ->bindParam(':progress', $progress);
$stmt ->bindParam(':contract_new_apply_id', $contract_new_apply_id);
$stmt ->bindParam(':review_comment', $review_comment);
$stmt ->bindParam(':review_person_id', $user_id);
$stmt ->bindParam(':review_date', $review_date);
$stmt->execute();
header("HTTP/1.1 200 success!");
$conn->commit();
}catch(PDOException $e){
$conn->rollback();
header("HTTP/1.1 500 failed!");
echo $e->getMessage();
die('Error!:'.$e->getMessage());
}
}
//結案不同意(退回)
if(isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == 2) ){
$status = $_POST['status'];
$vol_no = $_POST['vol_no'];
$contract_new_apply_id = $_POST['contract_new_apply_id'];
$progress = $_POST['progress'];
$review_comment = $_POST['review_comment'];
$user_id = $_POST['review_person_id'];
$review_date = date('Y-m-d H:i:s');
$conn->beginTransaction();
try{
$sql_str = "UPDATE contract_new_apply SET status = :status, progress = :progress, review_comment=:review_comment, review_person_id=:review_person_id, review_date=:review_date WHERE id = :contract_new_apply_id";
$stmt = $conn -> prepare($sql_str);
$stmt ->bindParam(':status', $status);
$stmt ->bindParam(':progress', $progress);
$stmt ->bindParam(':contract_new_apply_id', $contract_new_apply_id);
$stmt ->bindParam(':review_comment', $review_comment);
$stmt ->bindParam(':review_person_id', $user_id);
$stmt ->bindParam(':review_date', $review_date);
$stmt->execute();
header("HTTP/1.1 200 success!");
$conn->commit();
}catch(PDOException $e){
$conn->rollback();
header("HTTP/1.1 500 failed!");
echo $e->getMessage();
die('Error!:'.$e->getMessage());
}
}

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

@ -9,17 +9,15 @@ if(!(isset($_GET['id']) && !empty($_GET['id']))){
} }
$id = $_GET["id"]; $id = $_GET["id"];
$sql_str = "SELECT * FROM contract_new_apply WHERE mid = :mid"; $sql_str = "SELECT contract_new_apply.*, account.name as review_person_name FROM contract_new_apply LEFT JOIN account ON contract_new_apply.review_person_id = account.accountid WHERE contract_new_apply.mid = :mid";
$stmt = $conn->prepare($sql_str); $stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid',$id); $stmt->bindParam(':mid',$id);
$stmt->execute(); $stmt->execute();
$contract_new_apply = $stmt->fetch(PDO::FETCH_ASSOC); $contract_new_apply = $stmt->fetch(PDO::FETCH_ASSOC);
$contract = $contract_new_apply; $contract = $contract_new_apply;
$isFirst = empty($contract_new_apply) ? 1 : 0;
if(empty($contract_new_apply)){ if(empty($contract_new_apply)){
$sql_str = "SELECT pricereview_main.*, pricereview_main.id as mainid, account.name as accountname $sql_str = "SELECT pricereview_main.contractno, pricereview_main.ekind, pricereview_main.person, pricereview_main.company, pricereview_main.case_name, pricereview_main.address, pricereview_main.price_lowest, pricereview_main.price_total, pricereview_main.price_rate, pricereview_main.status as priceview_status, pricereview_main.id as mainid, account.name as accountname
FROM pricereview_main FROM pricereview_main
JOIN account ON pricereview_main.person = account.accountid JOIN account ON pricereview_main.person = account.accountid
WHERE pricereview_main.id = :id"; WHERE pricereview_main.id = :id";
@ -49,39 +47,58 @@ if(empty($contract_new_apply)){
$items = $stmt->fetchAll(PDO::FETCH_ASSOC); $items = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($items); print_r($items);
$sql_str = "SELECT * FROM pricereview_pay WHERE mid = :mid ORDER BY pay_kind ASC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $mid);
$stmt->execute();
$pays = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($pays);
$price_a = 0;
$price_b = 0;
foreach($pays as $pay){
if($pay['pay_kind'] <= 4){
$price_a = $price_a + $pay['pay_amount'];
}else{
$price_b = $price_b + $pay['pay_amount'];
}
}
}else{ }else{
$mid = $contract['mid']; $mid = $contract['mid'];
echo "\$contract['contractno']===>". $contract['contractno'] . "<br>"; // echo "\$contract['contractno']===>". $contract['contractno'] . "<br>";
echo "\$contract['person']===>". $contract['person'] . "<br>"; // echo "\$contract['person']===>". $contract['person'] . "<br>";
echo "\$contract['personname']===>". $contract['personname'] . "<br>"; // echo "\$contract['personname']===>". $contract['personname'] . "<br>";
echo "\date('Y-m-d')===>". date('Y-m-d') . "<br>"; // echo "\date('Y-m-d')===>". date('Y-m-d') . "<br>";
echo "\$contract['case_name']===>". $contract['case_name'] . "<br>"; // echo "\$contract['case_name']===>". $contract['case_name'] . "<br>";
echo "\$contract['customer']===>". $contract['customer'] . "<br>"; // echo "\$contract['customer']===>". $contract['customer'] . "<br>";
echo "\$contract['manager']===>". $contract['manager'] . "<br>"; // echo "\$contract['manager']===>". $contract['manager'] . "<br>";
echo "\$contract['vat']===>". $contract['vat'] . "<br>"; // echo "\$contract['vat']===>". $contract['vat'] . "<br>";
echo "\$contract['total_price']===>". $contract['total_price'] . "<br>"; // echo "\$contract['total_price']===>". $contract['total_price'] . "<br>";
echo "\$contract['contact_address']===>". $contract['contact_address'] . "<br>"; // echo "\$contract['contact_address']===>". $contract['contact_address'] . "<br>";
echo "\$contract['buy_fee']===>". $contract['buy_fee'] . "<br>"; // echo "\$contract['buy_fee']===>". $contract['buy_fee'] . "<br>";
echo "\$contract['install_fee']===>". $contract['install_fee'] . "<br>"; // echo "\$contract['install_fee']===>". $contract['install_fee'] . "<br>";
echo "\json_encode(\$items)===>". json_encode($items) . "<br>"; // echo "\json_encode(\$items)===>". json_encode($items) . "<br>";
echo "\$user_id===>". $user_id . "<br>"; // echo "\$user_id===>". $user_id . "<br>";
echo "\$_GET['id']===>". $_GET['id'] . "<br>"; // echo "\$_GET['id']===>". $_GET['id'] . "<br>";
} $contract_new_apply_id = $contract_new_apply['id'];
$sql_str = "SELECT * FROM pricereview_pay WHERE mid = :mid ORDER BY pay_kind ASC"; $sql_str = "SELECT * FROM contract_new_apply_pays WHERE mid = :mid ORDER BY pay_kind ASC";
$stmt = $conn->prepare($sql_str); $stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $mid); $stmt->bindParam(':mid', $mid);
$stmt->execute(); $stmt->execute();
$pays = $stmt->fetchAll(PDO::FETCH_ASSOC); $pays = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($pays); $price_a = 0;
$price_a = 0; $price_b = 0;
$price_b = 0; foreach($pays as $pay){
foreach($pays as $pay){
if($pay['pay_kind'] <= 4){ if($pay['pay_kind'] <= 4){
$price_a = $price_a + $pay['pay_amount']; $price_a = $price_a + $pay['pay_amount'];
}else{ }else{
$price_b = $price_b + $pay['pay_amount']; $price_b = $price_b + $pay['pay_amount'];
} }
}
} }
$status = isset($contract['status']) ? $contract['status'] : -1;
?> ?>
<link rel="stylesheet" href="./styles/style.css"> <link rel="stylesheet" href="./styles/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
@ -120,7 +137,7 @@ foreach($pays as $pay){
<td style="vertical-align: middle">統一編號</td> <td style="vertical-align: middle">統一編號</td>
<td> <td>
<input class="form-control disabled_select" type="text" x-model="data.vat" > <input class="form-control disabled_select" type="text" x-model="data.vat" >
<p class="alerttext" x-show="data.salesman==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p> <p class="alerttext" x-show="data.vat==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td> </td>
<td style="vertical-align: middle">合約書申請日期</td> <td style="vertical-align: middle">合約書申請日期</td>
<td> <td>
@ -414,48 +431,60 @@ foreach($pays as $pay){
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td style="font-weight:bold">業務部協理</td> <td>審核</td>
<td>審核人</td>
<td>結果</td>
<td colspan=2>意見</td>
<td>時間</td>
<td colspan=2><?php if($user_id === "M0174" && $status == 1): ?>審核意見<?php endif; ?></td>
</tr>
<tr>
<td>營業員</td>
<td><span x-text="data.salesmanname + '(' + data.salesman + ')'"></span></td>
<td> <td>
<template x-if="false"> <?php if($status >= 1): ?><span class="successtext">已送審</span><?php endif; ?>
<span class="failtext">已退件</span> <?php if($status == 0): ?><span class="readtext">暫存</span><?php endif; ?>
</template> <?php if($status == -1): ?><span class="">未提交</span><?php endif; ?>
<template x-if="false">
<span class="readtext">審核中</span>
</template>
<template x-if="false">
<span class="successtext">已通過</span>
</template>
</td> </td>
<td style="font-weight:bold">業務部承辦人</td> <td colspan=2>---</td>
<td> <td><?php echo $contract['submit_date']; ?> </td>
<template x-if="false"> <td colspan=2 rowspan="2">
<span class="failtext">已退件</span> <?php if($user_id === "M0174" && $status == 1): ?>
</template> <textarea class="form-control opinion" x-model="data.review_comment"></textarea>
<template x-if="false"> <?php endif; ?>
<span class="readtext">審核中</span>
</template>
<template x-if="false">
<span class="successtext">已通過</span>
</template>
</td> </td>
<td style="font-weight:bold">營業經理</td> </tr>
<tr>
<td>業務承辦人</td>
<td><span><?php echo ($contract['review_person_name'] == "" || $contract['review_person_name'] == null || empty($contract['review_person_name'])) ? "---" : $contract['review_person_name'] ."(".$contract['review_person_id'].")"; ?></span></td>
<td> <td>
<?php if($status == 3): ?><span class="successtext">結案同意</span><?php endif; ?>
<?php if($status == 2): ?><span class="failtext">結案不同意</span><?php endif; ?>
</td>
<td colspan=2><?php echo $contract['review_comment']; ?></td>
<td><?php echo $contract['review_date']; ?></td>
</tr>
<!-- <tr>
<td colspan="2" style="font-weight:bold">業務部承辦人</td>
<td colspan="2">
<template x-if="false"> <template x-if="false">
<span class="failtext">已退件</span> <span class="failtext">已退件</span>
</template> </template>
<template x-if="false"> <?php if($status == 1): ?>
<span class="readtext">審核中</span> <span class="readtext">審核中...</span>
</template> <?php endif; ?>
<template x-if="false"> <template x-if="false">
<span class="successtext">已通過</span> <span class="successtext">已通過</span>
</template> </template>
</td> </td>
<td style="font-weight:bold">營業員</td> <td colspan="2" style="font-weight:bold">營業員</td>
<td><span x-text="data.salesmanname + '(' + data.salesman + ')'"></span></td> <td colspan="2"><span x-text="data.salesmanname + '(' + data.salesman + ')'"></span></td>
</tr> </tr> -->
</tbody> </tbody>
</table> </table>
<button x-show="true" x-on:click="" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn"> <button @click="window.history.go(-1)" type="button" class="btn btn-primary btn-lg pull-right savebtn" >回前頁</button>
<?php if($isFirst == 1 || ($isFirst==0 && $status == 0) ): ?>
<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>送審</span>
</template> </template>
@ -471,6 +500,25 @@ foreach($pays as $pay){
<div class="loader"></div> <div class="loader"></div>
</template> </template>
</button> </button>
<?php endif; ?>
<?php if($status == 1 && ($user_id == "M0107" || $user_id == "M0174")): ?>
<button x-show="true" x-on:click="agree()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading">
<span>同意(結案)</span>
</template>
<template x-if="isLoading">
<div class="loader"></div>
</template>
</button>
<button x-show="true" x-on:click="disagree()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading">
<span>不同意(退回)</span>
</template>
<template x-if="isLoading">
<div class="loader"></div>
</template>
</button>
<?php endif; ?>
</div> </div>
</div> </div>
</div> </div>
@ -496,10 +544,16 @@ foreach($pays as $pay){
const user_id = '<?php echo $user_id ?>'; const user_id = '<?php echo $user_id ?>';
const mid = '<?php echo $_GET['id']; ?>'; const mid = '<?php echo $_GET['id']; ?>';
const pays = [...<?php echo json_encode($pays); ?>]; const pays = [...<?php echo json_encode($pays); ?>];
const tradeaddress = "";
const tradedeadline = 90
const freedeadline = 18;
const regulations = 10;
const workdeadline_a = 30;
const workdeadline_b = 7;
const isFirst = <?php echo $isFirst; ?>;
</script> </script>
<?php else: ?> <?php else: ?>
<script> <script>
alert('123')
const contractno = '<?php echo $contract['contractno'] ?>'; const contractno = '<?php echo $contract['contractno'] ?>';
const salesman = '<?php echo $contract['person'] ?>'; const salesman = '<?php echo $contract['person'] ?>';
const salesmanname = '<?php echo $contract['personname'] ?>'; const salesmanname = '<?php echo $contract['personname'] ?>';
@ -517,6 +571,28 @@ foreach($pays as $pay){
const user_id = '<?php echo $user_id ?>'; const user_id = '<?php echo $user_id ?>';
const mid = '<?php echo $_GET['id']; ?>'; const mid = '<?php echo $_GET['id']; ?>';
const pays = [...<?php echo json_encode($pays); ?>]; const pays = [...<?php echo json_encode($pays); ?>];
const isFirst = <?php echo $isFirst; ?>;
const tradeaddress = '<?php echo $contract['trade_address'] ?>';
const tradedeadline = '<?php echo $contract['tradedeadline'] ?>';
const freedeadline = '<?php echo $contract['freedeadline'] ?>';
const regulations = '<?php echo $contract['test_time'] ?>';
const workdeadline_a = '<?php echo $contract['workdeadline_a'] ?>';
const workdeadline_b = '<?php echo $contract['workdeadline_b'] ?>';
const contract_new_apply_id = <?php echo $contract_new_apply_id; ?>;
</script>
<?php if($status > 0): ?>
<script>
const input = document.querySelectorAll('input');
for(let i=0;i<input.length;i++){
input[i].disabled = true
}
const select = document.querySelectorAll('select');
for(let i=0;i<select.length;i++){
select[i].disabled = true
}
</script> </script>
<?php endif; ?> <?php endif; ?>
<?php endif; ?>

121
wms/contract/js/alpine.js

@ -1181,7 +1181,6 @@ const contractNewApply = ()=>{
this.pays[idx+1].scale = (pay.pay_scale == "" || pay.pay_scale == null) ? 0 : pay.pay_scale; this.pays[idx+1].scale = (pay.pay_scale == "" || pay.pay_scale == null) ? 0 : pay.pay_scale;
this.pays[idx+1].amount = (pay.pay_amount == "" || pay.pay_amount == null) ? 0: pay.pay_amount; this.pays[idx+1].amount = (pay.pay_amount == "" || pay.pay_amount == null) ? 0: pay.pay_amount;
}) })
console.log(this.pays);
}, },
step:1, step:1,
isLoading:false, isLoading:false,
@ -1200,13 +1199,15 @@ const contractNewApply = ()=>{
price_a: price_a, price_a: price_a,
price_b: price_b, price_b: price_b,
address: address, address: address,
workdeadline_a:30, //完工期限: 幾天內安裝完成,預設30 workdeadline_a:workdeadline_a, //完工期限: 幾天內安裝完成,預設30
workdeadline_b:7, //完工期限: 幾天內整理完善,預設7 workdeadline_b:workdeadline_b, //完工期限: 幾天內整理完善,預設7
regulations:10, //附則 regulations:regulations, //附則
freedeadline:18, //免保期限(月) freedeadline:freedeadline, //免保期限(月)
tradeaddress:'', //交貨地點 tradeaddress:tradeaddress, //交貨地點
tradedeadline: 90, //交貨期限 tradedeadline: tradedeadline, //交貨期限
items: items, items: items,
salesman_comment:'',
review_comment:'',
}, },
pays:{ pays:{
1:{ 1:{
@ -1257,11 +1258,11 @@ const contractNewApply = ()=>{
}, },
storageFn(){ storageFn(){
this.isLoading = true this.isLoading = true
const isFirst = 1;
const form = new FormData(); const form = new FormData();
form.append('mid', this.data.mid); form.append('mid', this.data.mid);
form.append('vol_no', this.data.vol_no); form.append('vol_no', this.data.vol_no);
form.append('salesman', this.data.salesman); form.append('salesman', this.data.salesman);
form.append('salesmanname', this.data.salesmanname);
form.append('apply_date', this.data.apply_date); form.append('apply_date', this.data.apply_date);
form.append('apply_type', this.data.apply_type); form.append('apply_type', this.data.apply_type);
form.append('case_name', this.data.case_name); form.append('case_name', this.data.case_name);
@ -1280,16 +1281,118 @@ const contractNewApply = ()=>{
form.append('tradedeadline', this.data.tradedeadline); form.append('tradedeadline', this.data.tradedeadline);
form.append('isFirst', isFirst); form.append('isFirst', isFirst);
form.append('user_id', user_id); form.append('user_id', user_id);
form.append('pays', JSON.stringify(this.pays));
form.append('status', 0);
form.append('salesman_comment', this.data.salesman_comment);
axios.post('./api/postContractNewApplyData.php', form).then(res=>{ axios.post('./api/postContractNewApplyData.php', form).then(res=>{
if(res.status === 200){ if(res.status === 201){
alert('暫存成功'); alert('暫存成功');
console.log(res.data); console.log(res.data);
window.location.reload();
}else if(res.status === 200){
alert('更新成功');
console.log(res.data);
window.location.reload();
} }
this.isLoading = false this.isLoading = false
}).catch(error=>{ }).catch(error=>{
alert('儲存失敗!可能為以下錯誤:\n' + error.response.data) alert('儲存失敗!可能為以下錯誤:\n' + error.response.data)
this.isLoading = false this.isLoading = false
}) })
},
submit(){
if(!confirm("確定送審嗎?")){
return;
}
this.isLoading = true
const form = new FormData();
form.append('mid', this.data.mid);
form.append('vol_no', this.data.vol_no);
form.append('salesman', this.data.salesman);
form.append('salesmanname', this.data.salesmanname);
form.append('apply_date', this.data.apply_date);
form.append('apply_type', this.data.apply_type);
form.append('case_name', this.data.case_name);
form.append('company', this.data.company);
form.append('manager', this.data.manager);
form.append('vat', this.data.vat);
form.append('total_price', this.data.total_price);
form.append('price_a', this.data.price_a);
form.append('price_b', this.data.price_b);
form.append('address', this.data.address);
form.append('workdeadline_a', this.data.workdeadline_a);
form.append('workdeadline_b', this.data.workdeadline_b);
form.append('regulations', this.data.regulations);
form.append('freedeadline', this.data.freedeadline);
form.append('tradeaddress', this.data.tradeaddress);
form.append('tradedeadline', this.data.tradedeadline);
form.append('isFirst', isFirst);
form.append('user_id', user_id);
form.append('pays', JSON.stringify(this.pays));
form.append('status', 1);
form.append('review_comment', this.data.review_comment);
axios.post('./api/postContractNewApplyData.php', form).then(res=>{
console.log(res.data);
if(res.status === 201){
alert('送審成功');
console.log(res.data);
window.location.reload();
}
this.isLoading = false
}).catch(error=>{
alert('送審失敗!可能為以下錯誤:\n' + error.response.data)
this.isLoading = false
})
},
agree(){
if(!confirm("確定同意嗎?")){
return;
}
this.isLoading = true
const form = new FormData();
form.append('contract_new_apply_id', contract_new_apply_id);
form.append('vol_no', this.data.vol_no);
form.append('status', 3);
form.append('review_comment', this.data.review_comment);
form.append('review_person_id', user_id);
form.append('progress', 2);
axios.post('./api/postContractNewApplyData.php', form).then(res=>{
if(res.status === 200){
alert('審核成功');
console.log(res.data);
console.log(res.status);
window.location.reload();
}
this.isLoading = false
}).catch(error=>{
alert('審核失敗!可能為以下錯誤:\n' + error.response.data)
this.isLoading = false
})
},
disagree(){
if(!confirm('確定退回嗎?')){
return;
} }
this.isLoading = true
const form = new FormData();
form.append('contract_new_apply_id', contract_new_apply_id);
form.append('vol_no', this.data.vol_no);
form.append('status', 2);
form.append('review_comment', this.data.review_comment);
form.append('review_person_id', user_id);
form.append('progress', 0);
axios.post('./api/postContractNewApplyData.php', form).then(res=>{
if(res.status === 200){
alert('退回成功');
console.log(res.data);
window.location.reload();
}
this.isLoading = false
}).catch(error=>{
alert('退回失敗!可能為以下錯誤:\n' + error.response.data)
this.isLoading = false
})
}
} }
} }

102
wms/contract/styles/style.css

@ -541,27 +541,32 @@ main table td, main table th {
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.contract-input-component .contract-input-component .form, .contract-input-component .contract-management .form, .contract-input-component .contract-new-apply-component .form, .contract-management .contract-input-component .form, .contract-management .contract-management .form, .contract-management .contract-new-apply-component .form, .contract-new-apply-component .contract-input-component .form, .contract-new-apply-component .contract-management .form, .contract-new-apply-component .contract-new-apply-component .form { .contract-input-component, .contract-management, .contract-new-apply-component {
padding-bottom: 25px;
}
.contract-input-component .form, .contract-management .form, .contract-new-apply-component .form {
margin: 0 auto; margin: 0 auto;
padding-bottom: 50px;
} }
.contract-input-component .contract-input-component .form .dropdown, .contract-input-component .contract-management .form .dropdown, .contract-input-component .contract-new-apply-component .form .dropdown, .contract-management .contract-input-component .form .dropdown, .contract-management .contract-management .form .dropdown, .contract-management .contract-new-apply-component .form .dropdown, .contract-new-apply-component .contract-input-component .form .dropdown, .contract-new-apply-component .contract-management .form .dropdown, .contract-new-apply-component .contract-new-apply-component .form .dropdown { .contract-input-component .form .dropdown, .contract-management .form .dropdown, .contract-new-apply-component .form .dropdown {
width: 100%; width: 100%;
margin-top: 7px; margin-top: 7px;
} }
.contract-input-component .contract-input-component .form .savebtn, .contract-input-component .contract-management .form .savebtn, .contract-input-component .contract-new-apply-component .form .savebtn, .contract-management .contract-input-component .form .savebtn, .contract-management .contract-management .form .savebtn, .contract-management .contract-new-apply-component .form .savebtn, .contract-new-apply-component .contract-input-component .form .savebtn, .contract-new-apply-component .contract-management .form .savebtn, .contract-new-apply-component .contract-new-apply-component .form .savebtn { .contract-input-component .form .savebtn, .contract-management .form .savebtn, .contract-new-apply-component .form .savebtn {
margin-right: 13px; margin-right: 13px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 70px; padding: 10px;
height: 45px; height: 45px;
font-size: 15px; font-size: 15px;
margin-bottom: 20px;
} }
.contract-input-component .contract-input-component .form table .fixed, .contract-input-component .contract-management .form table .fixed, .contract-input-component .contract-new-apply-component .form table .fixed, .contract-management .contract-input-component .form table .fixed, .contract-management .contract-management .form table .fixed, .contract-management .contract-new-apply-component .form table .fixed, .contract-new-apply-component .contract-input-component .form table .fixed, .contract-new-apply-component .contract-management .form table .fixed, .contract-new-apply-component .contract-new-apply-component .form table .fixed { .contract-input-component .form table .fixed, .contract-management .form table .fixed, .contract-new-apply-component .form table .fixed {
padding: 8px 0; padding: 8px 0;
cursor: not-allowed; cursor: not-allowed;
} }
.contract-input-component .contract-input-component .form table .alerttext, .contract-input-component .contract-management .form table .alerttext, .contract-input-component .contract-new-apply-component .form table .alerttext, .contract-management .contract-input-component .form table .alerttext, .contract-management .contract-management .form table .alerttext, .contract-management .contract-new-apply-component .form table .alerttext, .contract-new-apply-component .contract-input-component .form table .alerttext, .contract-new-apply-component .contract-management .form table .alerttext, .contract-new-apply-component .contract-new-apply-component .form table .alerttext { .contract-input-component .form table .alerttext, .contract-management .form table .alerttext, .contract-new-apply-component .form table .alerttext {
font-size: 13px; font-size: 13px;
color: #a00; color: #a00;
font-weight: 500; font-weight: 500;
@ -569,92 +574,91 @@ main table td, main table th {
font-weight: 900; font-weight: 900;
padding: 0; padding: 0;
} }
.contract-input-component .contract-input-component .form input[type=file], .contract-input-component .contract-management .form input[type=file], .contract-input-component .contract-new-apply-component .form input[type=file], .contract-management .contract-input-component .form input[type=file], .contract-management .contract-management .form input[type=file], .contract-management .contract-new-apply-component .form input[type=file], .contract-new-apply-component .contract-input-component .form input[type=file], .contract-new-apply-component .contract-management .form input[type=file], .contract-new-apply-component .contract-new-apply-component .form input[type=file] { .contract-input-component .form table .opinion, .contract-management .form table .opinion, .contract-new-apply-component .form table .opinion {
width: 100%;
min-height: 100px;
resize: vertical;
}
.contract-input-component .form input[type=file], .contract-management .form input[type=file], .contract-new-apply-component .form input[type=file] {
padding: 12px 20px; padding: 12px 20px;
margin: 8px 0; margin: 8px 0;
} }
.contract-input-component .contract-input-component .form span, .contract-input-component .contract-management .form span, .contract-input-component .contract-new-apply-component .form span, .contract-management .contract-input-component .form span, .contract-management .contract-management .form span, .contract-management .contract-new-apply-component .form span, .contract-new-apply-component .contract-input-component .form span, .contract-new-apply-component .contract-management .form span, .contract-new-apply-component .contract-new-apply-component .form span { .contract-input-component .form span, .contract-management .form span, .contract-new-apply-component .form span {
font-weight: 900; font-weight: 900;
} }
.contract-input-component .contract-input-component .form span.successtext, .contract-input-component .contract-management .form span.successtext, .contract-input-component .contract-new-apply-component .form span.successtext, .contract-management .contract-input-component .form span.successtext, .contract-management .contract-management .form span.successtext, .contract-management .contract-new-apply-component .form span.successtext, .contract-new-apply-component .contract-input-component .form span.successtext, .contract-new-apply-component .contract-management .form span.successtext, .contract-new-apply-component .contract-new-apply-component .form span.successtext { .contract-input-component .form span.successtext, .contract-management .form span.successtext, .contract-new-apply-component .form span.successtext {
color: #0a0; color: #0a0;
} }
.contract-input-component .contract-input-component .form span.failtext, .contract-input-component .contract-management .form span.failtext, .contract-input-component .contract-new-apply-component .form span.failtext, .contract-management .contract-input-component .form span.failtext, .contract-management .contract-management .form span.failtext, .contract-management .contract-new-apply-component .form span.failtext, .contract-new-apply-component .contract-input-component .form span.failtext, .contract-new-apply-component .contract-management .form span.failtext, .contract-new-apply-component .contract-new-apply-component .form span.failtext { .contract-input-component .form span.failtext, .contract-management .form span.failtext, .contract-new-apply-component .form span.failtext {
color: #a00; color: #a00;
} }
.contract-input-component .contract-input-component .form span.readtext, .contract-input-component .contract-management .form span.readtext, .contract-input-component .contract-new-apply-component .form span.readtext, .contract-management .contract-input-component .form span.readtext, .contract-management .contract-management .form span.readtext, .contract-management .contract-new-apply-component .form span.readtext, .contract-new-apply-component .contract-input-component .form span.readtext, .contract-new-apply-component .contract-management .form span.readtext, .contract-new-apply-component .contract-new-apply-component .form span.readtext { .contract-input-component .form span.readtext, .contract-management .form span.readtext, .contract-new-apply-component .form span.readtext {
color: #aa0; color: #FF8F6B;
} }
.contract-input-component .contract-input-component .form input[type=number]::-webkit-outer-spin-button, .contract-input-component .form input[type=number]::-webkit-outer-spin-button,
.contract-input-component .contract-input-component .form input[type=number]::-webkit-inner-spin-button, .contract-input-component .contract-management .form input[type=number]::-webkit-outer-spin-button, .contract-input-component .form input[type=number]::-webkit-inner-spin-button, .contract-management .form input[type=number]::-webkit-outer-spin-button,
.contract-input-component .contract-management .form input[type=number]::-webkit-inner-spin-button, .contract-input-component .contract-new-apply-component .form input[type=number]::-webkit-outer-spin-button, .contract-management .form input[type=number]::-webkit-inner-spin-button, .contract-new-apply-component .form input[type=number]::-webkit-outer-spin-button,
.contract-input-component .contract-new-apply-component .form input[type=number]::-webkit-inner-spin-button, .contract-management .contract-input-component .form input[type=number]::-webkit-outer-spin-button, .contract-new-apply-component .form input[type=number]::-webkit-inner-spin-button {
.contract-management .contract-input-component .form input[type=number]::-webkit-inner-spin-button, .contract-management .contract-management .form input[type=number]::-webkit-outer-spin-button,
.contract-management .contract-management .form input[type=number]::-webkit-inner-spin-button, .contract-management .contract-new-apply-component .form input[type=number]::-webkit-outer-spin-button,
.contract-management .contract-new-apply-component .form input[type=number]::-webkit-inner-spin-button, .contract-new-apply-component .contract-input-component .form input[type=number]::-webkit-outer-spin-button,
.contract-new-apply-component .contract-input-component .form input[type=number]::-webkit-inner-spin-button, .contract-new-apply-component .contract-management .form input[type=number]::-webkit-outer-spin-button,
.contract-new-apply-component .contract-management .form input[type=number]::-webkit-inner-spin-button, .contract-new-apply-component .contract-new-apply-component .form input[type=number]::-webkit-outer-spin-button,
.contract-new-apply-component .contract-new-apply-component .form input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none; -webkit-appearance: none;
margin: 0; margin: 0;
} }
.contract-input-component .contract-input-component .form input[type=number], .contract-input-component .contract-management .form input[type=number], .contract-input-component .contract-new-apply-component .form input[type=number], .contract-management .contract-input-component .form input[type=number], .contract-management .contract-management .form input[type=number], .contract-management .contract-new-apply-component .form input[type=number], .contract-new-apply-component .contract-input-component .form input[type=number], .contract-new-apply-component .contract-management .form input[type=number], .contract-new-apply-component .contract-new-apply-component .form input[type=number] { .contract-input-component .form input[type=number], .contract-management .form input[type=number], .contract-new-apply-component .form input[type=number] {
-moz-appearance: textfield; -moz-appearance: textfield;
} }
.contract-input-component .contract-input-component .error, .contract-input-component .contract-management .error, .contract-input-component .contract-new-apply-component .error, .contract-management .contract-input-component .error, .contract-management .contract-management .error, .contract-management .contract-new-apply-component .error, .contract-new-apply-component .contract-input-component .error, .contract-new-apply-component .contract-management .error, .contract-new-apply-component .contract-new-apply-component .error { .contract-input-component .error, .contract-management .error, .contract-new-apply-component .error {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 15px; margin: 15px;
} }
.contract-input-component .contract-input-component .error .errortext, .contract-input-component .contract-management .error .errortext, .contract-input-component .contract-new-apply-component .error .errortext, .contract-management .contract-input-component .error .errortext, .contract-management .contract-management .error .errortext, .contract-management .contract-new-apply-component .error .errortext, .contract-new-apply-component .contract-input-component .error .errortext, .contract-new-apply-component .contract-management .error .errortext, .contract-new-apply-component .contract-new-apply-component .error .errortext { .contract-input-component .error .errortext, .contract-management .error .errortext, .contract-new-apply-component .error .errortext {
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
color: #a00; color: #a00;
} }
.contract-input-component .contract-input-component .input-group-btn, .contract-input-component .contract-management .input-group-btn, .contract-input-component .contract-new-apply-component .input-group-btn, .contract-management .contract-input-component .input-group-btn, .contract-management .contract-management .input-group-btn, .contract-management .contract-new-apply-component .input-group-btn, .contract-new-apply-component .contract-input-component .input-group-btn, .contract-new-apply-component .contract-management .input-group-btn, .contract-new-apply-component .contract-new-apply-component .input-group-btn { .contract-input-component .input-group-btn, .contract-management .input-group-btn, .contract-new-apply-component .input-group-btn {
font-size: 16px; font-size: 16px;
} }
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
.contract-input-component .contract-input-component table, .contract-input-component .contract-management table, .contract-input-component .contract-new-apply-component table, .contract-management .contract-input-component table, .contract-management .contract-management table, .contract-management .contract-new-apply-component table, .contract-new-apply-component .contract-input-component table, .contract-new-apply-component .contract-management table, .contract-new-apply-component .contract-new-apply-component table { .contract-input-component table, .contract-management table, .contract-new-apply-component table {
border: 0; border: 0;
} }
.contract-input-component .contract-input-component table thead, .contract-input-component .contract-management table thead, .contract-input-component .contract-new-apply-component table thead, .contract-management .contract-input-component table thead, .contract-management .contract-management table thead, .contract-management .contract-new-apply-component table thead, .contract-new-apply-component .contract-input-component table thead, .contract-new-apply-component .contract-management table thead, .contract-new-apply-component .contract-new-apply-component table thead { .contract-input-component table thead, .contract-management table thead, .contract-new-apply-component table thead {
display: none; display: none;
} }
.contract-input-component .contract-input-component table tr, .contract-input-component .contract-management table tr, .contract-input-component .contract-new-apply-component table tr, .contract-management .contract-input-component table tr, .contract-management .contract-management table tr, .contract-management .contract-new-apply-component table tr, .contract-new-apply-component .contract-input-component table tr, .contract-new-apply-component .contract-management table tr, .contract-new-apply-component .contract-new-apply-component table tr { .contract-input-component table tr, .contract-management table tr, .contract-new-apply-component table tr {
margin-bottom: 10px; margin-bottom: 10px;
display: block; display: block;
border-bottom: 2px solid #ddd; border-bottom: 2px solid #ddd;
} }
.contract-input-component .contract-input-component table td, .contract-input-component .contract-management table td, .contract-input-component .contract-new-apply-component table td, .contract-management .contract-input-component table td, .contract-management .contract-management table td, .contract-management .contract-new-apply-component table td, .contract-new-apply-component .contract-input-component table td, .contract-new-apply-component .contract-management table td, .contract-new-apply-component .contract-new-apply-component table td { .contract-input-component table td, .contract-management table td, .contract-new-apply-component table td {
display: block; display: block;
text-align: left; text-align: left;
font-size: 14px; font-size: 14px;
border-bottom: 1px dotted #ccc; border-bottom: 1px dotted #ccc;
} }
.contract-input-component .contract-input-component table td:last-child, .contract-input-component .contract-management table td:last-child, .contract-input-component .contract-new-apply-component table td:last-child, .contract-management .contract-input-component table td:last-child, .contract-management .contract-management table td:last-child, .contract-management .contract-new-apply-component table td:last-child, .contract-new-apply-component .contract-input-component table td:last-child, .contract-new-apply-component .contract-management table td:last-child, .contract-new-apply-component .contract-new-apply-component table td:last-child { .contract-input-component table td:last-child, .contract-management table td:last-child, .contract-new-apply-component table td:last-child {
border-bottom: 0; border-bottom: 0;
} }
.contract-input-component .contract-input-component table td:before, .contract-input-component .contract-management table td:before, .contract-input-component .contract-new-apply-component table td:before, .contract-management .contract-input-component table td:before, .contract-management .contract-management table td:before, .contract-management .contract-new-apply-component table td:before, .contract-new-apply-component .contract-input-component table td:before, .contract-new-apply-component .contract-management table td:before, .contract-new-apply-component .contract-new-apply-component table td:before { .contract-input-component table td:before, .contract-management table td:before, .contract-new-apply-component table td:before {
content: attr(data-label); content: attr(data-label);
float: left; float: left;
text-transform: uppercase; text-transform: uppercase;
font-weight: bold; font-weight: bold;
} }
} }
.contract-input-component .contract-input-component .images, .contract-input-component .contract-management .images, .contract-input-component .contract-new-apply-component .images, .contract-management .contract-input-component .images, .contract-management .contract-management .images, .contract-management .contract-new-apply-component .images, .contract-new-apply-component .contract-input-component .images, .contract-new-apply-component .contract-management .images, .contract-new-apply-component .contract-new-apply-component .images { .contract-input-component .images, .contract-management .images, .contract-new-apply-component .images {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
padding: 20px; padding: 20px;
} }
.contract-input-component .contract-input-component .images > .image, .contract-input-component .contract-management .images > .image, .contract-input-component .contract-new-apply-component .images > .image, .contract-management .contract-input-component .images > .image, .contract-management .contract-management .images > .image, .contract-management .contract-new-apply-component .images > .image, .contract-new-apply-component .contract-input-component .images > .image, .contract-new-apply-component .contract-management .images > .image, .contract-new-apply-component .contract-new-apply-component .images > .image { .contract-input-component .images > .image, .contract-management .images > .image, .contract-new-apply-component .images > .image {
position: relative; position: relative;
margin: 10px; margin: 10px;
} }
.contract-input-component .contract-input-component .images > .image:hover > i, .contract-input-component .contract-management .images > .image:hover > i, .contract-input-component .contract-new-apply-component .images > .image:hover > i, .contract-management .contract-input-component .images > .image:hover > i, .contract-management .contract-management .images > .image:hover > i, .contract-management .contract-new-apply-component .images > .image:hover > i, .contract-new-apply-component .contract-input-component .images > .image:hover > i, .contract-new-apply-component .contract-management .images > .image:hover > i, .contract-new-apply-component .contract-new-apply-component .images > .image:hover > i { .contract-input-component .images > .image:hover > i, .contract-management .images > .image:hover > i, .contract-new-apply-component .images > .image:hover > i {
opacity: 1; opacity: 1;
} }
.contract-input-component .contract-input-component .images > .image > i, .contract-input-component .contract-management .images > .image > i, .contract-input-component .contract-new-apply-component .images > .image > i, .contract-management .contract-input-component .images > .image > i, .contract-management .contract-management .images > .image > i, .contract-management .contract-new-apply-component .images > .image > i, .contract-new-apply-component .contract-input-component .images > .image > i, .contract-new-apply-component .contract-management .images > .image > i, .contract-new-apply-component .contract-new-apply-component .images > .image > i { .contract-input-component .images > .image > i, .contract-management .images > .image > i, .contract-new-apply-component .images > .image > i {
position: absolute; position: absolute;
top: -12px; top: -12px;
right: -12px; right: -12px;
@ -663,29 +667,37 @@ main table td, main table th {
opacity: 0; opacity: 0;
transition: 0.3s; transition: 0.3s;
} }
.contract-input-component table, .contract-management table, .contract-new-apply-component table {
table {
table-layout: fixed; table-layout: fixed;
width: 100%; width: 100%;
} }
.contract-input-component td, .contract-management td, .contract-new-apply-component td {
td {
word-wrap: break-word; word-wrap: break-word;
} }
.contract-input-component img, .contract-management img, .contract-new-apply-component img {
img {
width: 125px; width: 125px;
} }
.contract-input-component .width_style_1, .contract-management .width_style_1, .contract-new-apply-component .width_style_1 {
.width_style_1 {
width: 125px; width: 125px;
} }
.contract-input-component table, .contract-management table, .contract-new-apply-component table {
table {
width: 100%; width: 100%;
} }
.contract-input-component #table_index_filter, .contract-management #table_index_filter, .contract-new-apply-component #table_index_filter {
#table_index_filter {
float: right; float: right;
} }
.contract-input-component #table_index_paginate, .contract-management #table_index_paginate, .contract-new-apply-component #table_index_paginate {
#table_index_paginate {
float: right; float: right;
} }
.contract-input-component label, .contract-management label, .contract-new-apply-component label {
label {
display: inline-flex; display: inline-flex;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
margin-top: 0.5rem; margin-top: 0.5rem;

2
wms/contract/styles/style.css.map

File diff suppressed because one or more lines are too long

14
wms/contract/styles/style.scss

@ -563,9 +563,10 @@ main{
100% { transform: rotate(360deg); } 100% { transform: rotate(360deg); }
} }
.contract-input-component, .contract-management, .contract-new-apply-component{ .contract-input-component, .contract-management, .contract-new-apply-component{
.contract-input-component, .contract-management, .contract-new-apply-component{ padding-bottom: 25px;
.form{ .form{
margin:0 auto; margin:0 auto;
padding-bottom: 50px;
.dropdown{ .dropdown{
width:100%; width:100%;
margin-top: 7px; margin-top: 7px;
@ -575,9 +576,10 @@ main{
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width:70px; padding: 10px;
height: 45px; height: 45px;
font-size: 15px; font-size: 15px;
margin-bottom: 20px;
} }
table{ table{
.fixed{ .fixed{
@ -592,6 +594,11 @@ main{
font-weight: 900; font-weight: 900;
padding: 0; padding: 0;
} }
.opinion{
width:100%;
min-height: 100px;
resize: vertical;
}
} }
input[type="file"]{ input[type="file"]{
padding: 12px 20px; padding: 12px 20px;
@ -606,7 +613,7 @@ main{
color:#a00; color:#a00;
} }
&.readtext{ &.readtext{
color:#aa0; color:#FF8F6B;
} }
} }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-outer-spin-button,
@ -719,4 +726,3 @@ label {
margin-bottom: .5rem; margin-bottom: .5rem;
margin-top: .5rem; margin-top: .5rem;
} }
}

8
wms/mkt/price_option-index.php

@ -57,6 +57,9 @@ $optional_arr = [1=>'標', 2=>'選'];
<th scope="col" nowrap>配置</th> <th scope="col" nowrap>配置</th>
<th scope="col" nowrap>單位</th> <th scope="col" nowrap>單位</th>
<th scope="col" nowrap>定價</th> <th scope="col" nowrap>定價</th>
<?php if($user_id == 'M0174'||$user_id == 'M0107'): ?>
<th scope="col" nowrap>MI</th>
<?php endif; ?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -72,7 +75,10 @@ $optional_arr = [1=>'標', 2=>'選'];
<td x-text="option.memo"></td> <td x-text="option.memo"></td>
<td x-text="options_arr[option.optional]"></td> <td x-text="options_arr[option.optional]"></td>
<td x-text="option.unit"></td> <td x-text="option.unit"></td>
<td x-html="option.price!=null ? Number(option.price).toLocaleString() : ''"></td> <td x-html="option.price!=null ? '$'+Number(option.price).toLocaleString() : ''"></td>
<?php if($user_id == 'M0174'||$user_id == 'M0107'): ?>
<td x-html="option.mi!=null ? '$'+Number(option.mi).toLocaleString() : ''"></td>
<?php endif; ?>
</tr> </tr>
</template> </template>
</table> </table>

11
wms/mkt/price_option-select.php

@ -1,7 +1,8 @@
<?php <?php
include "../header.php"; include "../header.php";
require_once('./conn.php'); require_once('./conn.php');
$sql_str = "SELECT * FROM option_price WHERE status = 'Y' ORDER BY kind, id"; $sql_str = "SELECT * FROM option_price WHERE status ='Y'";
$stmt = $conn->prepare($sql_str); $stmt = $conn->prepare($sql_str);
$stmt->execute(); $stmt->execute();
$options = $stmt->fetchAll(PDO::FETCH_ASSOC); $options = $stmt->fetchAll(PDO::FETCH_ASSOC);
@ -54,6 +55,9 @@ $optional_arr = [1=>'標', 2=>'選'];
<th scope="col" nowrap>配置</th> <th scope="col" nowrap>配置</th>
<th scope="col" nowrap>單位</th> <th scope="col" nowrap>單位</th>
<th scope="col" nowrap>定價</th> <th scope="col" nowrap>定價</th>
<?php if($user_id == 'M0174'||$user_id == 'M0107'): ?>
<th scope="col" nowrap>MI</th>
<?php endif; ?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -69,7 +73,10 @@ $optional_arr = [1=>'標', 2=>'選'];
<td x-text="option.memo"></td> <td x-text="option.memo"></td>
<td x-text="options_arr[option.optional]"></td> <td x-text="options_arr[option.optional]"></td>
<td x-text="option.unit"></td> <td x-text="option.unit"></td>
<td x-html="option.price!=null ? Number(option.price).toLocaleString() : ''"></td> <td x-html="option.price!=null ? '$'+Number(option.price).toLocaleString() : ''"></td>
<?php if($user_id == 'M0174'||$user_id == 'M0107'): ?>
<td x-html="option.mi!=null ? '$'+Number(option.mi).toLocaleString() : ''"></td>
<?php endif;?>
</tr> </tr>
</template> </template>
</table> </table>

BIN
wms/mkt/specsurvey-edit.zip

Binary file not shown.
Loading…
Cancel
Save