add modules folder based on s_menu
This commit is contained in:
282
test/vuex/acc-one-jurnal-item-usage/api/journal.js
Normal file
282
test/vuex/acc-one-jurnal-item-usage/api/journal.js
Normal file
@@ -0,0 +1,282 @@
|
||||
const URL = "/one-api/mockup/masterdata/accounting/";
|
||||
|
||||
export async function getPeriode(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "JournalItemUsage/getPeriode", prm);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function search(
|
||||
token,
|
||||
xdate,
|
||||
periodeid,
|
||||
current_page,
|
||||
search,
|
||||
branchCode,
|
||||
regionalId
|
||||
) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "JournalItemUsage/search", {
|
||||
token: token,
|
||||
xdate: xdate,
|
||||
periodeid: periodeid,
|
||||
current_page: current_page,
|
||||
search: search,
|
||||
branchCode: branchCode,
|
||||
regionalId: regionalId
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function insertSales(branchCode, date, jurnalno) {
|
||||
try {
|
||||
var resp = await axios.get(
|
||||
URL + `mediajurnalauto/insertSales/${branchCode}/${date}?isregen=1&jurnalno=${jurnalno}`
|
||||
);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getRegional(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "JournalItemUsage/getRegional", prm);
|
||||
if (resp.status !== 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getBranch(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "JournalItemUsage/getBranch", prm);
|
||||
if (resp.status !== 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getUserApproveLevel(params) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "JournalItemUsage/getUserApproveLevel", params);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getListingCOA(params) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "JournalItemUsage/getListingCOA", params);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function requestEditJurnal(params) {
|
||||
try {
|
||||
const resp = await axios.post(URL + "JournalVerifEdit/requestEditJurnal", params);
|
||||
if (resp.status !== 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
const data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveEditJurnal(params) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "JournalVerifEdit/saveEditJurnal", params);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function changeJurnalToPosted(params) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "JournalItemUsage/changeJurnalToPosted", params);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getTotalJurnalNotPostedPerPeriod(params) {
|
||||
try {
|
||||
var resp = await axios.post(
|
||||
URL + "JournalItemUsage/getTotalJurnalNotPostedPerPeriod",
|
||||
params
|
||||
);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function closeJurnalPerPeriode(params) {
|
||||
try {
|
||||
var resp = await axios.post(URL + "JournalItemUsage/closeJurnalPerPeriode", params);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getDataJurnalNotClosedPerPeriod(params) {
|
||||
try {
|
||||
var resp = await axios.post(
|
||||
URL + "JournalItemUsage/getDataJurnalNotClosedPerPeriod",
|
||||
params
|
||||
);
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user