Files
AutonetSellCar/backend/searchCarNum_function.js
AutonetSellCar Deploy 1f0dcb1ddb Initial commit: AutonetSellCar platform with deployment system
- Frontend: Next.js 14 with TypeScript
- Backend: FastAPI with SQLAlchemy
- Agent: Carmodoo sync agent
- Deployment: Docker Compose based staging/production setup
- Scripts: Automated deployment with rollback support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 13:24:39 +09:00

70 lines
2.3 KiB
JavaScript

function searchCarNum(flag) {
if(searchDupFlag) {
alert("검색중입니다.");
return false;
}
var carNum = "";
var inputObj = null;
if (flag == 'main') {
inputObj = $("#mainCarNum");
} else {
inputObj = $("#headerCarNum");
}
carNum = trim(inputObj.val());
if (carNum == "") return false;
if (carNum == "") {
alert("차량번호를 입력하세요.");
inputObj.focus();
return false;
}
var rightNum = carNum.substr(carNum.length - 4);
if (!checkDigitOnly(rightNum)) {
alert("차량정보를 찾을 수 없습니다.\n정확한 차량번호를 확인하신 후 다시 시도해 주시기 바랍니다.");
inputObj.focus();
return false;
}
if (carNum.length < 7 || carNum.length > 9) {
alert("차량 번호를 정확하게 입력해주세요.");
inputObj.focus();
return false;
}
inputObj.blur();
// 로딩 스타트
searchDupFlag = true;
var otp = $("#otp").val();
var nextOtp = $("#nextOtp").val();
// 데이터를 가져옴...
$.ajax({
type: "POST",
url: "/ext/gg1_ab.php",
data: { "mode" : "search", "carNum": carNum, "otp" : otp, "nextOtp" : nextOtp },
dataType: "json",
success: function (json) {
searchDupFlag = false;
if(json && json.rst_code == 1) { // 성공
var sdKey = json.sdKey;
var sdType = json.sdType;
if(sdType == 2) {
searchIFrame.document.location.href = "/cp/search_yet.html?otp=" + otp + "&nextOtp=" + nextOtp + "&S_SDDATA=" + sdKey;
}
if(sdType == 3) {
searchIFrame.document.location.href = "/cp/search.html?otp=" + otp + "&nextOtp=" + nextOtp + "&S_SDDATA=" + sdKey;
}
//getSearchDataResult(sdKey);
} else if(json && json.rst_code != 1) { // 실패
if(json.rst_msg != "") alert(json.rst_msg);
else alert("오류가 발생했습니다. 다시 실행해주세요.");
} else {
alert("차량정보를 찾을 수 없습니다.\n정확한 차량번호를 확인하신 후 \n다시 시도해 주시기 바랍니다.");
}
},
failure: function (errMsg) {
alert(errMsg);
}
});
}