260922_01_ENH: 컨택 연동 매핑 테이블을 통해 자동으로 연동되게 수정
This commit is contained in:
@@ -20,6 +20,7 @@ kon.survey = (function () {
|
||||
}, success: function (nextpage) {
|
||||
|
||||
var stringifydata = "";
|
||||
var surveyType = form.find("input[name=SURVEYTYPE]").val();
|
||||
var nextinput = form.find("input[name=NEXTPAGE]"); /* 다음페이지 찾기 */
|
||||
var pagename = form.find("input[name=PAGENAME]").val();
|
||||
var useprev = form.find("input[name=USEPREV]").val()?form.find("input[name=USEPREV]").val():pagename;
|
||||
@@ -116,6 +117,32 @@ kon.survey = (function () {
|
||||
});
|
||||
}
|
||||
|
||||
if(surveyType != "TEST"){
|
||||
var contactMappingList = ajax_returnData("/include/ajax_contact.asp", {
|
||||
"CRUD": "SELECT",
|
||||
"COMMAND": "CONTACT_SURVEY",
|
||||
"PKEY": kon.survey.PKEY
|
||||
});
|
||||
|
||||
if(contactMappingList.length > 0){
|
||||
if(pagename == "INDEX"){
|
||||
callContactStatusApi(contactMappingList, kon.survey.IDKEY, "start")
|
||||
}
|
||||
|
||||
if(["PREV","END", "SCREEN", "QUOTA"].includes(nextinput.val())){
|
||||
var status = "complete"
|
||||
|
||||
if(nextinput.val() == "SCREEN"){
|
||||
status = "screen"
|
||||
}
|
||||
else if(nextinput.val() == "QUOTA"){
|
||||
status = "quota"
|
||||
}
|
||||
|
||||
callContactStatusApi(contactMappingList, kon.survey.IDKEY, status)
|
||||
}
|
||||
}
|
||||
}
|
||||
form.attr("onsubmit", "");
|
||||
form.submit();
|
||||
}, error: function (x, h, r) {
|
||||
@@ -127,6 +154,27 @@ kon.survey = (function () {
|
||||
})
|
||||
}
|
||||
|
||||
function callContactStatusApi(contactMappingList, idkey, status){
|
||||
var contactBaseUrl = "https://contact.kric.com/api/external/";
|
||||
//contactBaseUrl = "http://localhost:4000/api/external/";
|
||||
contactMappingList.forEach(function (mapping) {
|
||||
$.ajax({
|
||||
url: contactBaseUrl + status
|
||||
+ "?psidx=" + encodeURIComponent(mapping.PSIDX)
|
||||
+ "&sid=" + encodeURIComponent(idkey),
|
||||
type: "POST",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
cache: false,
|
||||
async: true,
|
||||
error: function (x, h, r) {
|
||||
console.log(x);
|
||||
console.log(h);
|
||||
console.log(r);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function serializeform(form,arr) { /* 폼 데이터 정렬 */
|
||||
var data = {}
|
||||
var inputdata = {}
|
||||
|
||||
Reference in New Issue
Block a user