2022-04-20 10:04:53 +00:00
|
|
|
$(document).ready(() => {
|
2022-01-19 12:40:40 +00:00
|
|
|
$("#type").on("change", deviceInputs);
|
2022-06-29 11:40:00 +00:00
|
|
|
$("#amount").on("change", amountInputs);
|
2022-01-24 12:48:16 +00:00
|
|
|
deviceInputs();
|
2022-06-29 11:40:00 +00:00
|
|
|
amountInputs();
|
2022-01-19 12:40:40 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
function deviceInputs() {
|
2022-05-16 10:40:14 +00:00
|
|
|
if ($("#type").val() == "ComputerMonitor") {
|
2022-01-19 12:40:40 +00:00
|
|
|
$("#screen").show();
|
|
|
|
$("#resolution").show();
|
|
|
|
$("#imei").hide();
|
|
|
|
$("#meid").hide();
|
2022-04-20 10:04:53 +00:00
|
|
|
} else if (["Smartphone", "Cellphone", "Tablet"].includes($("#type").val())) {
|
2022-01-19 12:40:40 +00:00
|
|
|
$("#screen").hide();
|
|
|
|
$("#resolution").hide();
|
|
|
|
$("#imei").show();
|
|
|
|
$("#meid").show();
|
|
|
|
} else {
|
|
|
|
$("#screen").hide();
|
|
|
|
$("#resolution").hide();
|
|
|
|
$("#imei").hide();
|
|
|
|
$("#meid").hide();
|
2022-06-29 11:40:00 +00:00
|
|
|
};
|
|
|
|
amountInputs();
|
|
|
|
}
|
|
|
|
|
|
|
|
function amountInputs() {
|
|
|
|
if ($("#amount").val() > 1) {
|
|
|
|
$("#Phid").hide();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Id_device_supplier").hide();
|
2022-10-05 07:18:42 +00:00
|
|
|
$("#Id_device_internal").hide();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Serial_number").hide();
|
2022-10-05 07:18:42 +00:00
|
|
|
$("#Part_number").hide();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Sku").hide();
|
|
|
|
$("#imei").hide();
|
|
|
|
$("#meid").hide();
|
2022-06-29 11:40:00 +00:00
|
|
|
} else {
|
|
|
|
$("#Phid").show();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Id_device_supplier").show();
|
2022-10-05 07:18:42 +00:00
|
|
|
$("#Id_device_internal").show();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Serial_number").show();
|
2022-10-05 07:18:42 +00:00
|
|
|
$("#Part_number").show();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Sku").show();
|
2022-07-04 09:26:24 +00:00
|
|
|
deviceInputs();
|
2022-06-29 11:40:00 +00:00
|
|
|
};
|
2022-01-19 12:40:40 +00:00
|
|
|
}
|