From 1c4e661413e155e9ac35053775c1cfc3bc484c43 Mon Sep 17 00:00:00 2001 From: 10994015 Date: Mon, 19 Feb 2024 18:53:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E6=A2=AF=E5=A1=AB=E5=83=B9=E5=AF=A9?= =?UTF-8?q?=E5=96=AE=E9=A0=81=E9=9D=A2=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/mkt/api/getElevatorPrice.php | 4 +- wms/mkt/api/getUsername.php | 12 + wms/mkt/api/postNewElevatorPricereview.php | 36 +- wms/mkt/api/postPricereviewSign.php | 4 +- wms/mkt/assets/js/pricereviewAlpine.js | 169 +++++++-- wms/mkt/css/pricereview.css | 40 ++- wms/mkt/css/pricereview.css.map | 2 +- wms/mkt/css/pricereview.scss | 42 ++- wms/mkt/pricereview-index.php | 2 +- wms/mkt/pricereviewCheck.php | 61 ++-- wms/mkt/pricereviewCreate.php | 386 +++++++++++++-------- 11 files changed, 529 insertions(+), 229 deletions(-) create mode 100644 wms/mkt/api/getUsername.php diff --git a/wms/mkt/api/getElevatorPrice.php b/wms/mkt/api/getElevatorPrice.php index 59b63464..64b3098c 100644 --- a/wms/mkt/api/getElevatorPrice.php +++ b/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; \ No newline at end of file +echo json_encode(['id'=>$id, 'price'=>$price]); \ No newline at end of file diff --git a/wms/mkt/api/getUsername.php b/wms/mkt/api/getUsername.php new file mode 100644 index 00000000..d959b5aa --- /dev/null +++ b/wms/mkt/api/getUsername.php @@ -0,0 +1,12 @@ +prepare($sql_str); +$stmt->bindParam(':accountid', $accountid); +$stmt->execute(); +$user = $stmt->fetch(PDO::FETCH_ASSOC); +echo $user['name']; \ No newline at end of file diff --git a/wms/mkt/api/postNewElevatorPricereview.php b/wms/mkt/api/postNewElevatorPricereview.php index e1e4493f..5ba7e342 100644 --- a/wms/mkt/api/postNewElevatorPricereview.php +++ b/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); @@ -183,7 +213,7 @@ try{ } $sql_str = "INSERT INTO pricereview_sign (mid, sign1, sign2, sign3, sign4, sign_total) - VALUES (:mid, :sign1, :sign2, :sign3, :sign4, :sign_total)"; + VALUES (:mid, :sign1, :sign2, :sign3, :sign4, :sign_total)"; $stmt = $conn->prepare($sql_str); $stmt->bindParam(':mid', $mid); $stmt->bindParam(':sign1', $sign1); diff --git a/wms/mkt/api/postPricereviewSign.php b/wms/mkt/api/postPricereviewSign.php index 229499a2..2a72efa5 100644 --- a/wms/mkt/api/postPricereviewSign.php +++ b/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 "; diff --git a/wms/mkt/assets/js/pricereviewAlpine.js b/wms/mkt/assets/js/pricereviewAlpine.js index 2b541145..c839c4b5 100644 --- a/wms/mkt/assets/js/pricereviewAlpine.js +++ b/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 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, //<br>() + 'item_spec': option.item_spec.trim().replaceAll('&', '').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 ; }, } } \ No newline at end of file diff --git a/wms/mkt/css/pricereview.css b/wms/mkt/css/pricereview.css index 31c10964..5986f447 100644 --- a/wms/mkt/css/pricereview.css +++ b/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 { diff --git a/wms/mkt/css/pricereview.css.map b/wms/mkt/css/pricereview.css.map index 1bbfb1e9..d113f93f 100644 --- a/wms/mkt/css/pricereview.css.map +++ b/wms/mkt/css/pricereview.css.map @@ -1 +1 @@ -{"version":3,"sources":["pricereview.scss","pricereview.css"],"names":[],"mappings":"AACI;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;EAC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ACTZ;;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"} \ No newline at end of file +{"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;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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"} \ No newline at end of file diff --git a/wms/mkt/css/pricereview.scss b/wms/mkt/css/pricereview.scss index 2a8deb67..ea3c48bc 100644 --- a/wms/mkt/css/pricereview.scss +++ b/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; } } diff --git a/wms/mkt/pricereview-index.php b/wms/mkt/pricereview-index.php index b2eb38b5..1021a118 100644 --- a/wms/mkt/pricereview-index.php +++ b/wms/mkt/pricereview-index.php @@ -1,6 +1,6 @@ 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"){ - - + + @@ -287,7 +302,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){ - + @@ -323,7 +338,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){ - + @@ -356,7 +371,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){ 材料 1.訂金 - + - + - + - + - + - + - + - + @@ -575,7 +590,7 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){ 區經理 - + 業務承辦人 - + 業務部協理 - + 總經理 - + - + @@ -723,4 +738,10 @@ if($user_id == "M0174" || $user_id == "M0175" || $user_id == "M0060"){ const is_renovate = ''; const user_id = ''; + + const sign1 = ''; + const sign2 = ''; + console.log('sign2====>', sign2); + const sign3 = ''; + const sign4 = ''; \ No newline at end of file diff --git a/wms/mkt/pricereviewCreate.php b/wms/mkt/pricereviewCreate.php index fcd3de9c..e1a303d8 100644 --- a/wms/mkt/pricereviewCreate.php +++ b/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) { -
+
- -
-
- -