Browse Source

新梯填價審單頁面更新

main
10994015 1 year ago
parent
commit
1c4e661413
  1. 4
      wms/mkt/api/getElevatorPrice.php
  2. 12
      wms/mkt/api/getUsername.php
  3. 34
      wms/mkt/api/postNewElevatorPricereview.php
  4. 4
      wms/mkt/api/postPricereviewSign.php
  5. 169
      wms/mkt/assets/js/pricereviewAlpine.js
  6. 40
      wms/mkt/css/pricereview.css
  7. 2
      wms/mkt/css/pricereview.css.map
  8. 40
      wms/mkt/css/pricereview.scss
  9. 2
      wms/mkt/pricereview-index.php
  10. 61
      wms/mkt/pricereviewCheck.php
  11. 378
      wms/mkt/pricereviewCreate.php

4
wms/mkt/api/getElevatorPrice.php

@ -11,7 +11,9 @@ $stmt->execute();
$el = $stmt->fetch(PDO::FETCH_ASSOC);
if($el){
$price = $el['price'];
$id = $el['id'];
}else{
$price = null;
$id = null;
}
echo $price;
echo json_encode(['id'=>$id, 'price'=>$price]);

12
wms/mkt/api/getUsername.php

@ -0,0 +1,12 @@
<?php
require_once('../conn.php');
$accountid = $_GET['user_id'];
$sql_str = "SELECT name FROM account WHERE accountid = :accountid";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':accountid', $accountid);
$stmt->execute();
$user = $stmt->fetch(PDO::FETCH_ASSOC);
echo $user['name'];

34
wms/mkt/api/postNewElevatorPricereview.php

@ -67,7 +67,37 @@ try{
$mid = $conn->lastInsertId();
//insert 整機單價
$sql_str = "INSERT INTO pricereview_item (mid, price_id, item_no, item_group, item_spec, item_weight, item_op, item_unit_price, item_qty, item_price_bp, item_price_ct, note)
VALUES (:mid, :price_id, :item_no, :item_group, :item_spec, :item_weight, :item_op, :item_unit_price, :item_qty, :item_price_bp, :item_price_ct, :note)";
foreach(json_decode($elevators, true) as $elevator){
$price_id = $elevator['facility_id'];
$item_no = $elevator['id'];
$item_group = "A";
$item_spec = $elevator['specifications'] . "-" . $elevator['person'] . "*" . $elevator['stop'] . "-" . $elevator['open_converted'] . $elevator['speed'];
$item_weight = "";
$item_op = $elevator['open_converted'];
$item_unit_price = $elevator['price'];
$item_qty = (int)$elevator['spec_num'];
$item_price_bp = (int)$elevator['price'] * (int)$elevator['spec_num'];
$item_price_ct = $elevator['spec_price'];
$note = $elevator['specifications'] . ',' . $elevator['person'] . ',' . $elevator['stop'] . ',' . $elevator['speed'];
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $mid);
$stmt->bindParam(':price_id', $price_id);
$stmt->bindParam(':item_no', $item_no);
$stmt->bindParam(':item_group', $item_group);
$stmt->bindParam(':item_spec', $item_spec);
$stmt->bindParam(':item_weight', $item_weight);
$stmt->bindParam(':item_op', $item_op);
$stmt->bindParam(':item_unit_price', $item_unit_price);
$stmt->bindParam(':item_qty', $item_qty);
$stmt->bindParam(':item_price_bp', $item_price_bp);
$stmt->bindParam(':item_price_ct', $item_price_ct);
$stmt->bindParam(':note', $note);
$stmt->execute();
}
//insert options 加價
$sql_str = "INSERT INTO pricereview_item (mid, price_id, item_no, item_group, item_spec, option_relate_spec, item_unit_price, item_qty, item_price_bp)
@ -152,7 +182,7 @@ try{
$pay_kind = $key +1;
$pay_scale = $pay['scale'] == '' ? 0 : $pay['scale'];
$pay_amount = $pay['scale']/100 * $price_total;
$pay_period = $pay['ticket'];
$pay_period = ($pay['scale'] == '' || $pay['scale'] == 0) ? '' :$pay['ticket'];
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $mid);
$stmt->bindParam(':pay_kind', $pay_kind);

4
wms/mkt/api/postPricereviewSign.php

@ -6,6 +6,7 @@ date_default_timezone_set("Asia/Taipei");
$sign = $_POST['sign'];
$mid = $_POST['mid'];
$result = $_POST['result'];
$reviewcomment = $_POST['reviewcomment'];
$signOff = '';
if($result == 'YY' ){
$signOff = 'YY';
@ -20,10 +21,11 @@ try{
$sign_result = $user_id . "," . $signOff . "," . date("Y-m-d H:i:s");
$sql_str = "UPDATE pricereview_sign SET sign" . $sign . "=:sign WHERE mid = :mid ";
$sql_str = "UPDATE pricereview_sign SET sign" . $sign . "=:sign, sign".$sign."_note = :reviewcomment WHERE mid = :mid ";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':sign', $sign_result);
$stmt->bindParam(':mid', $mid);
$stmt->bindParam(':reviewcomment', $reviewcomment);
$stmt->execute();
$sql_str = "UPDATE pricereview_main SET status=:status WHERE id = :id ";

169
wms/mkt/assets/js/pricereviewAlpine.js

@ -45,6 +45,7 @@ const pricereviewCreate = ()=>{
num: 1,
price:'',
sale_price:'',
facility_id: '',
},
otherOptions: [],
modalOtherOptionInfo:{
@ -66,7 +67,7 @@ const pricereviewCreate = ()=>{
},
{
scale: 0,
ticket: 30,
ticket: '',
},
{
scale: 50,
@ -74,7 +75,7 @@ const pricereviewCreate = ()=>{
},
{
scale: 0,
ticket: 30,
ticket: '',
},
{
scale: 20,
@ -86,7 +87,7 @@ const pricereviewCreate = ()=>{
},
{
scale: 0,
ticket: 30,
ticket: '',
},
],
serviceFee:0,
@ -100,14 +101,14 @@ const pricereviewCreate = ()=>{
const open_converted = this.elevators[idx].open_converted
const speed = this.elevators[idx].speed
const model = spec + '-' + person + '*' + stop + '-' + open_converted + speed;
console.log(model);
try{
const res = await axios.get("./api/getElevatorPrice.php", {params: {model: model}})
console.log(res.data);
if(res.data == null || res.data == ""){
if(res.data.id == null || res.data.id == ""){
console.log("公司並無提供此規格!!");
}
this.elevators[idx].price = res.data
this.elevators[idx].price = res.data.price
this.elevators[idx].facility_id = res.data.id
}catch (error) {
console.error("Error fetching elevator price:", error);
}
@ -118,10 +119,11 @@ const pricereviewCreate = ()=>{
try{
const res = await axios.get("./api/getElevatorPrice.php", {params: {model: model}})
console.log(res.data);
if(res.data == null || res.data == ""){
if(res.data.id == null || res.data.id == ""){
console.log("公司並無提供此規格!!");
}
this.modalElevatorInfo.price = res.data
this.modalElevatorInfo.price = res.data.price
this.modalElevatorInfo.facility_id = res.data.id
}catch (error) {
console.error("Error fetching elevator price:", error);
}
@ -216,19 +218,65 @@ const pricereviewCreate = ()=>{
})
this.$refs.optionsModal.style.display = "block"
body.style.overflow = 'hidden'
},
chkOptions(){
Object.keys(this.modalSelectedOptions).forEach(option=>{
this.selectedOptions.push(this.modalSelectedOptions[option])
})
console.log(this.modalSelectedOptions);
console.log(this.selectedOptions);
this.$refs.optionsModal.style.display = 'none';
this.hideOptionsModal();
},
hideOptionsModal(){
this.$refs.optionsModal.style.display = 'none';
body.style.overflow = 'auto'
},
hideToElevatorModal(){
this.$refs.toElevatorModal.style.display = 'none';
body.style.overflow = 'auto'
},
hideToOtherOptionElevatorModal(){
this.$refs.toOtherOptionElevatorModal.style.display = 'none';
body.style.overflow = 'auto'
},
hideToMaintainOptionElevatorModal(){
this.$refs.toMaintainOptionElevatorModal.style.display = 'none';
body.style.overflow = 'auto'
},
hideCreateElevatorModal(){
this.$refs.createElevatorModal.style.display = 'none';
body.style.overflow = 'auto'
this.modalElevatorInfo = {
spec:'',
person:'',
stop:'',
speed:'',
open:'CO',
num: 1,
price:'',
sale_price:'',
};
},
hideCreateOtherOptionModal(){
this.$refs.createOtherOptionModal.style.display = 'none';
body.style.overflow = 'auto'
},
hideCreateMaintainModal(){
this.$refs.createMaintainModal.style.display = 'none';
body.style.overflow = 'auto'
},
openCreateElevatorModal(){
this.$refs.createElevatorModal.style.display = 'block';
body.style.overflow = 'hidden'
},
openCreateOtherOptionFn(){
this.$refs.createOtherOptionModal.style.display = 'block';
body.style.overflow = 'hidden'
},
openCreateMaintainModal(){
this.$refs.createMaintainModal.style.display = 'block';
body.style.overflow = 'hidden'
},
totalElevatorsPrice(){
return this.elevators.reduce((total, elevator) => {
return total + (elevator.spec_num * elevator.price);
@ -272,18 +320,10 @@ const pricereviewCreate = ()=>{
price: this.modalElevatorInfo.price,
open:'',
spec_num: this.modalElevatorInfo.num,
facility_id: this.modalElevatorInfo.facility_id,
});
this.modalElevatorInfo = {
spec:'',
person:'',
stop:'',
speed:'',
open:'CO',
num: 1,
price:'',
sale_price:'',
};
this.$refs.closeCreateElevatorModalBtn.click();
console.log(this.elevators);
this.hideCreateElevatorModal();
},
copyElevator(idx){
const spec = this.elevators[idx].specifications
@ -295,6 +335,7 @@ const pricereviewCreate = ()=>{
const open = this.elevators[idx].open
const spec_num = this.elevators[idx].spec_num
const price = this.elevators[idx].price
const facility_id = this.elevators[idx].facility_id
this.total_spec ++;
this.elevators.push({
@ -308,6 +349,7 @@ const pricereviewCreate = ()=>{
price: price,
open: open,
spec_num: spec_num,
facility_id: facility_id,
});
console.log(this.elevators);
},
@ -327,6 +369,8 @@ const pricereviewCreate = ()=>{
})
}
})
this.$refs.toElevatorModal.style.display = 'block';
body.style.overflow = 'hidden'
},
addOtherOptionToElevator(id){
this.currentOtherOptionKey = id;
@ -343,6 +387,8 @@ const pricereviewCreate = ()=>{
})
}
})
this.$refs.toOtherOptionElevatorModal.style.display = 'block';
body.style.overflow = 'hidden'
},
chkOptionToElevators(){
const checkedOptions = [];
@ -366,6 +412,7 @@ const pricereviewCreate = ()=>{
}
})
this.currentOptionKey = ''
this.hideToElevatorModal();
},
chkOtherOptionToElevators(){
const checkedOptions = [];
@ -390,6 +437,8 @@ const pricereviewCreate = ()=>{
})
this.currentOtherOptionKey = ''
this.hideToOtherOptionElevatorModal();
},
removeElevator(id){
if(!confirm("確定刪除嗎?")) return;
@ -429,8 +478,7 @@ const pricereviewCreate = ()=>{
num: '',
}
this.otherOptionKey ++;
console.log(this.otherOptions);
this.$refs.closeCreateOtherOptionModalBtn.click();
this.hideCreateOtherOptionModal();
},
totalOtherOptionsPrice(){
return this.otherOptions.reduce((total, option) => {
@ -456,7 +504,7 @@ const pricereviewCreate = ()=>{
memo:"",
}
this.maintainOptionKey ++;
this.$refs.closeCreateMaintainOptionModalBtn.click();
this.hideCreateMaintainModal();
},
totalMaintainOptionsPrice(){
return this.maintainOptions.reduce((total, option) => {
@ -490,6 +538,7 @@ const pricereviewCreate = ()=>{
}
})
this.currentMaintainOptionKey = ''
this.hideToMaintainOptionElevatorModal();
},
addMaintainOptionToElevator(id){
this.currentMaintainOptionKey = id;
@ -506,6 +555,9 @@ const pricereviewCreate = ()=>{
})
}
})
this.$refs.toMaintainOptionElevatorModal.style.display = 'block';
body.style.overflow = 'hidden'
},
removeMaintainOption(id){
this.maintainOptions = this.maintainOptions.filter(option=> option.id != id)
@ -545,7 +597,48 @@ const pricereviewCreate = ()=>{
deposit_rate:0,
keep_rate:0,
warranty_rate:0,
error: [],
submit(){
this.error = []
for(let i=0;i<this.elevators.length;i++){
if(this.elevators[i].specifications =='') this.error.push("整機單價:規格不能為空");
if(this.elevators[i].person =='') this.error.push("整機單價:人數不能為空");
if(this.elevators[i].stop =='') this.error.push("整機單價:梯數不能為空");
if(this.elevators[i].speed =='') this.error.push("整機單價:速度不能為空");
if(this.elevators[i].open_converted =='') this.error.push("整機單價:開梯方式不能為空");
if(this.elevators[i].price =='') this.error.push("整機單價:公司發布價無此規格");
if(this.elevators[i].spec_price <= 0) this.error.push("整機單價:售價需大於0");
if(this.elevators[i].spec_num <= 0) this.error.push("整機單價:電梯數量需大於0");
}
for(let i=0;i<this.selectedOptions.length;i++){
if(this.selectedOptions[i].qty =='' ) this.error.push("Option:數量需大於0")
if(this.selectedOptions[i].toElevator.length <= 0) this.error.push("Option:需配對至電梯")
}
for(let i=0;i<this.otherOptions.length;i++){
if(this.otherOptions[i].name == '' ) this.error.push("除外項目:名稱不得為空");
if(this.otherOptions[i].price == '' ) this.error.push("除外項目:價錢需大於0");
if(this.otherOptions[i].num == '' ) this.error.push("除外項目:數量需大於0");
if(this.otherOptions[i].toElevator.length <= 0) this.error.push("除外項目:需配對至電梯")
}
for(let i=0;i<this.maintainOptions.length;i++){
if(this.maintainOptions[i].price == '' ) this.error.push("保固延長:價錢需大於0");
if(this.maintainOptions[i].num == '' ) this.error.push("保固延長:數量需大於0");
if(this.maintainOptions[i].toElevator.length <= 0) this.error.push("保固延長:需配對至電梯")
}
if(this.totalScale() != 100) this.error.push('付款辦法比例需等於100%')
if(this.transactionDate == '') this.error.push('預定成交日不得為空')
if(this.shippingDate == '') this.error.push('預定出貨日不得為空')
if(this.error.length > 0){
let errortext = '';
this.error.forEach(err=>{
errortext += err+'\n';
})
alert(errortext)
return;
}
const form = new FormData();
form.append('contractno', contractno);
form.append('ekind', "新梯");
@ -581,6 +674,7 @@ const pricereviewCreate = ()=>{
console.log(res.data);
if(res.data == "success"){
alert("送審成功!");
window.location.href = './pricereview-index.php?' + token_link;
}
}).catch(err=>{
console.error(err);
@ -614,8 +708,8 @@ const pricereviewCheck = ()=>{
if(option.option_relate_spec == elevator.item_no){
elevator.optionsTotalPrice += option.option_mi * option.item_qty
this.elevators[idx].options.push({
'id': option.id,
'item_spec': option.item_spec.trim(),
'id': option.id, //&amp;lt;br&amp;gt;()
'item_spec': option.item_spec.trim().replaceAll('&amp;', '').replaceAll('lt;', '').replaceAll('br', '').replaceAll('gt;', '').replaceAll('()', ''),
'item_unit_price': option.item_unit_price,
'item_qty': option.item_qty,
'mi': Math.round(option.option_mi),
@ -667,7 +761,12 @@ const pricereviewCheck = ()=>{
this.getElevatorMi(idx, spec, person, stop, open, speed, elevator.item_weight)
})
});
this.sign1 = this.getUsername(sign1)
this.sign2 = this.getUsername(sign2)
this.sign3 = this.getUsername(sign3)
this.sign4 = this.getUsername(sign4)
},
async getElevatorMi(idx, spec, person, stop, open, speed, item_weight){
@ -708,6 +807,10 @@ const pricereviewCheck = ()=>{
openFn:[
'CO', '2S', '2U', '4PCO', '6PCO'
],
sign1:'',
sign2:'',
sign3:'',
sign4:'',
is_renovate: false,
elevators_total_price: 0,
contractno: contractno,
@ -733,6 +836,7 @@ const pricereviewCheck = ()=>{
maintainOptions: [],
mid: mid,
user_id: user_id,
reviewcomment:'',
optionsTotalPrice(){
return this.options.reduce((total, option) => {
return total + (option.item_qty * option.item_unit_price);
@ -753,7 +857,6 @@ const pricereviewCheck = ()=>{
return total + Number(option.pay_scale );
}, 0);
},
check(sign, status){
console.log(sign);
const form = new FormData();
@ -761,6 +864,7 @@ const pricereviewCheck = ()=>{
form.append('mid', this.mid);
form.append('result', status);
form.append('user_id', this.user_id);
form.append('reviewcomment', this.reviewcomment);
axios.post('./api/postPricereviewSign.php', form).then(res=>{
console.log(res.data);
if(res.data == 1){
@ -769,11 +873,10 @@ const pricereviewCheck = ()=>{
}
})
},
agree(sign){
console.log(sign);
},
closeCase(sign){
console.log(sign);
async getUsername(user_id){
if(user_id == '') return '---'
const res = await axios.get('./api/getUsername.php', {params: {user_id: user_id}})
return res.data ;
},
}
}

40
wms/mkt/css/pricereview.css

@ -1,3 +1,9 @@
#pricereviewCreate input[type=text], #pricereviewCreate input[type=number], #pricereviewCreate select {
margin: 1px;
}
#pricereviewCreate textarea {
resize: vertical;
}
#pricereviewCreate > .modal {
padding: 20px;
}
@ -168,11 +174,11 @@
}
@keyframes fade-in {
0% {
transform: translate(-50%, -55%);
transform: translate(-50%, -60%);
opacity: 0;
}
100% {
transform: translate(-50%, -50%);
transform: translate(-50%, -55%);
opacity: 1;
}
}
@ -185,7 +191,22 @@
.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;
@ -193,9 +214,8 @@
padding: 30px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
transform: translate(-50%, -55%);
box-shadow: 0 5px 5px #222;
max-height: 80vh;
animation: fade-in 0.2s linear;
}
.window-modal .window-modal-content.modal-xl {
@ -205,7 +225,7 @@
width: 800px;
}
.window-modal .window-modal-content.modal-m {
width: 400px;
width: 450px;
}
.window-modal .window-modal-content .window-modal-header {
display: flex;
@ -223,9 +243,13 @@
.window-modal .window-modal-content .window-modal-header > div > input {
width: 250px;
}
.window-modal .window-modal-content .window-modal-body {
overflow-y: scroll;
height: 400px;
.window-modal .window-back {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: transparent;
}
#pricereviewCheck > .container {

2
wms/mkt/css/pricereview.css.map

@ -1 +1 @@
{"version":3,"sources":["pricereview.scss","pricereview.css"],"names":[],"mappings":"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","file":"pricereview.css"}
{"version":3,"sources":["pricereview.scss","pricereview.css"],"names":[],"mappings":"AACI;EACI,WAAA;ACAR;ADEI;EACI,gBAAA;ACAR;ADEI;EACI,aAAA;ACAR;ADCQ;EACI,sBAAA;ACCZ;ADCQ;EACI,cAAA;ACCZ;ADCQ;EACI,yBAAA;ACCZ;ADKQ;EACI,sBAAA;EACA,aAAA;ACHZ;ADIY;EACI,YAAA;ACFhB;ADMY;EACI,yBAAA;ACJhB;ADOgB;EACI,eAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,kBAAA;ACLpB;ADQY;EACI,eAAA;ACNhB;ADSQ;EACI,yBAAA;EACA,aAAA;EACA,kBAAA;EACA,cAAA;ACPZ;ADQY;EACI,WAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA;EACA,iBAAA;EACA,eAAA;ACNhB;ADOgB;EACI,yBAAA;EACA,WAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,WAAA;EACA,eAAA;EACA,WAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,WAAA;ACLpB;ADSY;EACI,sBAAA;EACA,aAAA;EACA,kBAAA;ACPhB;ADQgB;EACI,aAAA;EACA,mBAAA;EACA,6BAAA;EACA,eAAA;EACA,mBAAA;ACNpB;ADOoB;EACI,gBAAA;ACLxB;ADSgB;EACI,eAAA;EACA,6BAAA;ACPpB;ADQoB;EACI,eAAA;ACNxB;ADQoB;;;;EAEA,wBAAA;EACA,SAAA;ACJpB;ADQoB;EACI,UAAA;ACNxB;ADQoB;EACI,kBAAA;ACNxB;ADOwB;EACI,kBAAA;EACA,QAAA;EACA,2BAAA;EACA,UAAA;EACA,UAAA;EACA,gBAAA;ACL5B;ADOwB;EACI,kBAAA;EACA,QAAA;EACA,2BAAA;EACA,WAAA;EACA,UAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;ACL5B;ADQoB;EACI,YAAA;EACA,gBAAA;ACNxB;ADUY;EACI,aAAA;EACA,sBAAA;EACA,gBAAA;ACRhB;ADSgB;EACI,aAAA;EACA,mBAAA;EACA,cAAA;ACPpB;ADQoB;EACI,YAAA;EACA,eAAA;EACA,gBAAA;ACNxB;ADQoB;EACI,YAAA;ACNxB;ADQoB;EACI,WAAA;EACA,YAAA;EACA,SAAA;EACA,kBAAA;EACA,gBAAA;ACNxB;;ADcA;EACI,4BAAA;EACA,WAAA;ACXJ;ADYI;EACI,gBAAA;ACVR;ADYI;EACI,yBAAA;ACVR;;ADcA;EACI,eAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,aAAA;EACA,oCAAA;EACA,UAAA;EACA,aAAA;EACA,aAAA;ACXJ;ADYI;EACI;IACI,gCAAA;IACA,UAAA;ECVV;EDYM;IACI,gCAAA;IACA,UAAA;ECVV;AACF;ADYI;EACI,sBAAA;ACVR;ADYI;EACI,cAAA;ACVR;ADYI;EACI,yBAAA;ACVR;ADYI;EACI,gBAAA;ACVR;ADWQ;EACI,aAAA;EACA,kBAAA;ACTZ;ADYI;EACI,iBAAA;EACA,YAAA;ACVR;ADWQ;EACI,YAAA;ACTZ;ADYI;EACI,UAAA;EACA,sBAAA;EACA,mBAAA;EACA,kBAAA;EACA,aAAA;EACA,aAAA;EACA,QAAA;EACA,SAAA;EACA,gCAAA;EACA,0BAAA;EACA,8BAAA;ACVR;ADWQ;EACI,aAAA;ACTZ;ADWQ;EACI,YAAA;ACTZ;ADWQ;EACI,YAAA;ACTZ;ADWQ;EACI,aAAA;EACA,sBAAA;ACTZ;ADUY;EACI,kBAAA;EACA,SAAA;EACA,WAAA;EACA,6BAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;ACRhB;ADUY;EACI,YAAA;ACRhB;ADYI;EACI,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,6BAAA;ACVR;;ADeI;EACI,yBAAA;EACA,mBAAA;EACA,aAAA;ACZR;ADaQ;EACI,gBAAA;ACXZ;ADaQ;EACI,sBAAA;ACXZ;ADaQ;EACI,uBAAA;ACXZ;ADYY;EACI,uBAAA;ACVhB;ADcY;EACI,yBAAA;ACZhB;ADgBY;EACI,gBAAA;ACdhB;ADgBY;EACI,yBAAA;EACA,mBAAA;EACA,iBAAA;EACA,eAAA;ACdhB;ADgBY;EACI,eAAA;ACdhB;ADegB;EACI,eAAA;EACA,gBAAA;ACbpB;ADegB;EACI,WAAA;EACA,aAAA;EACA,cAAA;EACA,sBAAA;ACbpB","file":"pricereview.css"}

40
wms/mkt/css/pricereview.scss

@ -1,4 +1,10 @@
#pricereviewCreate{
input[type='text'], input[type='number'], select{
margin: 1px;
}
textarea{
resize: vertical;
}
>.modal{
padding: 20px;
table, th, td{
@ -179,11 +185,11 @@
display: none;
@keyframes fade-in {
0%{
transform: translate(-50%, -55%);
transform: translate(-50%, -60%);
opacity: 0;
}
100%{
transform: translate(-50%, -50%);
transform: translate(-50%, -55%);
opacity: 1;
}
}
@ -196,7 +202,22 @@
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;
@ -204,9 +225,8 @@
padding: 30px;
top: 50%;
left:50%;
transform: translate(-50%, -50%);
transform: translate(-50%, -55%);
box-shadow: 0 5px 5px #222;
max-height: 80vh;
animation: fade-in .2s linear;
&.modal-xl{
width:1200px;
@ -215,7 +235,7 @@
width:800px;
}
&.modal-m{
width:400px;
width:450px;
}
.window-modal-header{
display: flex;
@ -233,10 +253,14 @@
width: 250px;
}
}
.window-modal-body{
overflow-y: scroll;
height: 400px;
}
.window-back{
position: absolute;
top: 0;
left:0;
width: 100%;
height: 100%;
background-color: transparent;
}
}

2
wms/mkt/pricereview-index.php

@ -1,6 +1,6 @@
<?php
include "../header.php";
require_once('../contract/conn.php');
require_once('./conn.php');
// if($user_id == "M0107" || $user_id == "M0174" || $user_id == "M0225"){
// }else{

61
wms/mkt/pricereviewCheck.php

@ -1,13 +1,22 @@
<?php
include_once('../header.php');
require_once('./conn.php');
if(!isset($_GET['id'])){
echo "找不到此紀錄!";
exit;
}
$id = $_GET['id'];
$sql_str = "SELECT pricereview_main.*, account.name as person_name FROM pricereview_main LEFT JOIN account ON pricereview_main.person = account.accountid WHERE pricereview_main.id = :id";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':id', $id);
$stmt->execute();
$contract = $stmt->fetch(PDO::FETCH_ASSOC);
// print_r($contract);
if(!$contract){
echo "找不到此紀錄!";
exit;
}
$sql_str = "SELECT * FROM pricereview_pay WHERE mid = :mid ORDER BY pay_kind ASC";
$stmt = $conn->prepare($sql_str);
@ -15,13 +24,19 @@ $stmt->bindParam(':mid', $id);
$stmt->execute();
$pays = $stmt->fetchAll(PDO::FETCH_ASSOC);
$sql_str = "SELECT pricereview_item.*, option_mi.price AS option_mi FROM pricereview_item LEFT JOIN option_mi ON option_mi.option_price_id = pricereview_item.price_id WHERE pricereview_item.mid = :mid AND option_mi.open_kind = 'CO' ORDER BY pricereview_item.item_group, pricereview_item.item_no ASC";
$sql_str = "SELECT pricereview_item.*, option_mi.price AS option_mi, option_price.group_name AS option_name, option_price.memo AS option_memo, option_price.spec AS option_spec
FROM pricereview_item
LEFT JOIN option_mi ON option_mi.option_price_id = pricereview_item.price_id
LEFT JOIN option_price ON option_price.id = pricereview_item.price_id
WHERE pricereview_item.mid = :mid AND option_mi.open_kind = 'CO' ORDER BY pricereview_item.item_group, pricereview_item.item_no ASC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $id);
$stmt->execute();
$options = $stmt->fetchAll(PDO::FETCH_ASSOC);
$sql_str = "SELECT * FROM pricereview_item WHERE mid = :mid ORDER BY item_group, item_no ASC";
$sql_str = "SELECT * FROM pricereview_item
WHERE pricereview_item.mid = :mid ORDER BY pricereview_item.item_group, pricereview_item.item_no ASC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $id);
$stmt->execute();
@ -248,8 +263,8 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<tr>
<td x-html="'<b>' + option.item_no + '</b>'"></td>
<td x-text="option.price_id"></td>
<td><input type="text" class="form-control" x-model="option.item_spec" disabled /></td>
<td><input type="text" class="form-control" x-model="option.item_unit_price.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" :value="option.option_name + ((option.option_spec==null || option.option_spec == '') ? '' : '(' + option.option_spec + ')') + ((option.option_memo==null || option.option_memo == '') ? '' : '(' + option.option_memo + ')') " disabled /></td>
<td><input type="text" class="form-control" x-model="Number(option.item_unit_price).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="option.item_qty" disabled /></td>
<td><input type="text" class="form-control" x-model="(option.item_unit_price * option.item_qty).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="option.memo" disabled /></td>
@ -287,7 +302,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<td x-html="'<b>' + option.item_no + '</b>'"></td>
<td x-text="option.price_id"></td>
<td><input type="text" class="form-control" x-model="option.item_spec" disabled /></td>
<td><input type="text" class="form-control" x-model="option.item_unit_price.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="Number(option.item_unit_price).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" x-model="option.item_qty" disabled /></td>
<td><input type="text" class="form-control" x-model="(option.item_unit_price * option.item_qty).toLocaleString()" disabled /></td>
<td x-text="option.option_relate_spec"></td>
@ -323,7 +338,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<tr>
<td x-text="option.item_no"></td>
<td x-text="option.item_spec"></td>
<td x-text="option.item_unit_price.toLocaleString()"></td>
<td x-text="Number(option.item_unit_price).toLocaleString()"></td>
<td x-text="option.item_qty"></td>
<td x-text="(option.item_qty * option.item_unit_price).toLocaleString()"></td>
<td x-text="option.memo"></td>
@ -356,7 +371,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<td rowspan="4">材料</td>
<td>1.訂金</td>
<td><input type="text" class="form-control" x-model="pays[0].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[0].pay_amount.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" :value="Number(pays[0].pay_amount).toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[0].pay_period">
<option value=""></option>
@ -373,7 +388,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<tr>
<td>2.二次款</td>
<td><input type="text" class="form-control" x-model="pays[1].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[1].pay_amount.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" :value="Number(pays[1].pay_amount).toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[1].pay_period">
<option value=""></option>
@ -390,7 +405,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<tr>
<td>3.貨到工地款</td>
<td><input type="text" class="form-control" x-model="pays[2].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[2].pay_amount.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" :value="Number(pays[2].pay_amount).toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[2].pay_period">
<option value=""></option>
@ -407,7 +422,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<tr>
<td>4.其他</td>
<td><input type="text" class="form-control" x-model="pays[3].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[3].pay_amount.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" :value="Number(pays[3].pay_amount).toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[3].pay_period">
<option value=""></option>
@ -425,7 +440,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<td rowspan=3>材料</td>
<td>5.安裝完畢款</td>
<td><input type="text" class="form-control" x-model="pays[4].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[4].pay_amount.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" :value="Number(pays[4].pay_amount).toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[4].pay_period">
<option value=""></option>
@ -442,7 +457,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<tr>
<td>6.驗收款</td>
<td><input type="text" class="form-control" x-model="pays[5].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[5].pay_amount.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" :value="Number(pays[5].pay_amount).toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[5].pay_period">
<option value=""></option>
@ -459,7 +474,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<tr>
<td>7.尾款</td>
<td><input type="text" class="form-control" x-model="pays[6].pay_scale" disabled /></td>
<td><input type="text" class="form-control" x-model="pays[6].pay_amount.toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" :value="Number(pays[6].pay_amount).toLocaleString()" disabled /></td>
<td>
<select class="form-control" name="" id="" disabled x-model="pays[6].pay_period">
<option value=""></option>
@ -476,7 +491,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<tr>
<td colspan="2">合計</td>
<td><input type="text" class="form-control" x-model="totalScale()" disabled /></td>
<td><input type="text" class="form-control" x-model="Number(price_total).toLocaleString()" disabled /></td>
<td><input type="text" class="form-control" :value="Number(price_total).toLocaleString()" disabled /></td>
<td></td>
</tr>
<tr>
@ -575,7 +590,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<tbody>
<tr>
<td>區經理</td>
<td><?php echo explode(',', $sign['sign1'])[0] ?></td>
<td x-text="sign1"></td>
<td>
<?php
if($sign1 == 'Y'){
@ -594,7 +609,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
</tr>
<tr>
<td>業務承辦人</td>
<td><?php echo $sign['sign2']!=NULL ? explode(',', $sign['sign2'])[0] : '---' ?></td>
<td x-text="sign2"></td>
<td>
<?php
if($sign2 == 'Y'){
@ -613,7 +628,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
</tr>
<tr>
<td>業務部協理</td>
<td><?php echo $sign['sign3']!=NULL ? explode(',', $sign['sign3'])[0] : '---' ?></td>
<td x-text="sign3"></td>
<td>
<?php
if($sign3 == 'Y'){
@ -634,7 +649,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
</tr>
<tr>
<td>總經理</td>
<td><?php echo $sign['sign4']!=NULL ? explode(',', $sign['sign4'])[0] : '---' ?></td>
<td x-text="sign4"></td>
<td>
<?php
if($contract['status'] == 'YY'){
@ -671,7 +686,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
<tbody>
<tr>
<td>
<textarea name="" class="form-control" id="" cols="40" rows="5"></textarea>
<textarea name="" <?php if($currentSigner != $user_id) echo "disabled" ?> class="form-control" id="" cols="40" rows="5" x-model="reviewcomment"></textarea>
</td>
<td>
<input type="text" class="form-control" disabled />
@ -723,4 +738,10 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){
const is_renovate = '<?php echo $contract['ekind']; ?>';
const user_id = '<?php echo $user_id; ?>';
const sign1 = '<?php echo explode(',', $sign['sign1'])[0] ?>';
const sign2 = '<?php echo explode(',', $sign['sign2'])[0] ?>';
console.log('sign2====>', sign2);
const sign3 = '<?php echo explode(',', $sign['sign3'])[0] ?>';
const sign4 = '<?php echo explode(',', $sign['sign4'])[0] ?>';
</script>

378
wms/mkt/pricereviewCreate.php

@ -41,6 +41,7 @@ hope_project_elevator_spec.open,
hope_project_elevator_spec.spec_price,
hope_project_elevator_spec.spec_num,
fp.price AS price,
fp.id AS facility_id,
CASE hope_project_elevator_spec.open
WHEN 4 THEN '2U'
WHEN 5 THEN '4PCO'
@ -153,10 +154,10 @@ function convertDateTimeFormat($dateTimeStr) {
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" @click="chkOptions()">確認</button>
</div>
</div>
<div class="window-back"></div>
<div class="window-back" @click="hideOptionsModal()"></div>
</div>
<div class="window-modal" x-ref="toElevatorModal" id="toElevatorModal">
<div class="window-modal-content modal-xl">
<div class="window-modal-content modal-m">
<div class="window-modal-header">
<h4>配對電梯</h4>
<button class="btn btn-close" @click="hideToElevatorModal()">X</button>
@ -185,81 +186,19 @@ function convertDateTimeFormat($dateTimeStr) {
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @click="hideOptionsModal()">關閉</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" @click="chkOptions()">確認</button>
</div>
</div>
<div class="window-back"></div>
</div>
<div class="modal fade modal-dialog-scrollable modal-xl" id="optionModal" tabindex="-1" aria-labelledby="optionModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header d-flex flex-column align-items-start">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<h5 class="modal-title" id="optionModalLabel">Option 加價</h5>
<div class="mt-3">
<input type="text" class="form-control" x-model="searchtext" @keyup="searchOptions()" placeholder="搜尋..." />
</div>
<div class="categories mt-3">
<button :class="['btn', 'mt-2', (kind==1) ? 'btn-primary' : 'btn-secondary text-light']" @click="searchOptions(1)">顯示全部</button>
<button :class="['btn', 'mt-2', (kind=='A') ? 'btn-primary' : 'btn-secondary text-light']" @click="searchOptions('A', 1)">A-1 車廂意匠</button>
<button :class="['btn', 'mt-2', (kind=='B') ? 'btn-primary' : 'btn-secondary text-light']" @click="searchOptions('B', 1)">A-2 車廂內裝</button>
<button :class="['btn', 'mt-2', (kind=='C') ? 'btn-primary' : 'btn-secondary text-light']" @click="searchOptions('C', 1)">A-3 車廂外部</button>
<button :class="['btn', 'mt-2', (kind=='D') ? 'btn-primary' : 'btn-secondary text-light']" @click="searchOptions('D', 1)">A-4 控制與其他</button>
<button :class="['btn', 'mt-2', (kind=='E') ? 'btn-primary' : 'btn-secondary text-light']" @click="searchOptions('E', 1)">B-1 平台梯</button>
<button :class="['btn', 'mt-2', (kind=='F') ? 'btn-primary' : 'btn-secondary text-light']" @click="searchOptions('F', 1)">C-1 汰改</button>
<br /><br />
<template x-for="button in buttons">
<button style="margin-right:3px" :class="['btn', (button.type == subkind) ? 'btn-primary' : 'btn-secondary text-light']" @click="searchOptions(null, button.type)" x-text="button.name"></button>
</template>
</div>
</div>
<div class="modal-body">
<div>
<table class="table " border=1>
<thead>
<tr>
<th>ID</th>
<th>名稱</th>
<th>規格</th>
<th>備註</th>
<th>配置</th>
<th>單位</th>
<th>定價</th>
</tr>
</thead>
<tbody>
<template x-for="(option, idx) in options" :key="option.id">
<tr style="cursor:pointer;" :class="option.selected == 1 ? ' selected' : ''" x-show="option.isShow == 1" @click="selectOption(idx, option.id, option.group_name, option.price, option.memo)">
<td x-text='option.id' name="optionID" class="bg-transparent"></td>
<td x-text="option.group_name" class="bg-transparent"> </td>
<td x-text="option.spec" class="bg-transparent"></td>
<td x-text="option.memo" class="bg-transparent"></td>
<td x-text="optionalArr[option.optional]" class="bg-transparent"></td>
<td x-text="option.unit" class="bg-transparent"></td>
<td x-text="option.price" class="bg-transparent"></td>
</tr>
</template>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">關閉</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" @click="chkOptions()">確認</button>
</div>
<button type="button" class="btn btn-secondary" @click="hideToElevatorModal()">關閉</button>
<button type="button" class="btn btn-primary" @click="chkOptionToElevators()">確認</button>
</div>
</div>
<div class="window-back" @click="hideToElevatorModal()"></div>
</div>
<div class="modal fade modal-dialog-scrollable modal-m" id="toElevatorModal" tabindex="-1" aria-labelledby="toElevatorModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header d-flex flex-column align-items-start">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<h5 class="modal-title" id="">配對電梯</h5>
<div class="window-modal" x-ref="toOtherOptionElevatorModal" id="toOtherOptionElevatorModal">
<div class="window-modal-content modal-m">
<div class="window-modal-header">
<h4>配對電梯</h4>
<button class="btn btn-close" @click="hideToOtherOptionElevatorModal()">X</button>
</div>
<div class="modal-body">
<div class="window-modal-body">
<div>
<table class="table">
<tr>
@ -271,7 +210,7 @@ function convertDateTimeFormat($dateTimeStr) {
<tr>
<td x-text="elevator.id"></td>
<td x-text="elevator.model"></td>
<td><input type="radio" name="optionToElevator" :value="elevator.id" class="form-check-input" x-model="toElevatorNo" /></td>
<td><input type="radio" name="otherOptionToElevator" :value="elevator.id" class="form-check-input" x-model="toElevatorNo" /></td>
</tr>
</template>
<tr x-show="toElevators.length == 0">
@ -283,20 +222,19 @@ function convertDateTimeFormat($dateTimeStr) {
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">關閉</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" @click="chkOptionToElevators()">確認</button>
</div>
<button type="button" class="btn btn-secondary" @click="hideToOtherOptionElevatorModal()">關閉</button>
<button type="button" class="btn btn-primary" @click="chkOtherOptionToElevators()">確認</button>
</div>
</div>
<div class="window-back" @click="hideToOtherOptionElevatorModal()"></div>
</div>
<div class="modal fade modal-dialog-scrollable modal-m" id="toOtherOptionElevatorModal" tabindex="-1" aria-labelledby="toElevatorModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header d-flex flex-column align-items-start">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<h5 class="modal-title" id="">配對電梯</h5>
<div class="window-modal" x-ref="toMaintainOptionElevatorModal" id="toMaintainOptionElevatorModal">
<div class="window-modal-content modal-m">
<div class="window-modal-header">
<h4>配對電梯</h4>
<button class="btn btn-close" @click="hideToMaintainOptionElevatorModal()">X</button>
</div>
<div class="modal-body">
<div class="window-modal-body">
<div>
<table class="table">
<tr>
@ -308,7 +246,7 @@ function convertDateTimeFormat($dateTimeStr) {
<tr>
<td x-text="elevator.id"></td>
<td x-text="elevator.model"></td>
<td><input type="radio" name="otherOptionToElevator" :value="elevator.id" class="form-check-input" x-model="toElevatorNo" /></td>
<td><input type="radio" name="maintainOptionToElevator" :value="elevator.id" class="form-check-input" x-model="toElevatorNo" /></td>
</tr>
</template>
<tr x-show="toElevators.length == 0">
@ -320,50 +258,129 @@ function convertDateTimeFormat($dateTimeStr) {
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">關閉</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" @click="chkOtherOptionToElevators()">確認</button>
</div>
<button type="button" class="btn btn-secondary" @click="hideToMaintainOptionElevatorModal()">關閉</button>
<button type="button" class="btn btn-primary" @click="chkMaintainOptionToElevators()">確認</button>
</div>
</div>
<div class="window-back" @click="hideToMaintainOptionElevatorModal()"></div>
</div>
<div class="modal fade modal-dialog-scrollable modal-m" id="toMaintainOptionElevatorModal" tabindex="-1" aria-labelledby="toElevatorModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header d-flex flex-column align-items-start">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<h5 class="modal-title" id="">配對電梯</h5>
<div class="window-modal" x-ref="createElevatorModal" id="createElevatorModal">
<div class="window-modal-content modal-xl">
<div class="window-modal-header">
<h4>新增電梯規格</h4>
<button class="btn btn-close" @click="hideCreateElevatorModal()">X</button>
</div>
<div class="modal-body">
<div class="window-modal-body">
<div>
<table class="table">
<tr class="table-active">
<th>電梯</th>
<th>人乘/載重</th>
<th>停數</th>
<th>速度</th>
</tr>
<tr>
<th>項次</th>
<td>
<select name="" id="" class="form-control" x-model="modalElevatorInfo.spec" @change="getModalElevatorPrice()">
<option value="">請選擇</option>
<option value="MAE100">MAE100有機房</option>
<option value="MAM200">MAM200無機房</option>
<option value="MAH100">MAH100小電梯</option>
<option value="MAF100">MAE100貨梯(有機房)</option>
<option value="MAQ100">MAQ100強趨梯</option>
<option value="MAP100">MAP100平台梯</option>
</select>
</td>
<td>
<select name="" id="" class="form-control" x-model="modalElevatorInfo.person" @change="getModalElevatorPrice()">
<option value="">請選擇</option>
<option value="6">6</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="15">15</option>
<option value="17">17</option>
<option value="20">20</option>
<option value="24">24</option>
</select>
</td>
<td>
<input type="number" class="form-control" style="width:83px" x-model="modalElevatorInfo.stop" @keyup="getModalElevatorPrice()" @change="getModalElevatorPrice()" />
</td>
<td>
<select name="" id="" class="form-control" x-model="modalElevatorInfo.speed" @change="getModalElevatorPrice()" >
<option value="">請選擇</option>
<option value="9">9</option>
<option value="24">24</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="90">90</option>
<option value="105">105</option>
<option value="120">120</option>
<option value="150">150</option>
</select>
</td>
</tr>
<tr class="table-active">
<th>開門方式</th>
<th>規格</th>
<th>選擇</th>
<th>數量</th>
<th></th>
</tr>
<template x-for="elevator in toElevators">
<tr>
<td x-text="elevator.id"></td>
<td x-text="elevator.model"></td>
<td><input type="radio" name="maintainToElevator" :value="elevator.id" class="form-check-input" x-model="toElevatorNo" /></td>
<td>
<select name="" id="" class="form-control" style="width:83px" x-model="modalElevatorInfo.open" @change="getModalElevatorPrice()">
<option value="CO">CO</option>
<option value="2S">2S</option>
<option value="2U">CO</option>
<option value="4PCO">4PCO</option>
<option value="6PCO">6PCO</option>
</select>
</td>
<td>
<input type="text" x-show="!modalElevatorInfo.price || modalElevatorInfo.price ==''" class="form-control" disabled />
<input type="text" x-show="modalElevatorInfo.price > 0" class="form-control" disabled x-model="modalElevatorInfo.spec + '-' + modalElevatorInfo.person + '*' + modalElevatorInfo.stop + '-' + modalElevatorInfo.open + modalElevatorInfo.speed">
</td>
<td>
<input type="number" class="form-control" style="width:83px" x-model="modalElevatorInfo.num" >
</td>
<td></td>
</tr>
</template>
<tr x-show="toElevators.length == 0">
<td colspan="3">
<small class="text-danger" style="font-size:13px;font-weight:600">暫無可選電梯,請先新增電梯規格!</small>
<tr class="table-active">
<th>公司發布價(單價)</th>
<th>公司發布價(複價)</th>
<th>自定售價(台)</th>
<th>自定售價(總價)</th>
</tr>
<tr>
<td>
<input type="text" disabled class="form-control" x-model="(modalElevatorInfo.price).toLocaleString()">
</td>
<td>
<input type="text" disabled class="form-control" x-model="(modalElevatorInfo.price * modalElevatorInfo.num).toLocaleString()">
</td>
<td>
<input type="number" class="form-control" x-model="modalElevatorInfo.sale_price">
</td>
<td>
<input type="text" disabled class="form-control" x-model="(modalElevatorInfo.sale_price * modalElevatorInfo.num).toLocaleString()">
</td>
</tr>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">關閉</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal" @click="chkMaintainOptionToElevators()">確認</button>
</div>
<button type="button" class="btn btn-secondary" @click="hideCreateElevatorModal()">關閉</button>
<button type="button" class="btn btn-primary" @click="createElevatorFn()">新增</button>
</div>
</div>
<div class="window-back" @click="hideCreateElevatorModal()"></div>
</div>
<div class="modal fade modal-dialog-scrollable modal-lg" id="createElevatorModal" tabindex="-1" aria-labelledby="createElevatorModalLabel" aria-hidden="true">
<!-- <div class="modal fade modal-dialog-scrollable modal-lg" id="createElevatorModal" tabindex="-1" aria-labelledby="createElevatorModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header d-flex flex-column align-items-start">
@ -480,8 +497,41 @@ function convertDateTimeFormat($dateTimeStr) {
</div>
</div>
</div>
</div> -->
<div class="window-modal" x-ref="createOtherOptionModal" id="createOtherOptionModal">
<div class="window-modal-content modal-xl">
<div class="window-modal-header">
<h4>新增除外項目</h4>
<button class="btn btn-close" @click="hideCreateOtherOptionModal()">X</button>
</div>
<div class="window-modal-body">
<div>
<table class="table">
<tr class="table-active">
<th>詢價單號</th>
<th>項目名稱</th>
<th>單價</th>
<th>數量</th>
<th>複價</th>
</tr>
<tr>
<td><input type="text" class="form-control" x-model="modalOtherOptionInfo.pr_no"></td>
<td><input type="text" class="form-control" x-model="modalOtherOptionInfo.name"></td>
<td><input type="number" class="form-control" x-model="modalOtherOptionInfo.price"></td>
<td><input type="number" class="form-control" x-model="modalOtherOptionInfo.num"></td>
<td><input type="text" disabled class="form-control" x-model="(modalOtherOptionInfo.price * modalOtherOptionInfo.num).toLocaleString()"></td>
</tr>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" @click="hideCreateOtherOptionModal()">關閉</button>
<button type="button" class="btn btn-primary" @click="createOtherOptionFn()">新增</button>
</div>
<div class="modal fade modal-dialog-scrollable modal-xl" id="createOtherOptionModal" tabindex="-1" aria-labelledby="createElevatorModalLabel" aria-hidden="true">
</div>
<div class="window-back" @click="hideCreateOtherOptionModal()"></div>
</div>
<!-- <div class="modal fade modal-dialog-scrollable modal-xl" id="createOtherOptionModal" tabindex="-1" aria-labelledby="createElevatorModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header d-flex flex-column align-items-start">
@ -515,8 +565,39 @@ function convertDateTimeFormat($dateTimeStr) {
</div>
</div>
</div>
</div> -->
<div class="window-modal" x-ref="createMaintainModal" id="createMaintainModal">
<div class="window-modal-content modal-xl">
<div class="window-modal-header">
<h4>新增保固延長</h4>
<button class="btn btn-close" @click="hideCreateMaintainModal()">X</button>
</div>
<div class="modal fade modal-dialog-scrollable modal-lg" id="createMaintainModal" tabindex="-1" aria-labelledby="createElevatorModalLabel" aria-hidden="true">
<div class="window-modal-body">
<div>
<table class="table">
<tr class="table-active">
<th>單價</th>
<th>數量(月)</th>
<th>總價</th>
<th>備註</th>
</tr>
<tr>
<td><input type="number" class="form-control" x-model="modalMaintainInfo.price"></td>
<td><input type="number" class="form-control" x-model="modalMaintainInfo.num"></td>
<td><input type="text" disabled class="form-control" x-model="(modalMaintainInfo.price * modalMaintainInfo.num).toLocaleString()"></td>
<td><input type="text" class="form-control" x-model="modalMaintainInfo.memo"></td>
</tr>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" @click="hideCreateMaintainModal()">關閉</button>
<button type="button" class="btn btn-primary" @click="createMaintainOptionFn()">新增</button>
</div>
</div>
<div class="window-back" @click="hideCreateMaintainModal()"></div>
</div>
<!-- <div class="modal fade modal-dialog-scrollable modal-lg" id="createMaintainModal" tabindex="-1" aria-labelledby="createElevatorModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header d-flex flex-column align-items-start">
@ -548,7 +629,7 @@ function convertDateTimeFormat($dateTimeStr) {
</div>
</div>
</div>
</div>
</div> -->
<div class="container">
<table class="table" border="1">
@ -645,23 +726,23 @@ function convertDateTimeFormat($dateTimeStr) {
<div class="divitem">
<div class="title">
<h4>整機單價</h4>
<button class="addbtn btn" x-ref="addElevatorBtn" data-bs-toggle="modal" data-bs-target="#createElevatorModal" >+</button>
<button class="addbtn btn" x-ref="addElevatorBtn" @click="openCreateElevatorModal()" >+</button>
</div>
<table class="table" border=1>
<thead>
<tr>
<td>項次</td>
<td>電梯</td>
<td>人乘/<br>載重</td>
<td>停數</td>
<td>速度(m/min)</td>
<td>開門方式</td>
<td>規格</td>
<td>公司發布價(台)</td>
<td>數量</td>
<td>公司發布價(總價)</td>
<td>售價(台)</td>
<td>售價(總價) </td>
<th>項次</th>
<th>電梯</th>
<th>人乘/<br>載重</th>
<th>停數</th>
<th>速度(m/min)</th>
<th>開門方式</th>
<th>規格</th>
<th>公司發布價(台)</th>
<th>數量</th>
<th>公司發布價(總價)</th>
<th>售價(台)</th>
<th>售價(總價) </th>
</tr>
</thead>
<tbody>
@ -726,7 +807,7 @@ function convertDateTimeFormat($dateTimeStr) {
<input type="text" style="width:150px" x-show="elevator.specifications!='' && elevator.person!='' && elevator.stop!='' && elevator.speed!='' && elevator.open_converted!=''" class="form-control" disabled x-model="elevator.specifications + '-' + elevator.person + '*' + elevator.stop + '-' + elevator.open_converted + elevator.speed">
</td>
<td>
<input type="text" class="form-control" disabled x-model="elevator.price"><span x-show="elevator.price==''" style="font-size:12px;color:red;font-weight:600">請填寫正確規格</span>
<input type="text" class="form-control" disabled :value="Number(elevator.price).toLocaleString()"><span x-show="elevator.price==''" style="font-size:12px;color:red;font-weight:600">請填寫正確規格</span>
</td>
<td><input type="number" class="form-control " value="1" style="width:40px;padding-left:5px" x-model="elevator.spec_num"></td>
<td>
@ -746,9 +827,9 @@ function convertDateTimeFormat($dateTimeStr) {
<tr>
<td colspan=8>小計</td>
<td><input type="text" class="form-control" disabled :value="totalElevatorsNum()" style="width:40px;padding-left:5px"></td>
<td><input type="text" class="form-control" disabled :value="totalElevatorsPrice()" ></td>
<td><input type="text" class="form-control" disabled :value="totalElevatorsPrice().toLocaleString()" ></td>
<td></td>
<td><input type="text" class="form-control" disabled :value="totalElevatorsSalePrice()" ></td>
<td><input type="text" class="form-control" disabled :value="totalElevatorsSalePrice().toLocaleString()" ></td>
</tr>
</template>
</tbody>
@ -757,12 +838,12 @@ function convertDateTimeFormat($dateTimeStr) {
<div class="divitem">
<div class="title">
<h4>Option加價</h4>
<button class="addbtn btn" x-ref="addElevatorBtn" data-bs-toggle="modal" data-bs-target="#optionModal" @click="initModalSelectedOptions()">+</button>
<button class="addbtn btn" x-ref="addElevatorBtn" @click="initModalSelectedOptions()">+</button>
</div>
<table class="table" border=1>
<thead x-show="selectedOptions.length > 0">
<tr>
<th>項次</th>
<th>ID</th>
<th>選配規格</th>
<th style="width:150px;">單價</th>
<th style="width:80px;">數量</th>
@ -773,13 +854,13 @@ function convertDateTimeFormat($dateTimeStr) {
</tr>
</thead>
<tbody>
<template x-for="(option, key) in selectedOptions" :key="option.idx">
<template x-for="(option, key) in selectedOptions" :key="option.key">
<tr x-show="option != null">
<td x-text="option.id"></td>
<td x-text="option.name"></td>
<td><input type="text" class="form-control" x-model="option.price" disabled></td>
<td><input type="text" class="form-control" :value="option.price.toLocaleString()" disabled></td>
<td><input type="number" class="form-control" x-model="option.qty" style="width:80px"></td>
<td><input type="text" class="form-control" disabled :value="option.qty * option.price"></td>
<td><input type="text" class="form-control" disabled :value="Number(option.qty * option.price).toLocaleString()"></td>
<td><textarea class="form-control" x-text="option.memo" cols="30" rows="auto" disabled></textarea></td>
<td>
<template x-for="el in option.toElevator">
@ -788,7 +869,7 @@ function convertDateTimeFormat($dateTimeStr) {
</td>
<td>
<div class="d-flex">
<button class="selectElevator btn btn-danger" data-bs-toggle="modal" data-bs-target="#toElevatorModal" @click="addOptionToElevator(option.key)">電梯</button>
<button class="selectElevator btn btn-danger" @click="addOptionToElevator(option.key)">電梯</button>
<button class="deleteBtn btn btn-danger" @click="removeOption(option.key)">X</button>
</div>
</td>
@ -796,7 +877,7 @@ function convertDateTimeFormat($dateTimeStr) {
</template>
<tr x-show="selectedOptions.length > 0">
<td colspan=4>小計</td>
<td colspan=1 ><input type="text" class="form-control" disabled :value="totalOptionsPrice()" ></td>
<td colspan=1 ><input type="text" class="form-control" disabled :value="totalOptionsPrice().toLocaleString()" ></td>
<td colspan=4 ></td>
</tr>
</tbody>
@ -805,7 +886,7 @@ function convertDateTimeFormat($dateTimeStr) {
<div class="divitem">
<div class="title">
<h4>除外項目</h4>
<button class="addbtn btn" x-ref="addElevatorBtn" data-bs-toggle="modal" data-bs-target="#createOtherOptionModal">+</button>
<button class="addbtn btn" @click="openCreateOtherOptionFn()" >+</button>
</div>
<table class="table" border=1>
<thead x-show="otherOptions.length > 0">
@ -834,7 +915,7 @@ function convertDateTimeFormat($dateTimeStr) {
</td>
<td>
<div class="d-flex">
<button class="selectElevator btn btn-danger" data-bs-toggle="modal" data-bs-target="#toOtherOptionElevatorModal" @click="addOtherOptionToElevator(option.id)">電梯</button>
<button class="selectElevator btn btn-danger" @click="addOtherOptionToElevator(option.id)">電梯</button>
<button class="deleteBtn btn btn-danger" @click="removeOtherOption(option.id)">X</button>
</div>
</td>
@ -842,8 +923,8 @@ function convertDateTimeFormat($dateTimeStr) {
</template>
<tr x-show="otherOptions.length > 0">
<td colspan=3>小計</td>
<td colspan=1 ><input type="number" class="form-control" disabled x-model="totalOtherOptionsNum()" ></td>
<td colspan=1 ><input type="text" class="form-control" disabled x-model="totalOtherOptionsPrice()" ></td>
<td colspan=1 ><input type="number" class="form-control" disabled :value="totalOtherOptionsNum().toLocaleString()" ></td>
<td colspan=1 ><input type="text" class="form-control" disabled :value="totalOtherOptionsPrice().toLocaleString()" ></td>
<td colspan=3 ></td>
</tr>
</tbody>
@ -852,7 +933,7 @@ function convertDateTimeFormat($dateTimeStr) {
<div class="divitem">
<div class="title">
<h4>保固延長</h4>
<button class="addbtn btn" x-ref="addElevatorBtn" data-bs-toggle="modal" data-bs-target="#createMaintainModal">+</button>
<button class="addbtn btn" @click="openCreateMaintainModal()">+</button>
</div>
<table class="table" border=1>
<thead x-show="maintainOptions.length > 0">
@ -879,7 +960,7 @@ function convertDateTimeFormat($dateTimeStr) {
</td>
<td>
<div class="d-flex">
<button class="selectElevator btn btn-danger" data-bs-toggle="modal" data-bs-target="#toMaintainOptionElevatorModal" @click="addMaintainOptionToElevator(option.id)">電梯</button>
<button class="selectElevator btn btn-danger" @click="addMaintainOptionToElevator(option.id)">電梯</button>
<button class="deleteBtn btn btn-danger" @click="removeMaintainOption(option.id)">X</button>
</div>
</td>
@ -1059,7 +1140,7 @@ function convertDateTimeFormat($dateTimeStr) {
<td><input type="text" class="form-control" x-model="(totalSalePrice() - totalPrice()).toLocaleString()" disabled style="width:180px" /></td>
<td><input type="text" class="form-control" x-model="Math.round(totalSalePrice() / totalPrice() * 100 * 10) /10" disabled /></td>
<td><input type="text" class="form-control" x-model="totalElevatorsNum()" disabled /></td>
<td><input type="text" class="form-control" x-model="serviceFee" /></td>
<td><input type="text" class="form-control" x-model="serviceFee" style="width:150px" /></td>
</tr>
<tr>
<th>預定成交日</th>
@ -1077,7 +1158,7 @@ function convertDateTimeFormat($dateTimeStr) {
<td></td>
<td></td>
</tr>
<!-- <tr>
<tr>
<th>罰則</th>
<th>訂金保證金(函)%</th>
<th>履約保證金(函)%</th>
@ -1086,13 +1167,13 @@ function convertDateTimeFormat($dateTimeStr) {
<th></th>
</tr>
<tr>
<td><input type="text" class="form-control" value="" /></td>
<td><input type="text" class="form-control" value="" /></td>
<td><input type="text" class="form-control" value="" /></td>
<td><input type="text" class="form-control" value="" /></td>
<td><input type="text" class="form-control" x-model="penalty" /></td>
<td><input type="text" class="form-control" x-model="deposit_rate" /></td>
<td><input type="text" class="form-control" x-model="keep_rate" /></td>
<td><input type="text" class="form-control" x-model="warranty_rate" /></td>
<td></td>
<td></td>
</tr> -->
</tr>
<tr>
<th colspan="6">特記事項</th>
</tr>
@ -1140,4 +1221,5 @@ function convertDateTimeFormat($dateTimeStr) {
const salesman = '<?php echo $hope_customer['salesman']; ?>';
const pre_order_date = '<?php echo convertDateTimeFormat($hope_customer['pre_order_date']); ?>';
const is_renovation = '<?php echo $hope_customer['is_renovation']; ?>';
const token_link = '<?php echo $token_link; ?>';
</script>
Loading…
Cancel
Save