| 1234567891011121314151617181920212223242526272829303132 |
- class TestVerifyForm {
- constructor() {
- this.$invoiceAmountField = $("#invoice-amount");
- this.$newTestIsRetestField = $("#new-test-is-retest");
- this.$newTestIsRetestField.on("change", event => this.updateInvoiceAmount());
- this.$newTestProjectField = $("#new-test-project-id");
- this.$newTestProjectField.on("change", event => this.updateInvoiceAmount());
- this.$paymentRequiredField = $("#payment-required");
- this.$paymentRequiredField.on("change", event => {
- $("#invoice-amount").closest(".row").prop("hidden", !event.currentTarget.checked);
- });
- }
- updateInvoiceAmount() {
- const $option = this.$newTestProjectField.find("option:selected");
- let customerFee = $option.attr("data-customer-fee");
- if(this.$newTestIsRetestField.prop("checked")) {
- customerFee = $option.attr("data-retest-fee");
- }
- this.$invoiceAmountField.val(customerFee);
- }
- }
- $(() => new TestVerifyForm());
|