diff --git a/wms/mkt/assets/js/pricereviewAlpine.js b/wms/mkt/assets/js/pricereviewAlpine.js index 97f3a28b..16d27648 100644 --- a/wms/mkt/assets/js/pricereviewAlpine.js +++ b/wms/mkt/assets/js/pricereviewAlpine.js @@ -1,815 +1,824 @@ const pricereviewCreate = () => { - return { - init() { - this.elevators = elevators; - console.log(this.elevators); - console.log(this.total_spec); - }, - - openFn: { - 4: '2U', - 5: "4PCO", - 7: "6PCO", - 8: "2S", - 9: "CO" - }, - optionalArr: { - 1: '標配', - 2: '選配', - 3: '選配', - }, - total_spec: total_spec, - options: options, - // orioptions: options, - searchtext: '', - kind: 1, - subkind: 1, - buttons: [], - modalSelectedOptions: {}, - selectedOptions: [], - elevators: [], - toElevators: [], - toElevatorNo: '', - currentOptionKey: '', - currentOtherOptionKey: '', - currentMaintainOptionKey: '', - optionKey: 0, - otherOptionKey: 0, - maintainOptionKey: 0, - modalElevatorInfo: { - spec: '', - person: '', - stop: '', - speed: '', - open: 'CO', - num: 1, - price: '', - sale_price: '', - facility_id: '', - }, - otherOptions: [], - modalOtherOptionInfo: { - pr_no: "", - name: "", - price: 0, - num: "", - }, - maintainOptions: [], - modalMaintainInfo: { - price: 0, - num: "", - memo: "", - }, - paymentRatio: [ - { - scale: 20, - ticket: 30, - }, - { - scale: 0, - ticket: '', - }, - { - scale: 50, - ticket: 30, - }, - { - scale: 0, - ticket: '', - }, - { - scale: 20, - ticket: 30, - }, - { - scale: 10, - ticket: 30, - }, - { - scale: 0, - ticket: '', - }, - ], - serviceFee: 0, - transactionDate: pre_order_date, - shippingDate: '', - remark: '', - async getElevatorPrice(idx) { - const spec = this.elevators[idx].specifications - const person = this.elevators[idx].person - const stop = this.elevators[idx].stop - 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 == "") { - console.log("公司並無提供此規格!!"); - } - this.elevators[idx].price = res.data - } catch (error) { - console.error("Error fetching elevator price:", error); - } - - }, + const pricereviewCreate = () => { + return { + init() { + init() { + this.elevators = elevators; + console.log(this.elevators); + console.log(this.total_spec); + }, + + openFn: { + 4: '2U', + 5: "4PCO", + 7: "6PCO", + 8: "2S", + 9: "CO" + + openFn: { + 4: '2U', + 5: "4PCO", + 7: "6PCO", + 8: "2S", + 9: "CO" + }, + optionalArr: { + 1: '標配', + 2: '選配', + 3: '選配', + }, + total_spec: total_spec, + options: options, + // orioptions: options, + searchtext: '', + kind: 1, + subkind: 1, + buttons: [], + modalSelectedOptions: { }, + selectedOptions: [], + elevators: [], + toElevators: [], + toElevatorNo: '', + currentOptionKey: '', + currentOtherOptionKey: '', + currentMaintainOptionKey: '', + optionKey: 0, + otherOptionKey: 0, + maintainOptionKey: 0, + modalElevatorInfo: { + spec: '', + person: '', + stop: '', + speed: '', + open: 'CO', + num: 1, + price: '', + sale_price: '', + facility_id: '', + }, + otherOptions: [], + modalOtherOptionInfo: { + pr_no: "", + name: "", + price: 0, + num: "", + }, + maintainOptions: [], + modalMaintainInfo: { + price: 0, + num: "", + memo: "", + }, + paymentRatio: [ + { + scale: 20, + ticket: 30, + }, + { + scale: 0, + ticket: '', + }, + { + scale: 50, + ticket: 30, + }, + { + scale: 0, + ticket: '', + }, + { + scale: 20, + ticket: 30, + }, + { + scale: 10, + ticket: 30, + }, + { + scale: 0, + ticket: '', + }, + ], + serviceFee: 0, + transactionDate: pre_order_date, + shippingDate: '', + remark: '', + async getElevatorPrice(idx) { + const spec = this.elevators[idx].specifications + const person = this.elevators[idx].person + const stop = this.elevators[idx].stop + 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 == "") { + console.log("公司並無提供此規格!!"); + } + this.elevators[idx].price = res.data + } catch (error) { + console.error("Error fetching elevator price:", error); + } + + }, async getModalElevatorPrice() { - let model = this.modalElevatorInfo.spec + '-' + this.modalElevatorInfo.person + '*' + this.modalElevatorInfo.stop + '-' + this.modalElevatorInfo.open + this.modalElevatorInfo.speed; - try { - const res = await axios.get("./api/getElevatorPrice.php", { params: { model: model } }) - console.log(res.data); - if (res.data == null || res.data == "") { - console.log("公司並無提供此規格!!"); - } - this.modalElevatorInfo.price = res.data - } catch (error) { - console.error("Error fetching elevator price:", error); - } - }, - initButtons(kind) { - if (kind == 'A') { - this.buttons = [ - { name: '車廂意匠', type: 'A1' } - ] - } else if (kind == 'B') { - this.buttons = [ - { name: '天井', type: 'B1' }, - { name: '地板', type: 'B2' }, - { name: '操縱盤', type: 'B3' }, - { name: '扶手', type: 'B4' }, - { name: '車廂門與層門(轎門/層門)', type: 'B5' }, - { name: '轎壁(車廂側板)', type: 'B6' }, - { name: '其他車廂內裝配件', type: 'B7' }, - ] - } else if (kind == 'C') { - this.buttons = [ - { name: '框', type: 'C1' }, - { name: '乘場指示器', type: 'C2' }, - { name: '燈', type: 'C3' }, - { name: '方式與門', type: 'C4' }, - ] - } else if (kind == 'D') { - this.buttons = [ - { name: '功能與配置', type: 'D1' }, - { name: 'OH與樓高', type: 'D2' }, - ] - } else if (kind == 'E') { - this.buttons = [ - { name: '平台梯', type: 'E1' }, - ] - } else if (kind == 'F') { - this.buttons = [ - { name: '汰改', type: 'F1' }, - ] - } else if (kind == 1) { - this.buttons = [] - } - }, - optionSubCategory: 1, - initOptinos() { - this.options.forEach(option => { - option.isShow = 1; - }) - }, - searchOptions(kind = this.kind, subkind = this.subkind) { - if (kind != null) this.kind = kind; - if (subkind != null) this.subkind = subkind; - this.initOptinos(); - this.initButtons(kind); - this.options.forEach(option => { - if (option.kind != this.kind && this.kind != 1) { - option.isShow = 0; - } else { - if (option.subkind != this.subkind && this.subkind != 1) { - option.isShow = 0; - } - } - if (option.isShow == 1) { - if (option.group_name == null) option.group_name = '' - if (option.spec == null) option.spec = '' - if (option.memo == null) option.memo = '' - if (option.price == null) option.price = 0 - if (option.unit == null) option.unit = '' - if (String(option.id).includes(this.searchtext) || option.group_name.includes(this.searchtext) || option.memo.toLowerCase().includes(this.searchtext) || option.spec.toLowerCase().includes(this.searchtext) || option.unit.includes(this.searchtext) || String(option.price).includes(this.searchtext)) { - option.isShow = 1 - } else { - option.isShow = 0 - } - } - }) - }, - selectOption(idx, id, name, price, memo) { - this.options[idx].selected = this.options[idx].selected == 1 ? 0 : 1; - - if (this.modalSelectedOptions.hasOwnProperty(idx)) { - delete this.modalSelectedOptions[idx]; - } else { - //this.optionKey => 已選option 流水號, idx:option表內的流水號, id:option 資料庫的ID - this.modalSelectedOptions[idx] = { key: this.optionKey, 'idx': idx, 'id': id, 'name': name, 'price': price, qty: 1, 'memo': memo, 'toElevator': [] } - } - this.optionKey++; - }, - initModalSelectedOptions() { - this.modalSelectedOptions = {} - this.options.forEach(option => { - option.selected = 0 - }) - 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.hideOptionsModal(); - }, - hideOptionsModal() { - this.$refs.optionsModal.style.display = 'none'; - body.style.overflow = 'auto' - }, - totalElevatorsPrice() { - return this.elevators.reduce((total, elevator) => { - return total + (elevator.spec_num * elevator.price); - }, 0); - }, - totalElevatorsNum() { - return this.elevators.reduce((total, elevator) => { - return total + Number(elevator.spec_num); - }, 0) - }, - totalElevatorsSalePrice() { - return this.elevators.reduce((total, elevator) => { - return total + (elevator.spec_num * elevator.spec_price); - }, 0); - }, - totalOptionsPrice() { - return this.selectedOptions.reduce((total, option) => { - return total + (option.qty * option.price); - }, 0); - }, - openAddElevatorFn() { - - }, - createElevatorFn() { - if (this.modalElevatorInfo.spec == '') return alert("請選擇電梯規格"); - if (this.modalElevatorInfo.stop == '') return alert("請填入停數"); - if (this.modalElevatorInfo.speed == '') return alert("請選擇速度"); - if (this.modalElevatorInfo.open == '') return alert("請選擇開梯方式"); - if (this.modalElevatorInfo.person == '') return alert("請填入人乘/載重"); - if (this.modalElevatorInfo.num == '') return alert("請填入數量"); - if (this.modalElevatorInfo.sale_price == '') return alert("請填入售價"); - this.total_spec++; - this.elevators.push({ - id: this.total_spec, - specifications: this.modalElevatorInfo.spec, - person: this.modalElevatorInfo.person, - stop: this.modalElevatorInfo.stop, - speed: this.modalElevatorInfo.speed, - open_converted: this.modalElevatorInfo.open, - spec_price: this.modalElevatorInfo.sale_price, - price: this.modalElevatorInfo.price, - open: '', - spec_num: this.modalElevatorInfo.num, - }); - this.modalElevatorInfo = { - spec: '', - person: '', - stop: '', - speed: '', - open: 'CO', - num: 1, - price: '', - sale_price: '', - }; - this.$refs.closeCreateElevatorModalBtn.click(); - }, - copyElevator(idx) { - const spec = this.elevators[idx].specifications - const person = this.elevators[idx].person - const stop = this.elevators[idx].stop - const open_converted = this.elevators[idx].open_converted - const speed = this.elevators[idx].speed - const spec_price = this.elevators[idx].spec_price - 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({ - id: this.total_spec, - specifications: spec, - person: person, - stop: stop, - speed: speed, - open_converted: open_converted, - spec_price: spec_price, - price: price, - open: open, - spec_num: spec_num, - facility_id: facility_id, - }); - console.log(this.elevators); - }, - addOptionToElevator(key) { - this.currentOptionKey = key; - this.toElevators = []; - this.toElevatorNo = ""; - const matchElevators = this.selectedOptions.filter(option => option.key == key)[0].toElevator.map(elevator => elevator.id) - console.log(matchElevators); - this.toElevatorNo = matchElevators[0] - this.elevators.forEach(elevator => { - if (elevator.price > 0) { - this.toElevators.push({ - id: elevator.id, - model: elevator.specifications + '-' + elevator.person + '*' + elevator.stop + '-' + elevator.open_converted + elevator.speed, - checked: matchElevators.includes(elevator.id) ? 1 : 0, - }) - } - }) - this.$refs.toElevatorModal.style.display = 'block'; - body.style.overflow = 'hidden' - }, - addOtherOptionToElevator(id) { - this.currentOtherOptionKey = id; - this.toElevators = []; - this.toElevatorNo = ""; - const matchElevators = this.otherOptions.filter(option => option.id == id)[0].toElevator.map(elevator => elevator.id) - this.toElevatorNo = matchElevators[0] - this.elevators.forEach(elevator => { - if (elevator.price > 0) { - this.toElevators.push({ - id: elevator.id, - model: elevator.specifications + '-' + elevator.person + '*' + elevator.stop + '-' + elevator.open_converted + elevator.speed, - checked: matchElevators.includes(elevator.id) ? 1 : 0, - }) - } - }) - this.$refs.toOtherOptionElevatorModal.style.display = 'block'; - body.style.overflow = 'hidden' - }, - chkOptionToElevators() { - const checkedOptions = []; - // this.toElevators.forEach(elevator=>{ - // if(elevator.checked){ - // checkedOptions.push({ - // id: elevator.id, - // model: elevator.model, - // }); - // } - // }) - const matchElevators = this.elevators.filter(elevator => elevator.id == this.toElevatorNo)[0] - checkedOptions.push({ - id: this.toElevatorNo, - model: matchElevators['specifications'] + '-' + matchElevators['person'] + '*' + matchElevators['stop'] + '-' + matchElevators['open_converted'] + matchElevators['speed'], - }) - this.selectedOptions.forEach(option => { - if (option.key == this.currentOptionKey) { - option.toElevator = []; - option.toElevator.push(...checkedOptions) - } - }) - this.currentOptionKey = '' - this.hideToElevatorModal(); - }, - chkOtherOptionToElevators() { - const checkedOptions = []; - // this.toElevators.forEach(elevator=>{ - // if(elevator.checked){ - // checkedOptions.push({ - // id: elevator.id, - // model: elevator.model, - // }); - // } - // }) - const matchElevators = this.elevators.filter(elevator => elevator.id == this.toElevatorNo)[0] - checkedOptions.push({ - id: this.toElevatorNo, - model: matchElevators['specifications'] + '-' + matchElevators['person'] + '*' + matchElevators['stop'] + '-' + matchElevators['open_converted'] + matchElevators['speed'], - }) - this.otherOptions.forEach(option => { - if (option.id == this.currentOtherOptionKey) { - option.toElevator = []; - option.toElevator.push(...checkedOptions) - } - }) - - this.currentOtherOptionKey = '' - - this.hideToOtherOptionElevatorModal(); - }, - removeElevator(id) { - if (!confirm("確定刪除嗎?")) return; - this.elevators = this.elevators.filter(elevator => elevator.id != id) - const issetElevators = []; - this.elevators.forEach(elevator => { - issetElevators.push(elevator.id); - }) - - this.selectedOptions.forEach(option => { - option.toElevator = option.toElevator.filter(el => { - return issetElevators.includes(el.id) - }) - }) - console.log(this.selectedOptions); - }, - removeOption(key) { - console.log(this.selectedOptions); - this.selectedOptions = this.selectedOptions.filter(option => option.key != key) - }, - removeOtherOption(id) { - this.otherOptions = this.otherOptions.filter(option => option.id != id) - }, - createOtherOptionFn() { - this.otherOptions.push({ - id: this.otherOptionKey, - pr_no: this.modalOtherOptionInfo.pr_no, - name: this.modalOtherOptionInfo.name, - price: this.modalOtherOptionInfo.price, - num: this.modalOtherOptionInfo.num, - toElevator: [], - }) - this.modalOtherOptionInfo = { - pr_no: '', - name: '', - price: 0, - num: '', - } - this.otherOptionKey++; - console.log(this.otherOptions); - this.$refs.closeCreateOtherOptionModalBtn.click(); - }, - totalOtherOptionsPrice() { - return this.otherOptions.reduce((total, option) => { - return total + (Number(option.num) * Number(option.price)); - }, 0); - }, - totalOtherOptionsNum() { - return this.otherOptions.reduce((total, option) => { - return total + Number(option.num); - }, 0); - }, - createMaintainOptionFn() { - this.maintainOptions.push({ - id: this.maintainOptionKey, - price: this.modalMaintainInfo.price, - num: this.modalMaintainInfo.num, - memo: this.modalMaintainInfo.memo, - toElevator: [], - }) - this.modalMaintainInfo = { - price: 0, - num: "", - memo: "", - } - this.maintainOptionKey++; - this.$refs.closeCreateMaintainOptionModalBtn.click(); - }, - totalMaintainOptionsPrice() { - return this.maintainOptions.reduce((total, option) => { - return total + (Number(option.num) * Number(option.price)); - }, 0); - }, - totalMaintainOptionsNum() { - return this.maintainOptions.reduce((total, option) => { - return total + Number(option.num); - }, 0); - }, - chkMaintainOptionToElevators() { - const checkedOptions = []; - // this.toElevators.forEach(elevator=>{ - // if(elevator.checked){ - // checkedOptions.push({ - // id: elevator.id, - // model: elevator.model, - // }); - // } - // }) - const matchElevators = this.elevators.filter(elevator => elevator.id == this.toElevatorNo)[0] - checkedOptions.push({ - id: this.toElevatorNo, - model: matchElevators['specifications'] + '-' + matchElevators['person'] + '*' + matchElevators['stop'] + '-' + matchElevators['open_converted'] + matchElevators['speed'], - }) - this.maintainOptions.forEach(option => { - if (option.id == this.currentMaintainOptionKey) { - option.toElevator = []; - option.toElevator.push(...checkedOptions) - } - }) - this.currentMaintainOptionKey = '' - this.hideToMaintainOptionElevatorModal(); - }, - addMaintainOptionToElevator(id) { - this.currentMaintainOptionKey = id; - this.toElevators = []; - this.toElevatorNo = ""; - const matchElevators = this.maintainOptions.filter(option => option.id == id)[0].toElevator.map(elevator => elevator.id) - this.toElevatorNo = matchElevators[0] - this.elevators.forEach(elevator => { - if (elevator.price > 0) { - this.toElevators.push({ - id: elevator.id, - model: elevator.specifications + '-' + elevator.person + '*' + elevator.stop + '-' + elevator.open_converted + elevator.speed, - checked: matchElevators.includes(elevator.id) ? 1 : 0, - }) - } - }) - - this.$refs.toMaintainOptionElevatorModal.style.display = 'block'; - body.style.overflow = 'hidden' - }, - removeMaintainOption(id) { - this.maintainOptions = this.maintainOptions.filter(option => option.id != id) - }, - totalPrice() { - return this.totalElevatorsPrice() + this.totalOptionsPrice() + this.totalOtherOptionsPrice() + this.totalMaintainOptionsPrice(); - }, - totalSalePrice() { - return this.elevators.reduce((total, elevator) => { - return total + (elevator.spec_num * elevator.spec_price); - }, 0); - }, - scalePrice(scale) { - if (scale === '') return 0; - return this.totalSalePrice() * scale / 100; - }, - totalScale() { - let total = 0; - Object.keys(this.paymentRatio).forEach(pay => { - if (this.paymentRatio[pay].scale != '' && this.paymentRatio[pay].scale > 0) { - total += Number(this.paymentRatio[pay].scale) - } - }) - - return total; - }, - customerInfo: { - contractno: contractno, - company: customer, - manager: manager, - address: address, - case_name: case_name, - uscc: uscc, - person: salesman, - }, - penalty: "", - deposit_rate: 0, - keep_rate: 0, - warranty_rate: 0, - submit() { - const form = new FormData(); - form.append('contractno', contractno); - form.append('ekind', "新梯"); - form.append('person', this.customerInfo.person); - form.append('company', this.customerInfo.company); - form.append('case_name', this.customerInfo.case_name); - form.append('address', this.customerInfo.address); - form.append('price_lowest', this.totalPrice()); - form.append('price_total', this.totalSalePrice()); - form.append('price_rate', Math.round(this.totalSalePrice() / this.totalPrice() * 100 * 10) / 10); - form.append('special_fee', this.serviceFee); - form.append('predeal_date', this.transactionDate); - form.append('facilitok_date', this.shippingDate); - form.append('penalty', this.penalty); - form.append('deposit_rate', this.deposit_rate); - form.append('keep_rate', this.keep_rate); - form.append('warranty_rate', this.warranty_rate); - form.append('memo', this.remark); - form.append('status', "YS"); - form.append('attatch1', ""); - form.append('attatch2', ""); - - - form.append('elevators', JSON.stringify(this.elevators)); - - form.append('options', JSON.stringify(this.selectedOptions)); - form.append('otherOptions', JSON.stringify(this.otherOptions)); - form.append('maintainOptions', JSON.stringify(this.maintainOptions)); - - form.append('paymentRatio', JSON.stringify(this.paymentRatio)); - - axios.post('./api/postNewElevatorPricereview.php', form).then(res => { - console.log(res.data); - if (res.data == "success") { - alert("送審成功!"); - window.location.href = './pricereview-index.php?' + token_link; - } - }).catch(err => { - console.error(err); - }) - }, + let model = this.modalElevatorInfo.spec + '-' + this.modalElevatorInfo.person + '*' + this.modalElevatorInfo.stop + '-' + this.modalElevatorInfo.open + this.modalElevatorInfo.speed; + try { + const res = await axios.get("./api/getElevatorPrice.php", { params: { model: model } }) + console.log(res.data); + if (res.data == null || res.data == "") { + console.log("公司並無提供此規格!!"); + } + this.modalElevatorInfo.price = res.data + } catch (error) { + console.error("Error fetching elevator price:", error); + } + }, + initButtons(kind) { + if (kind == 'A') { + this.buttons = [ + { name: '車廂意匠', type: 'A1' } + ] + } else if (kind == 'B') { + this.buttons = [ + { name: '天井', type: 'B1' }, + { name: '地板', type: 'B2' }, + { name: '操縱盤', type: 'B3' }, + { name: '扶手', type: 'B4' }, + { name: '車廂門與層門(轎門/層門)', type: 'B5' }, + { name: '轎壁(車廂側板)', type: 'B6' }, + { name: '其他車廂內裝配件', type: 'B7' }, + ] + } else if (kind == 'C') { + this.buttons = [ + { name: '框', type: 'C1' }, + { name: '乘場指示器', type: 'C2' }, + { name: '燈', type: 'C3' }, + { name: '方式與門', type: 'C4' }, + ] + } else if (kind == 'D') { + this.buttons = [ + { name: '功能與配置', type: 'D1' }, + { name: 'OH與樓高', type: 'D2' }, + ] + } else if (kind == 'E') { + this.buttons = [ + { name: '平台梯', type: 'E1' }, + ] + } else if (kind == 'F') { + this.buttons = [ + { name: '汰改', type: 'F1' }, + ] + } else if (kind == 1) { + this.buttons = [] + } + }, + optionSubCategory: 1, + initOptinos() { + this.options.forEach(option => { + option.isShow = 1; + }) + }, + searchOptions(kind = this.kind, subkind = this.subkind) { + if (kind != null) this.kind = kind; + if (subkind != null) this.subkind = subkind; + this.initOptinos(); + this.initButtons(kind); + this.options.forEach(option => { + if (option.kind != this.kind && this.kind != 1) { + option.isShow = 0; + } else { + if (option.subkind != this.subkind && this.subkind != 1) { + option.isShow = 0; + } + } + if (option.isShow == 1) { + if (option.group_name == null) option.group_name = '' + if (option.spec == null) option.spec = '' + if (option.memo == null) option.memo = '' + if (option.price == null) option.price = 0 + if (option.unit == null) option.unit = '' + if (String(option.id).includes(this.searchtext) || option.group_name.includes(this.searchtext) || option.memo.toLowerCase().includes(this.searchtext) || option.spec.toLowerCase().includes(this.searchtext) || option.unit.includes(this.searchtext) || String(option.price).includes(this.searchtext)) { + option.isShow = 1 + } else { + option.isShow = 0 + } + } + }) + }, + selectOption(idx, id, name, price, memo) { + this.options[idx].selected = this.options[idx].selected == 1 ? 0 : 1; + + if (this.modalSelectedOptions.hasOwnProperty(idx)) { + delete this.modalSelectedOptions[idx]; + } else { + //this.optionKey => 已選option 流水號, idx:option表內的流水號, id:option 資料庫的ID + this.modalSelectedOptions[idx] = { key: this.optionKey, 'idx': idx, 'id': id, 'name': name, 'price': price, qty: 1, 'memo': memo, 'toElevator': [] } + } + this.optionKey++; + }, + initModalSelectedOptions() { + this.modalSelectedOptions = {} + this.options.forEach(option => { + option.selected = 0 + }) + 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.hideOptionsModal(); + }, + hideOptionsModal() { + this.$refs.optionsModal.style.display = 'none'; + body.style.overflow = 'auto' + }, + totalElevatorsPrice() { + return this.elevators.reduce((total, elevator) => { + return total + (elevator.spec_num * elevator.price); + }, 0); + }, + totalElevatorsNum() { + return this.elevators.reduce((total, elevator) => { + return total + Number(elevator.spec_num); + }, 0) + }, + totalElevatorsSalePrice() { + return this.elevators.reduce((total, elevator) => { + return total + (elevator.spec_num * elevator.spec_price); + }, 0); + }, + totalOptionsPrice() { + return this.selectedOptions.reduce((total, option) => { + return total + (option.qty * option.price); + }, 0); + }, + openAddElevatorFn() { + + }, + createElevatorFn() { + if (this.modalElevatorInfo.spec == '') return alert("請選擇電梯規格"); + if (this.modalElevatorInfo.stop == '') return alert("請填入停數"); + if (this.modalElevatorInfo.speed == '') return alert("請選擇速度"); + if (this.modalElevatorInfo.open == '') return alert("請選擇開梯方式"); + if (this.modalElevatorInfo.person == '') return alert("請填入人乘/載重"); + if (this.modalElevatorInfo.num == '') return alert("請填入數量"); + if (this.modalElevatorInfo.sale_price == '') return alert("請填入售價"); + this.total_spec++; + this.elevators.push({ + id: this.total_spec, + specifications: this.modalElevatorInfo.spec, + person: this.modalElevatorInfo.person, + stop: this.modalElevatorInfo.stop, + speed: this.modalElevatorInfo.speed, + open_converted: this.modalElevatorInfo.open, + spec_price: this.modalElevatorInfo.sale_price, + price: this.modalElevatorInfo.price, + open: '', + spec_num: this.modalElevatorInfo.num, + }); + this.modalElevatorInfo = { + spec: '', + person: '', + stop: '', + speed: '', + open: 'CO', + num: 1, + price: '', + sale_price: '', + }; + this.$refs.closeCreateElevatorModalBtn.click(); + }, + copyElevator(idx) { + const spec = this.elevators[idx].specifications + const person = this.elevators[idx].person + const stop = this.elevators[idx].stop + const open_converted = this.elevators[idx].open_converted + const speed = this.elevators[idx].speed + const spec_price = this.elevators[idx].spec_price + 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({ + id: this.total_spec, + specifications: spec, + person: person, + stop: stop, + speed: speed, + open_converted: open_converted, + spec_price: spec_price, + price: price, + open: open, + spec_num: spec_num, + facility_id: facility_id, + }); + console.log(this.elevators); + }, + addOptionToElevator(key) { + this.currentOptionKey = key; + this.toElevators = []; + this.toElevatorNo = ""; + const matchElevators = this.selectedOptions.filter(option => option.key == key)[0].toElevator.map(elevator => elevator.id) + console.log(matchElevators); + this.toElevatorNo = matchElevators[0] + this.elevators.forEach(elevator => { + if (elevator.price > 0) { + this.toElevators.push({ + id: elevator.id, + model: elevator.specifications + '-' + elevator.person + '*' + elevator.stop + '-' + elevator.open_converted + elevator.speed, + checked: matchElevators.includes(elevator.id) ? 1 : 0, + }) + } + }) + this.$refs.toElevatorModal.style.display = 'block'; + body.style.overflow = 'hidden' + }, + addOtherOptionToElevator(id) { + this.currentOtherOptionKey = id; + this.toElevators = []; + this.toElevatorNo = ""; + const matchElevators = this.otherOptions.filter(option => option.id == id)[0].toElevator.map(elevator => elevator.id) + this.toElevatorNo = matchElevators[0] + this.elevators.forEach(elevator => { + if (elevator.price > 0) { + this.toElevators.push({ + id: elevator.id, + model: elevator.specifications + '-' + elevator.person + '*' + elevator.stop + '-' + elevator.open_converted + elevator.speed, + checked: matchElevators.includes(elevator.id) ? 1 : 0, + }) + } + }) + this.$refs.toOtherOptionElevatorModal.style.display = 'block'; + body.style.overflow = 'hidden' + }, + chkOptionToElevators() { + const checkedOptions = []; + // this.toElevators.forEach(elevator=>{ + // if(elevator.checked){ + // checkedOptions.push({ + // id: elevator.id, + // model: elevator.model, + // }); + // } + // }) + const matchElevators = this.elevators.filter(elevator => elevator.id == this.toElevatorNo)[0] + checkedOptions.push({ + id: this.toElevatorNo, + model: matchElevators['specifications'] + '-' + matchElevators['person'] + '*' + matchElevators['stop'] + '-' + matchElevators['open_converted'] + matchElevators['speed'], + }) + this.selectedOptions.forEach(option => { + if (option.key == this.currentOptionKey) { + option.toElevator = []; + option.toElevator.push(...checkedOptions) + } + }) + this.currentOptionKey = '' + this.hideToElevatorModal(); + }, + chkOtherOptionToElevators() { + const checkedOptions = []; + // this.toElevators.forEach(elevator=>{ + // if(elevator.checked){ + // checkedOptions.push({ + // id: elevator.id, + // model: elevator.model, + // }); + // } + // }) + const matchElevators = this.elevators.filter(elevator => elevator.id == this.toElevatorNo)[0] + checkedOptions.push({ + id: this.toElevatorNo, + model: matchElevators['specifications'] + '-' + matchElevators['person'] + '*' + matchElevators['stop'] + '-' + matchElevators['open_converted'] + matchElevators['speed'], + }) + this.otherOptions.forEach(option => { + if (option.id == this.currentOtherOptionKey) { + option.toElevator = []; + option.toElevator.push(...checkedOptions) + } + }) - } -} + this.currentOtherOptionKey = '' + this.hideToOtherOptionElevatorModal(); + }, + removeElevator(id) { + if (!confirm("確定刪除嗎?")) return; + this.elevators = this.elevators.filter(elevator => elevator.id != id) + const issetElevators = []; + this.elevators.forEach(elevator => { + issetElevators.push(elevator.id); + }) -const pricereviewCheck = () => { - return { - init() { - this.elevators = items.filter(item => item.item_group == 'A'); - this.elevators.forEach(el => { - el.options = [] - el.optionsTotalPrice = 0; - el.otherOptions = [] - el.otherOptionsTotalPrice = 0; - el.maintainOptions = [] - el.maintainOptionsTotalPrice = 0; - }) - this.options = options; - this.otherOptions = items.filter(item => item.item_group == 'E'); - this.maintainOptions = items.filter(item => item.item_group == 'D'); - console.log(this.options); - - this.elevators.forEach((elevator, idx) => { - - this.options.forEach(option => { - 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(), - 'item_unit_price': option.item_unit_price, - 'item_qty': option.item_qty, - 'mi': Math.round(option.option_mi), + this.selectedOptions.forEach(option => { + option.toElevator = option.toElevator.filter(el => { + return issetElevators.includes(el.id) + }) }) - } - }) - - this.otherOptions.forEach(option => { - if (option.option_relate_spec == elevator.item_no) { - elevator.otherOptionsTotalPrice += option.item_unit_price * option.item_qty - this.elevators[idx].otherOptions.push({ - 'id': option.id, - 'item_spec': option.item_spec.trim(), - 'item_unit_price': option.item_unit_price, - 'item_qty': option.item_qty, - 'mi': Math.round(option.item_unit_price), + console.log(this.selectedOptions); + }, + removeOption(key) { + console.log(this.selectedOptions); + this.selectedOptions = this.selectedOptions.filter(option => option.key != key) + }, + removeOtherOption(id) { + this.otherOptions = this.otherOptions.filter(option => option.id != id) + }, + createOtherOptionFn() { + this.otherOptions.push({ + id: this.otherOptionKey, + pr_no: this.modalOtherOptionInfo.pr_no, + name: this.modalOtherOptionInfo.name, + price: this.modalOtherOptionInfo.price, + num: this.modalOtherOptionInfo.num, + toElevator: [], }) - } - }) - - this.maintainOptions.forEach(option => { - if (option.option_relate_spec == elevator.item_no) { - elevator.maintainOptionsTotalPrice += option.item_unit_price * option.item_qty - this.elevators[idx].maintainOptions.push({ - 'id': option.id, - 'item_spec': option.item_spe.trim(), - 'item_unit_price': option.item_unit_price, - 'item_qty': option.item_qty, - 'mi': Math.round(option.item_unit_price), + this.modalOtherOptionInfo = { + pr_no: '', + name: '', + price: 0, + num: '', + } + this.otherOptionKey++; + console.log(this.otherOptions); + this.$refs.closeCreateOtherOptionModalBtn.click(); + }, + totalOtherOptionsPrice() { + return this.otherOptions.reduce((total, option) => { + return total + (Number(option.num) * Number(option.price)); + }, 0); + }, + totalOtherOptionsNum() { + return this.otherOptions.reduce((total, option) => { + return total + Number(option.num); + }, 0); + }, + createMaintainOptionFn() { + this.maintainOptions.push({ + id: this.maintainOptionKey, + price: this.modalMaintainInfo.price, + num: this.modalMaintainInfo.num, + memo: this.modalMaintainInfo.memo, + toElevator: [], + }) + this.modalMaintainInfo = { + price: 0, + num: "", + memo: "", + } + this.maintainOptionKey++; + this.$refs.closeCreateMaintainOptionModalBtn.click(); + }, + totalMaintainOptionsPrice() { + return this.maintainOptions.reduce((total, option) => { + return total + (Number(option.num) * Number(option.price)); + }, 0); + }, + totalMaintainOptionsNum() { + return this.maintainOptions.reduce((total, option) => { + return total + Number(option.num); + }, 0); + }, + chkMaintainOptionToElevators() { + const checkedOptions = []; + // this.toElevators.forEach(elevator=>{ + // if(elevator.checked){ + // checkedOptions.push({ + // id: elevator.id, + // model: elevator.model, + // }); + // } + // }) + const matchElevators = this.elevators.filter(elevator => elevator.id == this.toElevatorNo)[0] + checkedOptions.push({ + id: this.toElevatorNo, + model: matchElevators['specifications'] + '-' + matchElevators['person'] + '*' + matchElevators['stop'] + '-' + matchElevators['open_converted'] + matchElevators['speed'], + }) + this.maintainOptions.forEach(option => { + if (option.id == this.currentMaintainOptionKey) { + option.toElevator = []; + option.toElevator.push(...checkedOptions) + } + }) + this.currentMaintainOptionKey = '' + this.hideToMaintainOptionElevatorModal(); + }, + addMaintainOptionToElevator(id) { + this.currentMaintainOptionKey = id; + this.toElevators = []; + this.toElevatorNo = ""; + const matchElevators = this.maintainOptions.filter(option => option.id == id)[0].toElevator.map(elevator => elevator.id) + this.toElevatorNo = matchElevators[0] + this.elevators.forEach(elevator => { + if (elevator.price > 0) { + this.toElevators.push({ + id: elevator.id, + model: elevator.specifications + '-' + elevator.person + '*' + elevator.stop + '-' + elevator.open_converted + elevator.speed, + checked: matchElevators.includes(elevator.id) ? 1 : 0, + }) + } }) - } - }) - this.qty += Number(elevator.item_qty); - this.elevators_total_price += Number(elevator.item_qty) * Number(elevator.item_unit_price); - //MAE100-15*24-CO105 - const model = elevator.item_spec; - let spec = model.split('-')[0]; - let person = model.split('-')[1].split('*')[0]; - let stop = model.split('-')[1].split('*')[1].split('-')[0]; - let open = model.split('-')[2]; - let speed = ''; - for (let i = 0; i < this.openFn.length; i++) { - if (open.includes(this.openFn[i])) { - speed = open.replace(this.openFn[i], '') - open = this.openFn[i]; - break; - } - } - this.getElevatorMi(idx, spec, person, stop, open, speed, elevator.item_weight) + this.$refs.toMaintainOptionElevatorModal.style.display = 'block'; + body.style.overflow = 'hidden' + }, + removeMaintainOption(id) { + this.maintainOptions = this.maintainOptions.filter(option => option.id != id) + }, + totalPrice() { + return this.totalElevatorsPrice() + this.totalOptionsPrice() + this.totalOtherOptionsPrice() + this.totalMaintainOptionsPrice(); + }, + totalSalePrice() { + return this.elevators.reduce((total, elevator) => { + return total + (elevator.spec_num * elevator.spec_price); + }, 0); + }, + scalePrice(scale) { + if (scale === '') return 0; + return this.totalSalePrice() * scale / 100; + }, + totalScale() { + let total = 0; + Object.keys(this.paymentRatio).forEach(pay => { + if (this.paymentRatio[pay].scale != '' && this.paymentRatio[pay].scale > 0) { + total += Number(this.paymentRatio[pay].scale) + } + }) - }) + return total; + }, + customerInfo: { + contractno: contractno, + company: customer, + manager: manager, + address: address, + case_name: case_name, + uscc: uscc, + person: salesman, + }, + penalty: "", + deposit_rate: 0, + keep_rate: 0, + warranty_rate: 0, + submit() { + const form = new FormData(); + form.append('contractno', contractno); + form.append('ekind', "新梯"); + form.append('person', this.customerInfo.person); + form.append('company', this.customerInfo.company); + form.append('case_name', this.customerInfo.case_name); + form.append('address', this.customerInfo.address); + form.append('price_lowest', this.totalPrice()); + form.append('price_total', this.totalSalePrice()); + form.append('price_rate', Math.round(this.totalSalePrice() / this.totalPrice() * 100 * 10) / 10); + form.append('special_fee', this.serviceFee); + form.append('predeal_date', this.transactionDate); + form.append('facilitok_date', this.shippingDate); + form.append('penalty', this.penalty); + form.append('deposit_rate', this.deposit_rate); + form.append('keep_rate', this.keep_rate); + form.append('warranty_rate', this.warranty_rate); + form.append('memo', this.remark); + form.append('status', "YS"); + form.append('attatch1', ""); + form.append('attatch2', ""); + + + form.append('elevators', JSON.stringify(this.elevators)); + + form.append('options', JSON.stringify(this.selectedOptions)); + form.append('otherOptions', JSON.stringify(this.otherOptions)); + form.append('maintainOptions', JSON.stringify(this.maintainOptions)); + + form.append('paymentRatio', JSON.stringify(this.paymentRatio)); + + axios.post('./api/postNewElevatorPricereview.php', form).then(res => { + console.log(res.data); + if (res.data == "success") { + alert("送審成功!"); + window.location.href = './pricereview-index.php?' + token_link; + } + }).catch(err => { + console.error(err); + }) + }, - }, - async getElevatorMi(idx, spec, person, stop, open, speed, item_weight) { - try { - const res = await axios.get('./api/getElevatorMi.php', { - params: { - spec: spec, - person: person, - stop: stop, - open: open, - speed: speed, - weight: item_weight - } - }) - console.log('---->', res.data); - if (res.data) { - this.elevators[idx].mi = res.data - this.elevators[idx].totalMi = res.data['equipment_fee'] + res.data['customs_shipping_fee'] + res.data['free1y_fee'] + res.data['install_fee'] + res.data['other_fee'] + res.data['transport_site_fee'] + res.data['unloading_fee']; - } else { - this.isNotfoundMi = true; - this.elevators[idx].mi = { - 'equipment_fee': 0, - 'customs_shipping_fee': 0, - 'free1y_fee': 0, - 'install_fee': 0, - 'other_fee': 0, - 'transport_site_fee': 0, - 'unloading_fee': 0 - } } + } - console.log(this.elevators[idx]); +const pricereviewCheck = () => { + return { + init() { + this.elevators = items.filter(item => item.item_group == 'A'); + this.elevators.forEach(el => { + el.options = [] + el.optionsTotalPrice = 0; + el.otherOptions = [] + el.otherOptionsTotalPrice = 0; + el.maintainOptions = [] + el.maintainOptionsTotalPrice = 0; + }) + this.options = options; + this.otherOptions = items.filter(item => item.item_group == 'E'); + this.maintainOptions = items.filter(item => item.item_group == 'D'); + console.log(this.options); + + this.elevators.forEach((elevator, idx) => { + + this.options.forEach(option => { + 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(), + 'item_unit_price': option.item_unit_price, + 'item_qty': option.item_qty, + 'mi': Math.round(option.option_mi), + }) + } + }) + + this.otherOptions.forEach(option => { + if (option.option_relate_spec == elevator.item_no) { + elevator.otherOptionsTotalPrice += option.item_unit_price * option.item_qty + this.elevators[idx].otherOptions.push({ + 'id': option.id, + 'item_spec': option.item_spec.trim(), + 'item_unit_price': option.item_unit_price, + 'item_qty': option.item_qty, + 'mi': Math.round(option.item_unit_price), + }) + } + }) + + this.maintainOptions.forEach(option => { + if (option.option_relate_spec == elevator.item_no) { + elevator.maintainOptionsTotalPrice += option.item_unit_price * option.item_qty + this.elevators[idx].maintainOptions.push({ + 'id': option.id, + 'item_spec': option.item_spe.trim(), + 'item_unit_price': option.item_unit_price, + 'item_qty': option.item_qty, + 'mi': Math.round(option.item_unit_price), + }) + } + }) + this.qty += Number(elevator.item_qty); + this.elevators_total_price += Number(elevator.item_qty) * Number(elevator.item_unit_price); + //MAE100-15*24-CO105 + const model = elevator.item_spec; + let spec = model.split('-')[0]; + let person = model.split('-')[1].split('*')[0]; + let stop = model.split('-')[1].split('*')[1].split('-')[0]; + let open = model.split('-')[2]; + let speed = ''; + for (let i = 0; i < this.openFn.length; i++) { + if (open.includes(this.openFn[i])) { + speed = open.replace(this.openFn[i], '') + open = this.openFn[i]; + break; + } + } + + this.getElevatorMi(idx, spec, person, stop, open, speed, elevator.item_weight) - } catch (error) { - console.error("Error fetching elevator price:", error); - } - }, - isNotfoundMi: false, - openFn: [ - 'CO', '2S', '2U', '4PCO', '6PCO' - ], - sign1: '', - sign2: '', - sign3: '', - sign4: '', - is_renovate: false, - elevators_total_price: 0, - contractno: contractno, - person_name: person_name, - company: company, - case_name: case_name, - address: address, - price_lowest: price_lowest, - price_total: price_total, - special_fee: special_fee, - predeal_date: predeal_date, - facilitok_date: facilitok_date, - penalty: penalty, - deposit_rate: deposit_rate, - keep_rate: keep_rate, - warranty_rate: warranty_rate, - memo: memo, - qty: 0, - pays: pays, - elevators: [], - options: [], - otherOptions: [], - maintainOptions: [], - mid: mid, - user_id: user_id, - optionsTotalPrice() { - return this.options.reduce((total, option) => { - return total + (option.item_qty * option.item_unit_price); - }, 0); - }, - otherOptionsTotalPrice() { - return this.otherOptions.reduce((total, option) => { - return total + (option.item_qty * option.item_unit_price); - }, 0); - }, - maintainOptionsTotalPrice() { - return this.maintainOptions.reduce((total, option) => { - return total + (option.item_qty * option.item_unit_price); - }, 0); - }, - totalScale() { - return this.pays.reduce((total, option) => { - return total + Number(option.pay_scale); - }, 0); - }, + }) - check(sign, status) { - console.log(sign); - const form = new FormData(); - form.append('sign', sign); - form.append('mid', this.mid); - form.append('result', status); - form.append('user_id', this.user_id); - axios.post('./api/postPricereviewSign.php', form).then(res => { - console.log(res.data); - if (res.data == 1) { - alert("簽核成功!"); - window.location.reload() + }, + async getElevatorMi(idx, spec, person, stop, open, speed, item_weight) { + try { + const res = await axios.get('./api/getElevatorMi.php', { + params: { + spec: spec, + person: person, + stop: stop, + open: open, + speed: speed, + weight: item_weight + } + }) + console.log('---->', res.data); + if (res.data) { + this.elevators[idx].mi = res.data + this.elevators[idx].totalMi = res.data['equipment_fee'] + res.data['customs_shipping_fee'] + res.data['free1y_fee'] + res.data['install_fee'] + res.data['other_fee'] + res.data['transport_site_fee'] + res.data['unloading_fee']; + } else { + this.isNotfoundMi = true; + this.elevators[idx].mi = { + 'equipment_fee': 0, + 'customs_shipping_fee': 0, + 'free1y_fee': 0, + 'install_fee': 0, + 'other_fee': 0, + 'transport_site_fee': 0, + 'unloading_fee': 0 + } + } + + + console.log(this.elevators[idx]); + + } catch (error) { + console.error("Error fetching elevator price:", error); + } + }, + isNotfoundMi: false, + openFn: [ + 'CO', '2S', '2U', '4PCO', '6PCO' + ], + sign1: '', + sign2: '', + sign3: '', + sign4: '', + is_renovate: false, + elevators_total_price: 0, + contractno: contractno, + person_name: person_name, + company: company, + case_name: case_name, + address: address, + price_lowest: price_lowest, + price_total: price_total, + special_fee: special_fee, + predeal_date: predeal_date, + facilitok_date: facilitok_date, + penalty: penalty, + deposit_rate: deposit_rate, + keep_rate: keep_rate, + warranty_rate: warranty_rate, + memo: memo, + qty: 0, + pays: pays, + elevators: [], + options: [], + otherOptions: [], + maintainOptions: [], + mid: mid, + user_id: user_id, + optionsTotalPrice() { + return this.options.reduce((total, option) => { + return total + (option.item_qty * option.item_unit_price); + }, 0); + }, + otherOptionsTotalPrice() { + return this.otherOptions.reduce((total, option) => { + return total + (option.item_qty * option.item_unit_price); + }, 0); + }, + maintainOptionsTotalPrice() { + return this.maintainOptions.reduce((total, option) => { + return total + (option.item_qty * option.item_unit_price); + }, 0); + }, + totalScale() { + return this.pays.reduce((total, option) => { + return total + Number(option.pay_scale); + }, 0); + }, + + check(sign, status) { + console.log(sign); + const form = new FormData(); + form.append('sign', sign); + form.append('mid', this.mid); + form.append('result', status); + form.append('user_id', this.user_id); + axios.post('./api/postPricereviewSign.php', form).then(res => { + console.log(res.data); + if (res.data == 1) { + alert("簽核成功!"); + window.location.reload() + } + }) + }, + agree(sign) { + console.log(sign); + }, + closeCase(sign) { + console.log(sign); + }, } - }) - }, - agree(sign) { - console.log(sign); - }, - closeCase(sign) { - console.log(sign); - }, - } -} + } const pricereviewMaintainCreate = () => { - return { - init() { - // this.elevators = elevator; - }, - elevator: [], - async getElevatorPrice(idx) { - const spec = this.elevator[idx].specifications; - const person = this.elevators[idx].person; - }, + return { + init() { + // this.elevators = elevator; + }, + elevator: [], + async getElevatorPrice(idx) { + const spec = this.elevator[idx].specifications; + const person = this.elevators[idx].person; + }, - } -} \ No newline at end of file + } + } \ No newline at end of file diff --git a/wms/mkt/css/pricereview.css b/wms/mkt/css/pricereview.css index 912bc7f5..f5953715 100644 --- a/wms/mkt/css/pricereview.css +++ b/wms/mkt/css/pricereview.css @@ -14,29 +14,21 @@ #pricereviewCreate>.modal table, #pricereviewCreate>.modal th, -#pricereviewCreate>.modal td, -#pricereviewMaintainCreate>.modal table, -#pricereviewMaintainCreate>.modal th, -#pricereviewMaintainCreate>.modal td { +#pricereviewCreate>.modal td { border: 1px #ccc solid; } -#pricereviewCreate>.modal table>thead tr th, -#pricereviewMaintainCreate>.modal table>thead tr th { +#pricereviewCreate>.modal table>thead tr th { color: #A52A2A; } -#pricereviewCreate>.modal table>tbody .selected, -#pricereviewMaintainCreate>.modal table>tbody .selected { +#pricereviewCreate>.modal table>tbody .selected { background-color: #E7FEFB; } #pricereviewCreate .container table, #pricereviewCreate .container th, -#pricereviewCreate .container td, -#pricereviewMaintainCreate .container table, -#pricereviewMaintainCreate .container th, -#pricereviewMaintainCreate .container td { +#pricereviewCreate .container td { border: 1px #ccc solid; padding: 15px; } @@ -49,31 +41,19 @@ #pricereviewCreate .container th .noborder td, #pricereviewCreate .container td.noborder, #pricereviewCreate .container td .noborder th, -#pricereviewCreate .container td .noborder td, -#pricereviewMaintainCreate .container table.noborder, -#pricereviewMaintainCreate .container table .noborder th, -#pricereviewMaintainCreate .container table .noborder td, -#pricereviewMaintainCreate .container th.noborder, -#pricereviewMaintainCreate .container th .noborder th, -#pricereviewMaintainCreate .container th .noborder td, -#pricereviewMaintainCreate .container td.noborder, -#pricereviewMaintainCreate .container td .noborder th, -#pricereviewMaintainCreate .container td .noborder td { +#pricereviewCreate .container td .noborder td { border: none; } -#pricereviewCreate .container table thead th, -#pricereviewMaintainCreate .container table thead th { +#pricereviewCreate .container table thead th { background-color: #6D9EEB; } -#pricereviewCreate .container table tbody td input, -#pricereviewMaintainCreate .container table tbody td input { +#pricereviewCreate .container table tbody td input { font-size: 14px; } -#pricereviewCreate .container table tbody th, -#pricereviewMaintainCreate .container table tbody th { +#pricereviewCreate .container table tbody th { background-color: #CCE4F8; font-size: 14px; padding: 15px 2px; @@ -81,21 +61,18 @@ text-align: center; } -#pricereviewCreate .container table input, -#pricereviewMaintainCreate .container table input { +#pricereviewCreate .container table input { font-size: 13px; } -#pricereviewCreate .container .pricreviewmain, -#pricereviewMaintainCreate .container .pricreviewmain { +#pricereviewCreate .container .pricreviewmain { background-color: #F2F2F2; padding: 20px; border-radius: 6px; margin: 30px 0; } -#pricereviewCreate .container .pricreviewmain button, -#pricereviewMaintainCreate .container .pricreviewmain button { +#pricereviewCreate .container .pricreviewmain button { color: #fff; width: 55px; height: 30px; @@ -104,35 +81,30 @@ font-size: 13px; } -#pricereviewCreate .container .pricreviewmain button.addbtn, -#pricereviewMaintainCreate .container .pricreviewmain button.addbtn { +#pricereviewCreate .container .pricreviewmain button.addbtn { background-color: #337AB7; width: 30px; } -#pricereviewCreate .container .pricreviewmain button.deleteBtn, -#pricereviewMaintainCreate .container .pricreviewmain button.deleteBtn { +#pricereviewCreate .container .pricreviewmain button.deleteBtn { background-color: #D9534F; color: #fff; font-size: 12px; width: 30px; } -#pricereviewCreate .container .pricreviewmain button.selectElevator, -#pricereviewMaintainCreate .container .pricreviewmain button.selectElevator { +#pricereviewCreate .container .pricreviewmain button.selectElevator { background-color: #D9534F; color: #fff; } -#pricereviewCreate .container .pricreviewmain>.divitem, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem { +#pricereviewCreate .container .pricreviewmain>.divitem { border: 1px #ccc solid; padding: 10px; border-radius: 4px; } -#pricereviewCreate .container .pricreviewmain>.divitem .title, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem .title { +#pricereviewCreate .container .pricreviewmain>.divitem .title { display: flex; align-items: center; border-bottom: 1px #ccc solid; @@ -140,17 +112,13 @@ margin-bottom: 10px; } -#pricereviewCreate .container .pricreviewmain>.divitem .title h6, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem .title h6 { +#pricereviewCreate .container .pricreviewmain>.divitem .title h6 { font-weight: 600; } #pricereviewCreate .container .pricreviewmain>.divitem table, #pricereviewCreate .container .pricreviewmain>.divitem th, -#pricereviewCreate .container .pricreviewmain>.divitem td, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem th, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem td { +#pricereviewCreate .container .pricreviewmain>.divitem td { font-size: 14px; background-color: transparent; } @@ -163,16 +131,7 @@ #pricereviewCreate .container .pricreviewmain>.divitem th textarea, #pricereviewCreate .container .pricreviewmain>.divitem td input, #pricereviewCreate .container .pricreviewmain>.divitem td select, -#pricereviewCreate .container .pricreviewmain>.divitem td textarea, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table input, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table select, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table textarea, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem th input, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem th select, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem th textarea, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem td input, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem td select, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem td textarea { +#pricereviewCreate .container .pricreviewmain>.divitem td textarea { font-size: 13px; } @@ -181,31 +140,21 @@ #pricereviewCreate .container .pricreviewmain>.divitem th input[type=number]::-webkit-outer-spin-button, #pricereviewCreate .container .pricreviewmain>.divitem th input[type=number]::-webkit-inner-spin-button, #pricereviewCreate .container .pricreviewmain>.divitem td input[type=number]::-webkit-outer-spin-button, -#pricereviewCreate .container .pricreviewmain>.divitem td input[type=number]::-webkit-inner-spin-button, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table input[type=number]::-webkit-outer-spin-button, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table input[type=number]::-webkit-inner-spin-button, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem th input[type=number]::-webkit-outer-spin-button, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem th input[type=number]::-webkit-inner-spin-button, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem td input[type=number]::-webkit-outer-spin-button, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem td input[type=number]::-webkit-inner-spin-button { +#pricereviewCreate .container .pricreviewmain>.divitem td input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } #pricereviewCreate .container .pricreviewmain>.divitem table tr:hover .deleteBtn, -#pricereviewCreate .container .pricreviewmain>.divitem table tr:hover .copyBtn, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table tr:hover .deleteBtn, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table tr:hover .copyBtn { +#pricereviewCreate .container .pricreviewmain>.divitem table tr:hover .copyBtn { opacity: 1; } -#pricereviewCreate .container .pricreviewmain>.divitem table .saletd, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table .saletd { +#pricereviewCreate .container .pricreviewmain>.divitem table .saletd { position: relative; } -#pricereviewCreate .container .pricreviewmain>.divitem table .saletd>.deleteBtn, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table .saletd>.deleteBtn { +#pricereviewCreate .container .pricreviewmain>.divitem table .saletd>.deleteBtn { position: absolute; top: 50%; transform: translateY(-50%); @@ -214,8 +163,7 @@ transition: 0.3s; } -#pricereviewCreate .container .pricreviewmain>.divitem table .saletd>.copyBtn, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table .saletd>.copyBtn { +#pricereviewCreate .container .pricreviewmain>.divitem table .saletd>.copyBtn { position: absolute; top: 50%; transform: translateY(-50%); @@ -226,40 +174,34 @@ height: 30px; } -#pricereviewCreate .container .pricreviewmain>.divitem table textarea, -#pricereviewMaintainCreate .container .pricreviewmain>.divitem table textarea { +#pricereviewCreate .container .pricreviewmain>.divitem table textarea { height: auto; min-height: 50px; } -#pricereviewCreate .container .pricreviewmain>.filediv, -#pricereviewMaintainCreate .container .pricreviewmain>.filediv { +#pricereviewCreate .container .pricreviewmain>.filediv { display: flex; flex-direction: column; margin-top: 20px; } -#pricereviewCreate .container .pricreviewmain>.filediv label, -#pricereviewMaintainCreate .container .pricreviewmain>.filediv label { +#pricereviewCreate .container .pricreviewmain>.filediv label { display: flex; align-items: center; margin: 10px 0; } -#pricereviewCreate .container .pricreviewmain>.filediv label p, -#pricereviewMaintainCreate .container .pricreviewmain>.filediv label p { +#pricereviewCreate .container .pricreviewmain>.filediv label p { width: 100px; font-size: 15px; font-weight: 600; } -#pricereviewCreate .container .pricreviewmain>.filediv label input[type=file], -#pricereviewMaintainCreate .container .pricreviewmain>.filediv label input[type=file] { +#pricereviewCreate .container .pricreviewmain>.filediv label input[type=file] { width: 400px; } -#pricereviewCreate .container .pricreviewmain>.filediv label button, -#pricereviewMaintainCreate .container .pricreviewmain>.filediv label button { +#pricereviewCreate .container .pricreviewmain>.filediv label button { width: 90px; height: 35px; margin: 0;