|
@@ -4,7 +4,6 @@
|
|
<div class="content">
|
|
<div class="content">
|
|
<div class="row">
|
|
<div class="row">
|
|
<div class="col-xl-12">
|
|
<div class="col-xl-12">
|
|
- <h2>{{ $formA['General']['Title'] }}</h2>
|
|
|
|
<div class="card" id="monthly-settle-form">
|
|
<div class="card" id="monthly-settle-form">
|
|
<div class="card-body mt-2" id="frm">
|
|
<div class="card-body mt-2" id="frm">
|
|
<input type="hidden" id="Id" name="Id" value="0">
|
|
<input type="hidden" id="Id" name="Id" value="0">
|
|
@@ -31,13 +30,13 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group mb-3" {{ $formA['FormVars']['Hidden']['YyyyMm'] }}>
|
|
<div class="form-group mb-3" {{ $formA['FormVars']['Hidden']['YyyyMm'] }}>
|
|
- <label>{{ $formA['FormVars']['Title']['YyyyMm'] }}</label>
|
|
|
|
|
|
+ <label class="m-0">{{ $formA['FormVars']['Title']['YyyyMm'] }}</label>
|
|
<br>
|
|
<br>
|
|
- <input type="text" id="yyyy-txt" data-copy="true"
|
|
|
|
|
|
+ <input type="text" class="rounded w-sm-auto" id="yyyy-txt" data-copy="true"
|
|
maxlength="{{ $formA['FormVars']['MaxLength']['YyyyMm'] }}"
|
|
maxlength="{{ $formA['FormVars']['MaxLength']['YyyyMm'] }}"
|
|
- {{ $formA['FormVars']['Required']['YyyyMm'] }}>
|
|
|
|
|
|
+ {{ $formA['FormVars']['Required']['YyyyMm'] }}> 년
|
|
@php $todayMonth = date('n');@endphp
|
|
@php $todayMonth = date('n');@endphp
|
|
- <select id = "mm-select">
|
|
|
|
|
|
+ <select id = "mm-select" class="rounded">
|
|
@foreach($monthArr as $index => $month)
|
|
@foreach($monthArr as $index => $month)
|
|
<option value="{{ $index + 1 }}" @if($todayMonth == $index + 1) selected @endif>
|
|
<option value="{{ $index + 1 }}" @if($todayMonth == $index + 1) selected @endif>
|
|
{{ $month }}
|
|
{{ $month }}
|
|
@@ -90,7 +89,7 @@
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
- console.log('parameters : ', parameters);
|
|
|
|
|
|
+ // console.log(parameters);
|
|
return parameters;
|
|
return parameters;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -118,6 +117,28 @@
|
|
$('#modal-setting_monthly_settle').modal('hide');
|
|
$('#modal-setting_monthly_settle').modal('hide');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ MonthlySettleForm.change_tbl_name = async function (tbl_name) {
|
|
|
|
+ let check_name;
|
|
|
|
+ switch(tbl_name){
|
|
|
|
+ case "bal_buyer":
|
|
|
|
+ check_name = "{{ $formA['FormVars']['Title']['IsBalBuyer'] }}"
|
|
|
|
+ break;
|
|
|
|
+ case "bal_supplier":
|
|
|
|
+ check_name = "{{ $formA['FormVars']['Title']['IsBalSupplier'] }}"
|
|
|
|
+ break;
|
|
|
|
+ case "bal_item":
|
|
|
|
+ check_name = "{{ $formA['FormVars']['Title']['IsBalItem'] }}"
|
|
|
|
+ break;
|
|
|
|
+ case "bal_reward":
|
|
|
|
+ check_name = "{{ $formA['FormVars']['Title']['IsBalReward'] }}"
|
|
|
|
+ break;
|
|
|
|
+ case "bal_credit":
|
|
|
|
+ check_name = "{{ $formA['FormVars']['Title']['IsBalCredit'] }}"
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ return check_name;
|
|
|
|
+ }
|
|
|
|
+
|
|
MonthlySettleForm.check_input = async function (parameters) {
|
|
MonthlySettleForm.check_input = async function (parameters) {
|
|
if ($('#yyyy-txt').val() == '') {
|
|
if ($('#yyyy-txt').val() == '') {
|
|
return iziToast.error({ title: 'Error', message: '정산년도를 입력해주세요. ex)2024' });
|
|
return iziToast.error({ title: 'Error', message: '정산년도를 입력해주세요. ex)2024' });
|
|
@@ -125,7 +146,6 @@
|
|
if(parameters.length == 0){
|
|
if(parameters.length == 0){
|
|
return iziToast.error({ title: 'Error', message: '체크박스를 1개이상 체크해주세요.' });
|
|
return iziToast.error({ title: 'Error', message: '체크박스를 1개이상 체크해주세요.' });
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
MonthlySettleForm.btn_re_cal = async function () {
|
|
MonthlySettleForm.btn_re_cal = async function () {
|
|
@@ -134,13 +154,17 @@
|
|
|
|
|
|
for (const parameter of parameters) {
|
|
for (const parameter of parameters) {
|
|
const response = await get_api_data('monthly-settle', parameter);
|
|
const response = await get_api_data('monthly-settle', parameter);
|
|
-
|
|
|
|
|
|
+ // const table_name = parameter['TableName'];
|
|
|
|
+ const table_name = await MonthlySettleForm.change_tbl_name(parameter['TableName']);
|
|
|
|
+ console.log('table_name : ', table_name);
|
|
if (response && response.data.apiStatus) {
|
|
if (response && response.data.apiStatus) {
|
|
|
|
+ const status = response.data.apiStatus;
|
|
|
|
+ const message = response.data.body;
|
|
console.log(response);
|
|
console.log(response);
|
|
- return iziToast.error({ title: 'Error', message: 'API Error' });
|
|
|
|
|
|
+ return iziToast.error({ title: 'Error', message: `${table_name} : ${status}, ${message}` });
|
|
}
|
|
}
|
|
|
|
|
|
- iziToast.success({ title: 'Success', message: '재정산 완료' });
|
|
|
|
|
|
+ iziToast.success({ title: 'Success', message: `${table_name} 완료` });
|
|
// console.log(response);
|
|
// console.log(response);
|
|
}
|
|
}
|
|
};
|
|
};
|