|
@@ -35,6 +35,7 @@
|
|
|
Btype.get_slip_form_init = async function (query_name = undefined) {
|
|
|
if (isEmpty(query_name)) {
|
|
|
query_name = formB['QueryVars']['QueryName']
|
|
|
+ // console.log('query_name : ', query_name);
|
|
|
}
|
|
|
const response = await get_api_data('slip-form-init', {
|
|
|
QueryVars: {
|
|
@@ -44,7 +45,7 @@
|
|
|
|
|
|
return response.data;
|
|
|
};
|
|
|
-
|
|
|
+ // 배열의 각 요소들을 순환하면서 option태그를 생성해줌
|
|
|
Btype.create_deal_type_select_box_options = async function (page, dom_val = '#deal-type-select') {
|
|
|
// let page = await get_select_box_options_data('deal-type-page', 'deal_category="purch"')
|
|
|
let html = page.reduce(function (accumulator, item) {
|
|
@@ -128,6 +129,7 @@
|
|
|
|
|
|
Btype.call_act_api = function (data, callback, act_api = undefined, argObj = '#frm', namespace = 'window') {
|
|
|
let url = eval(namespace).formB.General.ActApi;
|
|
|
+
|
|
|
if (! isEmpty(act_api)) { url = act_api; }
|
|
|
|
|
|
$('.save-button').prop('disabled', true);
|
|
@@ -158,19 +160,26 @@
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ // input 요소를 통해 상위 요소 제어
|
|
|
Btype.bd_cursor_click = function ($this) {
|
|
|
let table = $($this).closest('table');
|
|
|
let th = $(table).find('thead th');
|
|
|
let tr = $($this).closest('tr');
|
|
|
|
|
|
+ // th 순회하며 #이 붙지 않은 요소들 활성/비활성화
|
|
|
$(th).each(function (index) {
|
|
|
if (! trim($(this).text()).includes('#')) {
|
|
|
Btype.able_or_disable_txt_box($(tr).children(`td:eq(${index})`).find('input'));
|
|
|
Btype.able_or_disable_txt_box($(tr).children(`td:eq(${index})`).find('select'));
|
|
|
}
|
|
|
})
|
|
|
+ // 현재 선택된 input요소의 tr에서 첫번째 td의 input 요소의 name
|
|
|
+ // let cursor = $(tr).find('td:eq(0) input').attr('name')
|
|
|
+ let cursor = $(tr).find('td:eq(0) input');
|
|
|
+ if(cursor.is(':hidden')){
|
|
|
+ cursor = $(tr).find('td:eq(1) input').attr('name')
|
|
|
+ }
|
|
|
|
|
|
- let cursor = $(tr).find('td:eq(0) input').attr('name')
|
|
|
$(table).find(`input[name='${cursor}']`).each(function (i) {
|
|
|
if (! $(this).is(':checked')) {
|
|
|
let tr = $(this).closest('tr');
|
|
@@ -184,7 +193,10 @@
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- $($($this).closest('tr')).children(`td:eq(${Btype.get_first_required_th_index(table)})`).find('input').focus();
|
|
|
+ let currentInput = $this;
|
|
|
+ currentInput.focus();
|
|
|
+ currentInput.select();
|
|
|
+ // $($($this).closest('tr')).children(`td:eq(${Btype.get_first_required_th_index(table)})`).find('input').focus();
|
|
|
};
|
|
|
|
|
|
Btype.table_td_focus = function ($this) {
|
|
@@ -250,6 +262,7 @@
|
|
|
{Id: item_id }
|
|
|
]
|
|
|
})
|
|
|
+
|
|
|
let item = response.data.Page[0];
|
|
|
let next_input = eval(namespace).set_item_data_to_textbox(item)
|
|
|
|
|
@@ -257,6 +270,7 @@
|
|
|
next_input.focus();
|
|
|
};
|
|
|
|
|
|
+ // 첫번째 필수항목(th) 찾기
|
|
|
Btype.get_first_required_th_index = function (table, start_index) {
|
|
|
let th = $(table).find('thead th')
|
|
|
let first_index = start_index
|
|
@@ -611,7 +625,6 @@
|
|
|
|
|
|
Btype.get_name_pick_api = async function (url, id) {
|
|
|
const response = await get_api_data(url, { Page: [ { Id: parseInt(id) } ] })
|
|
|
-
|
|
|
return response.data.Page[0]
|
|
|
};
|
|
|
|
|
@@ -669,6 +682,7 @@
|
|
|
};
|
|
|
|
|
|
Btype.btn_act_save = function (argObj = '#frm', callback = undefined, namespace = 'window') {
|
|
|
+ // argObj 입력창 필수요소 체크
|
|
|
if (dom_required_check(`${argObj} input`) || dom_required_check(`${argObj} select`)) {
|
|
|
iziToast.warning({
|
|
|
title: 'Warning',
|
|
@@ -677,9 +691,10 @@
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- Btype.call_act_api(eval(namespace).get_parameter(), function() {
|
|
|
+ test = Btype.call_act_api(eval(namespace).get_parameter(), function() {
|
|
|
if (! isEmpty(callback)) { callback(); }
|
|
|
}, undefined, argObj, namespace);
|
|
|
+
|
|
|
return true;
|
|
|
};
|
|
|
// end head act btn
|
|
@@ -697,10 +712,6 @@
|
|
|
Page: [ eval(namespace).get_parameter() ]
|
|
|
});
|
|
|
const page = response.data.Page
|
|
|
-
|
|
|
- // console.log(eval(namespace).get_parameter())
|
|
|
- // console.log(response)
|
|
|
- // console.log(page)
|
|
|
if (page) {
|
|
|
set_as_response_id(page[0].Id, argObj)
|
|
|
return true
|
|
@@ -737,7 +748,9 @@
|
|
|
// $(argObj).find('.end-date').val(end_date)
|
|
|
|
|
|
// $(`input:radio[name='query-speed']:radio[value='${query['SlipSearchVars']['QuerySpeed']}']`).prop('checked', true);
|
|
|
+ // 캐시데이터가 있으면 캐시데이터에 저장된 값을 가져온다
|
|
|
$(argObj).find('.slip-no').val(query['SlipSearchVars']['SlipNo'])
|
|
|
+ // console.log('SlipNo : ', query['SlipSearchVars']['SlipNo'])
|
|
|
$(argObj).find('.company-name').val(query['SlipSearchVars']['CompanyName'])
|
|
|
$(argObj).find('.item-code').val(query['SlipSearchVars']['ItemCode'])
|
|
|
$(argObj).find(`.modal-line-select`).val(query['PageVars']['Limit'])
|