Commit 54585617 authored by Deni Rinaldi's avatar Deni Rinaldi

isu report + consol

parent dd6887b9
...@@ -5,7 +5,7 @@ import 'bootstrap/dist/css/bootstrap.min.css'; ...@@ -5,7 +5,7 @@ import 'bootstrap/dist/css/bootstrap.min.css';
import Constant from './library/Constant'; import Constant from './library/Constant';
if (sessionStorage.getItem('reloaded') != null) { if (sessionStorage.getItem('reloaded') != null) {
console.log('page was reloaded'); // console.log('page was reloaded');
} else { } else {
// localStorage.removeItem(Constant.TOKEN) // localStorage.removeItem(Constant.TOKEN)
window.location.reload(); window.location.reload();
......
...@@ -78,7 +78,7 @@ export default class BudgetTahunan extends Component { ...@@ -78,7 +78,7 @@ export default class BudgetTahunan extends Component {
this.setState({ loading: true }) this.setState({ loading: true })
this.props.selectIndex('Master Budget & CAT') this.props.selectIndex('Master Budget & CAT')
if (this.props.location.state !== undefined) { if (this.props.location.state !== undefined) {
console.log(this.props); // console.log(this.props);
this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => { this.setState({ userType: this.props.location.state.userType, intent: 'Home', lastPeriod: this.props.location.state.rawData.periode, rawData: this.props.location.state.rawData }, () => {
this.checkApprover() this.checkApprover()
}) })
...@@ -89,7 +89,7 @@ export default class BudgetTahunan extends Component { ...@@ -89,7 +89,7 @@ export default class BudgetTahunan extends Component {
checkApprover() { checkApprover() {
api.create().checkApprover().then(response => { api.create().checkApprover().then(response => {
console.log(response); // console.log(response);
if (response.data.data.is_approver === true) { if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true }, () => this.setState({ isApprover: true, checkApprover: true }, () =>
this.getPeriode()) this.getPeriode())
...@@ -105,7 +105,7 @@ export default class BudgetTahunan extends Component { ...@@ -105,7 +105,7 @@ export default class BudgetTahunan extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getCompanySubmitted(body).then(response => { api.create().getCompanySubmitted(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let data = response.data.data let data = response.data.data
...@@ -152,7 +152,7 @@ export default class BudgetTahunan extends Component { ...@@ -152,7 +152,7 @@ export default class BudgetTahunan extends Component {
"revision": this.state.revision.revision, "revision": this.state.revision.revision,
} }
api.create().getMasterBudgetAtt(payload).then(response => { api.create().getMasterBudgetAtt(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ listAttachment: response.data.data }) this.setState({ listAttachment: response.data.data })
...@@ -169,7 +169,7 @@ export default class BudgetTahunan extends Component { ...@@ -169,7 +169,7 @@ export default class BudgetTahunan extends Component {
"report_type": "Master Budget", "report_type": "Master Budget",
} }
api.create().getReportTypeBody(payload).then(response => { api.create().getReportTypeBody(payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let dataTable = response.data.data.map((item, index) => { let dataTable = response.data.data.map((item, index) => {
...@@ -205,7 +205,7 @@ export default class BudgetTahunan extends Component { ...@@ -205,7 +205,7 @@ export default class BudgetTahunan extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getSubmitMasterBudget(body).then(response => { api.create().getSubmitMasterBudget(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ isSubmit: response.data.data.is_can_submit }, () => { this.setState({ isSubmit: response.data.data.is_can_submit }, () => {
...@@ -234,7 +234,7 @@ export default class BudgetTahunan extends Component { ...@@ -234,7 +234,7 @@ export default class BudgetTahunan extends Component {
getCompanyActive() { getCompanyActive() {
api.create().getPerusahaanActive().then((response) => { api.create().getPerusahaanActive().then((response) => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let data = response.data.data let data = response.data.data
...@@ -280,7 +280,7 @@ export default class BudgetTahunan extends Component { ...@@ -280,7 +280,7 @@ export default class BudgetTahunan extends Component {
getLastPeriod() { getLastPeriod() {
api.create().getLastPeriod(this.state.company.company_id).then(response => { api.create().getLastPeriod(this.state.company.company_id).then(response => {
console.log(response); // console.log(response);
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => { this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
this.getPeriode() this.getPeriode()
...@@ -321,7 +321,7 @@ export default class BudgetTahunan extends Component { ...@@ -321,7 +321,7 @@ export default class BudgetTahunan extends Component {
let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod) let periode = (this.state.lastPeriod == "" ? String(Number(currentYear) + 1) : this.state.lastPeriod)
let index = data.sort((a, b) => a - b).findIndex((val) => val === periode) let index = data.sort((a, b) => a - b).findIndex((val) => val === periode)
// console.log(data) // console.log(data)
console.log(this.state.latestPeriode) // console.log(this.state.latestPeriode)
// console.log(periodeData) // console.log(periodeData)
// console.log(index) // console.log(index)
this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => { this.setState({ listPeriode: defaultProps, periode: index === -1 ? periodeData[0] : periodeData[index] }, () => {
...@@ -342,7 +342,7 @@ export default class BudgetTahunan extends Component { ...@@ -342,7 +342,7 @@ export default class BudgetTahunan extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().getRevision(payload).then(response => { api.create().getRevision(payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
let data = response.data.data let data = response.data.data
...@@ -371,7 +371,7 @@ export default class BudgetTahunan extends Component { ...@@ -371,7 +371,7 @@ export default class BudgetTahunan extends Component {
"is_approver": this.state.isApprover "is_approver": this.state.isApprover
} }
api.create().getSubmission(payload).then(response => { api.create().getSubmission(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -383,7 +383,7 @@ export default class BudgetTahunan extends Component { ...@@ -383,7 +383,7 @@ export default class BudgetTahunan extends Component {
lastRevision: response.data.data.last_revision, lastRevision: response.data.data.last_revision,
btnApprove: response.data.data.is_submit btnApprove: response.data.data.is_submit
}, () => { }, () => {
console.log(this.state.lastStatus); // console.log(this.state.lastStatus);
this.historyApproval() this.historyApproval()
this.getLatestPeriodSubmit() this.getLatestPeriodSubmit()
api.create().checkApprover().then(response => { api.create().checkApprover().then(response => {
...@@ -409,7 +409,7 @@ export default class BudgetTahunan extends Component { ...@@ -409,7 +409,7 @@ export default class BudgetTahunan extends Component {
"periode": this.state.periode.periode "periode": this.state.periode.periode
} }
api.create().historyApproval(body).then(response => { api.create().historyApproval(body).then(response => {
console.log(response); // console.log(response);
if (response.data.data.length > 0) { if (response.data.data.length > 0) {
let dataTableHistory = response.data.data.map(item => { let dataTableHistory = response.data.data.map(item => {
return [ return [
...@@ -438,20 +438,20 @@ export default class BudgetTahunan extends Component { ...@@ -438,20 +438,20 @@ export default class BudgetTahunan extends Component {
"min_periode": moment(this.state.minDateRevision).format('YYYY-MM-DD'), "min_periode": moment(this.state.minDateRevision).format('YYYY-MM-DD'),
"max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD') "max_periode": moment(this.state.maxDateRevision).format('YYYY-MM-DD')
} }
console.log(payload) // console.log(payload)
api.create().approvalSubmission(body).then((res) => { api.create().approvalSubmission(body).then((res) => {
console.log(res) // console.log(res)
this.setState({ loading: false }, () => { this.setState({ loading: false }, () => {
this.getSubmission() this.getSubmission()
}) })
if (type == 'revision') { if (type == 'revision') {
api.create().createPeriodeRevision(payload).then((res) => console.log(res)) api.create().createPeriodeRevision(payload).then((res))
} }
}) })
} }
clickDetail(item, id, revision, status) { clickDetail(item, id, revision, status) {
console.log(this.state.dataForRevision); // console.log(this.state.dataForRevision);
this.state.dataForRevision.map(i => { this.state.dataForRevision.map(i => {
if (i.report_name === item) { if (i.report_name === item) {
if (i.revision !== revision) { if (i.revision !== revision) {
...@@ -540,7 +540,7 @@ export default class BudgetTahunan extends Component { ...@@ -540,7 +540,7 @@ export default class BudgetTahunan extends Component {
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) // console.log(resp)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
const formData = new FormData(); const formData = new FormData();
...@@ -567,7 +567,7 @@ export default class BudgetTahunan extends Component { ...@@ -567,7 +567,7 @@ export default class BudgetTahunan extends Component {
deleteAttachment(item) { deleteAttachment(item) {
api.create().deleteAttachment(item.attachment_id).then(response => { api.create().deleteAttachment(item.attachment_id).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.getSubmission() this.getSubmission()
...@@ -584,7 +584,7 @@ export default class BudgetTahunan extends Component { ...@@ -584,7 +584,7 @@ export default class BudgetTahunan extends Component {
this.setState({ loading: true }) this.setState({ loading: true })
// console.log(JSON.stringify(data)); // console.log(JSON.stringify(data));
api.create('UPLOAD').createSubmitReport(data).then(response => { api.create('UPLOAD').createSubmitReport(data).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.getSubmission() this.getSubmission()
...@@ -604,7 +604,7 @@ export default class BudgetTahunan extends Component { ...@@ -604,7 +604,7 @@ export default class BudgetTahunan extends Component {
async downloadAttachment(fileurl, name) { async downloadAttachment(fileurl, name) {
let length = name.split(".").length let length = name.split(".").length
let fileType = name.split(".")[length - 1] let fileType = name.split(".")[length - 1]
console.log(fileType); // console.log(fileType);
let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_attachment?fileName=${fileurl}&&fileType=${fileType}` let url = `https://tia.eksad.com/tia-reporting-dev/public/transaction/master_budget/download_attachment?fileName=${fileurl}&&fileType=${fileType}`
// console.log(url); // console.log(url);
let res = await fetch( let res = await fetch(
...@@ -643,7 +643,7 @@ export default class BudgetTahunan extends Component { ...@@ -643,7 +643,7 @@ export default class BudgetTahunan extends Component {
submission_id: this.state.submissionID submission_id: this.state.submissionID
} }
api.create().submitMasterBudget(body).then(response => { api.create().submitMasterBudget(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.getSubmission() this.getSubmission()
...@@ -866,7 +866,7 @@ export default class BudgetTahunan extends Component { ...@@ -866,7 +866,7 @@ export default class BudgetTahunan extends Component {
detailRevisiCheck.splice(indexId, 1) detailRevisiCheck.splice(indexId, 1)
} }
this.setState({ detailRevisiCheck }) this.setState({ detailRevisiCheck })
console.log(detailRevisiCheck) // console.log(detailRevisiCheck)
} }
const options = { const options = {
......
This diff is collapsed.
...@@ -40,7 +40,7 @@ class HomePage extends Component { ...@@ -40,7 +40,7 @@ class HomePage extends Component {
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ userData: response.data.data }, () => { this.setState({ userData: response.data.data }, () => {
console.log(this.state.userData) // console.log(this.state.userData)
}) })
} }
} }
...@@ -69,7 +69,7 @@ class HomePage extends Component { ...@@ -69,7 +69,7 @@ class HomePage extends Component {
getListUserSubco() { getListUserSubco() {
api.create().getDashboardUser().then(response => { api.create().getDashboardUser().then(response => {
console.log(response); // console.log(response);
let valueSubmit = 0 let valueSubmit = 0
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -91,7 +91,7 @@ class HomePage extends Component { ...@@ -91,7 +91,7 @@ class HomePage extends Component {
getDashboard() { getDashboard() {
let listDashboard = [] let listDashboard = []
api.create().getDashboard().then((response) => { api.create().getDashboard().then((response) => {
console.log(response); // console.log(response);
if (String(response.data.status).toLocaleLowerCase() == 'success') { if (String(response.data.status).toLocaleLowerCase() == 'success') {
let data = response.data.data let data = response.data.data
data.map((item, index) => { data.map((item, index) => {
...@@ -106,7 +106,7 @@ class HomePage extends Component { ...@@ -106,7 +106,7 @@ class HomePage extends Component {
getApprMat() { getApprMat() {
this.setState({loading: true}) this.setState({loading: true})
api.create().getAM().then((response) => { api.create().getAM().then((response) => {
console.log(response); // console.log(response);
let actAM = response.data.data.map((item, index) => { let actAM = response.data.data.map((item, index) => {
if (String(item.status).toLocaleLowerCase() == 'active') { if (String(item.status).toLocaleLowerCase() == 'active') {
return item return item
...@@ -120,14 +120,14 @@ class HomePage extends Component { ...@@ -120,14 +120,14 @@ class HomePage extends Component {
this.getListUserSubco() this.getListUserSubco()
} }
this.getDashboardMB() this.getDashboardMB()
console.log(actAM) // console.log(actAM)
this.setState({loading: false}) this.setState({loading: false})
}) })
} }
getDashboardMB() { getDashboardMB() {
api.create().getDashboardMB().then((response) => { api.create().getDashboardMB().then((response) => {
console.log(response) // console.log(response)
if (String(response.data.status).toLocaleLowerCase() == 'success') { if (String(response.data.status).toLocaleLowerCase() == 'success') {
let data = response.data.data let data = response.data.data
let listdmb = data.sort((a, b) => a.company_id - b.company_id).map((item, index) => { let listdmb = data.sort((a, b) => a.company_id - b.company_id).map((item, index) => {
......
...@@ -21,8 +21,8 @@ export default class SubHolding extends Component { ...@@ -21,8 +21,8 @@ export default class SubHolding extends Component {
periode: null, periode: null,
reportType: [ reportType: [
{ value: 1, label: 'DB Balance Sheet' }, { value: 1, label: 'DB Balance Sheet' },
{ value: 2, label: 'DB Profit & Loss' }, { value: 3, label: 'DB Profit & Loss' },
{ value: 3, label: 'DB Profit & Loss Detail' }, { value: 2, label: 'DB Profit & Loss Detail' },
{ value: 4, label: 'DB Ratio' }, { value: 4, label: 'DB Ratio' },
], ],
report: null, report: null,
...@@ -57,7 +57,7 @@ export default class SubHolding extends Component { ...@@ -57,7 +57,7 @@ export default class SubHolding extends Component {
getCompanyActive() { getCompanyActive() {
api.create().getPerusahaanActive().then((response) => { api.create().getPerusahaanActive().then((response) => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
let data = response.data.data let data = response.data.data
...@@ -103,7 +103,7 @@ export default class SubHolding extends Component { ...@@ -103,7 +103,7 @@ export default class SubHolding extends Component {
getLastPeriod() { getLastPeriod() {
api.create().getLastPeriod(this.state.company.company_id).then(response => { api.create().getLastPeriod(this.state.company.company_id).then(response => {
console.log(response); // console.log(response);
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => { this.setState({ lastPeriod: response.data.data.last_periode, latestPeriode: response.data.data.latest_periode }, () => {
this.getPeriode() this.getPeriode()
...@@ -167,7 +167,7 @@ export default class SubHolding extends Component { ...@@ -167,7 +167,7 @@ export default class SubHolding extends Component {
"is_approver": true "is_approver": true
} }
api.create().getSubmission(payload).then(response => { api.create().getSubmission(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -192,7 +192,7 @@ export default class SubHolding extends Component { ...@@ -192,7 +192,7 @@ export default class SubHolding extends Component {
"submission_id": this.state.submissionID "submission_id": this.state.submissionID
} }
api.create().getDetailReportMB(payload).then(response => { api.create().getDetailReportMB(payload).then(response => {
console.log(response); // console.log(response);
let dataTable = [] let dataTable = []
if (this.state.report.value === 1) { if (this.state.report.value === 1) {
if (response.data) { if (response.data) {
......
...@@ -72,7 +72,7 @@ export default class CreateParameter extends Component { ...@@ -72,7 +72,7 @@ export default class CreateParameter extends Component {
getDetailParameter() { getDetailParameter() {
api.create().getDetailParameter(this.props.data[0]).then((response) => { api.create().getDetailParameter(this.props.data[0]).then((response) => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
...@@ -86,7 +86,7 @@ export default class CreateParameter extends Component { ...@@ -86,7 +86,7 @@ export default class CreateParameter extends Component {
}, () => { }, () => {
this.getAllGroup() this.getAllGroup()
this.getPerusahaan() this.getPerusahaan()
console.log(this.state.tempData) // console.log(this.state.tempData)
}) })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
...@@ -109,7 +109,7 @@ export default class CreateParameter extends Component { ...@@ -109,7 +109,7 @@ export default class CreateParameter extends Component {
getAllGroup() { getAllGroup() {
api.create().getAllGroup().then(response => { api.create().getAllGroup().then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -266,7 +266,7 @@ export default class CreateParameter extends Component { ...@@ -266,7 +266,7 @@ export default class CreateParameter extends Component {
getParameterByGroup(id) { getParameterByGroup(id) {
api.create().getParameterByGroup(id).then(response => { api.create().getParameterByGroup(id).then(response => {
console.log(id, response); // console.log(id, response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -411,11 +411,11 @@ export default class CreateParameter extends Component { ...@@ -411,11 +411,11 @@ export default class CreateParameter extends Component {
let isDate = type !== '' ? true : false let isDate = type !== '' ? true : false
if (isDate && type == 'start_date') { if (isDate && type == 'start_date') {
this.setState({ startDate: format(e, 'yyyy-MM-dd'), endDate: null }, () => { this.setState({ startDate: format(e, 'yyyy-MM-dd'), endDate: null }, () => {
console.log(this.state.startDate) // console.log(this.state.startDate)
}) })
} else if (isDate && type == 'end_date') { } else if (isDate && type == 'end_date') {
this.setState({ endDate: format(e, 'yyyy-MM-dd') }, () => { this.setState({ endDate: format(e, 'yyyy-MM-dd') }, () => {
console.log(this.state.endDate) // console.log(this.state.endDate)
}) })
} else { } else {
this.setState({ ...data, [e.target.name]: e.target.value }, () => this.clearMessage()) this.setState({ ...data, [e.target.name]: e.target.value }, () => this.clearMessage())
...@@ -488,7 +488,7 @@ export default class CreateParameter extends Component { ...@@ -488,7 +488,7 @@ export default class CreateParameter extends Component {
"start_date": this.state.tempData.start_date, "start_date": this.state.tempData.start_date,
"end_date": this.state.tempData.end_date "end_date": this.state.tempData.end_date
} }
console.log(body); // console.log(body);
this.props.updateParameter(body) this.props.updateParameter(body)
} }
...@@ -505,7 +505,7 @@ export default class CreateParameter extends Component { ...@@ -505,7 +505,7 @@ export default class CreateParameter extends Component {
"start_date": this.state.startDate, "start_date": this.state.startDate,
"end_date": this.state.endDate "end_date": this.state.endDate
} }
console.log(body); // console.log(body);
this.props.createParameter(body) this.props.createParameter(body)
} }
......
...@@ -69,7 +69,7 @@ export default class Parameter extends Component { ...@@ -69,7 +69,7 @@ export default class Parameter extends Component {
type: 'MAX_FILE_SIZE' type: 'MAX_FILE_SIZE'
} }
api.create().getAllSettingByType(body).then(response => { api.create().getAllSettingByType(body).then(response => {
console.log(response.data.data[0]); // console.log(response.data.data[0]);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -85,7 +85,7 @@ export default class Parameter extends Component { ...@@ -85,7 +85,7 @@ export default class Parameter extends Component {
menu: "parameters" menu: "parameters"
} }
api.create().getPermission(payload).then(response => { api.create().getPermission(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -107,7 +107,7 @@ export default class Parameter extends Component { ...@@ -107,7 +107,7 @@ export default class Parameter extends Component {
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
console.log(response); // console.log(response);
let data = response.data.data let data = response.data.data
let listData = data.map((item, index) => { let listData = data.map((item, index) => {
return [ return [
...@@ -170,7 +170,7 @@ export default class Parameter extends Component { ...@@ -170,7 +170,7 @@ export default class Parameter extends Component {
updateParameter = (payload) => { updateParameter = (payload) => {
this.setState({ visibleEdit: false }) this.setState({ visibleEdit: false })
api.create().updateParameter(payload).then(response => { api.create().updateParameter(payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -227,7 +227,7 @@ export default class Parameter extends Component { ...@@ -227,7 +227,7 @@ export default class Parameter extends Component {
"https://tia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=ParameterTemplate&&fileType=xlsx" "https://tia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=ParameterTemplate&&fileType=xlsx"
) )
res = await res.blob() res = await res.blob()
console.log(res) // console.log(res)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
...@@ -242,7 +242,7 @@ export default class Parameter extends Component { ...@@ -242,7 +242,7 @@ export default class Parameter extends Component {
"https://tia.eksad.com/tia-reporting-dev/public/setting/export_setting" "https://tia.eksad.com/tia-reporting-dev/public/setting/export_setting"
) )
res = await res.blob() res = await res.blob()
console.log(res) // console.log(res)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
...@@ -258,7 +258,7 @@ export default class Parameter extends Component { ...@@ -258,7 +258,7 @@ export default class Parameter extends Component {
"keyword": e "keyword": e
} }
api.create().searchParameter(body).then(response => { api.create().searchParameter(body).then(response => {
console.log(response.data); // console.log(response.data);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status == 'success') { if (response.data.status == 'success') {
...@@ -303,7 +303,7 @@ export default class Parameter extends Component { ...@@ -303,7 +303,7 @@ export default class Parameter extends Component {
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
// console.log(resp) // console.log(resp)
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
// let judul = resp.rows[2] // let judul = resp.rows[2]
...@@ -329,7 +329,7 @@ export default class Parameter extends Component { ...@@ -329,7 +329,7 @@ export default class Parameter extends Component {
let body = { let body = {
setting: payload setting: payload
} }
console.log(resp.rows[1]); // console.log(resp.rows[1]);
this.setState({ payload: body, buttonError: false, judul: resp.rows[1] === undefined ? "" : resp.rows[1][0] }) this.setState({ payload: body, buttonError: false, judul: resp.rows[1] === undefined ? "" : resp.rows[1][0] })
} }
}); });
...@@ -337,7 +337,7 @@ export default class Parameter extends Component { ...@@ -337,7 +337,7 @@ export default class Parameter extends Component {
checkUpload() { checkUpload() {
api.create().checkUploadParameter(this.state.payload).then(response => { api.create().checkUploadParameter(this.state.payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -607,7 +607,7 @@ export default class Parameter extends Component { ...@@ -607,7 +607,7 @@ export default class Parameter extends Component {
} }
] ]
console.log(dataRow); // console.log(dataRow);
this.setState({ this.setState({
dataLoaded: true, dataLoaded: true,
cols: columns, cols: columns,
...@@ -647,7 +647,7 @@ export default class Parameter extends Component { ...@@ -647,7 +647,7 @@ export default class Parameter extends Component {
uploadParameter() { uploadParameter() {
api.create().uploadParameter(this.state.payload).then(response => { api.create().uploadParameter(this.state.payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
......
...@@ -100,7 +100,7 @@ export default class UnitBisnis extends Component { ...@@ -100,7 +100,7 @@ export default class UnitBisnis extends Component {
checkUpload() { checkUpload() {
api.create().checkUploadUnitBisnis(this.state.payload).then(response => { api.create().checkUploadUnitBisnis(this.state.payload).then(response => {
console.log(response) // console.log(response)
let dataRow = [] let dataRow = []
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
...@@ -236,7 +236,7 @@ export default class UnitBisnis extends Component { ...@@ -236,7 +236,7 @@ export default class UnitBisnis extends Component {
type: 'MAX_FILE_SIZE' type: 'MAX_FILE_SIZE'
} }
api.create().getAllSettingByType(body).then(response => { api.create().getAllSettingByType(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -252,7 +252,7 @@ export default class UnitBisnis extends Component { ...@@ -252,7 +252,7 @@ export default class UnitBisnis extends Component {
menu: "business unit" menu: "business unit"
} }
api.create().getPermission(payload).then(response => { api.create().getPermission(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -448,7 +448,7 @@ export default class UnitBisnis extends Component { ...@@ -448,7 +448,7 @@ export default class UnitBisnis extends Component {
uploadUnitBisnis() { uploadUnitBisnis() {
api.create().uploadUnitBisnis(this.state.payload).then(response => { api.create().uploadUnitBisnis(this.state.payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -478,7 +478,7 @@ export default class UnitBisnis extends Component { ...@@ -478,7 +478,7 @@ export default class UnitBisnis extends Component {
} }
deleteUnitBisnis(payload) { deleteUnitBisnis(payload) {
console.log(payload); // console.log(payload);
let id = String(payload[1]) let id = String(payload[1])
api.create().deleteUnitBisnis(id).then(response => { api.create().deleteUnitBisnis(id).then(response => {
if (response.data) { if (response.data) {
......
...@@ -39,7 +39,7 @@ export default class CreateUnitBisnis extends Component { ...@@ -39,7 +39,7 @@ export default class CreateUnitBisnis extends Component {
componentDidMount() { componentDidMount() {
if (this.props.type === 'edit') { if (this.props.type === 'edit') {
this.getDetailUnitBisnis() this.getDetailUnitBisnis()
console.log(this.props.data); // console.log(this.props.data);
// this.setState({ // this.setState({
// id: data[0], // id: data[0],
// name: data[1], // name: data[1],
...@@ -48,7 +48,7 @@ export default class CreateUnitBisnis extends Component { ...@@ -48,7 +48,7 @@ export default class CreateUnitBisnis extends Component {
// }) // })
} else { } else {
let date = format(new Date, 'yyyy-MM-dd') let date = format(new Date, 'yyyy-MM-dd')
console.log(date); // console.log(date);
this.setState({ this.setState({
startDate: date, startDate: date,
endDate: date endDate: date
...@@ -58,7 +58,7 @@ export default class CreateUnitBisnis extends Component { ...@@ -58,7 +58,7 @@ export default class CreateUnitBisnis extends Component {
getDetailUnitBisnis() { getDetailUnitBisnis() {
api.create().getDetailUnitBisnis(this.props.data[1]).then(response => { api.create().getDetailUnitBisnis(this.props.data[1]).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -98,12 +98,12 @@ export default class CreateUnitBisnis extends Component { ...@@ -98,12 +98,12 @@ export default class CreateUnitBisnis extends Component {
if (isDate && type == 'start_date') { if (isDate && type == 'start_date') {
this.setState({ startDate: format(e, 'yyyy-MM-dd'), endDate: null }, () => { this.setState({ startDate: format(e, 'yyyy-MM-dd'), endDate: null }, () => {
this.clearError() this.clearError()
console.log(this.state.startDate) // console.log(this.state.startDate)
}) })
} else if (isDate && type == 'end_date') { } else if (isDate && type == 'end_date') {
this.setState({ endDate: format(e, 'yyyy-MM-dd') }, () => { this.setState({ endDate: format(e, 'yyyy-MM-dd') }, () => {
this.clearError() this.clearError()
console.log(this.state.endDate) // console.log(this.state.endDate)
}) })
} else { } else {
// this.setState({...data, tempData: {...this.state.tempData, [e.target.name] : e.target.value}}) // this.setState({...data, tempData: {...this.state.tempData, [e.target.name] : e.target.value}})
......
...@@ -74,7 +74,7 @@ export default class UserRole extends Component { ...@@ -74,7 +74,7 @@ export default class UserRole extends Component {
async daskdkas() { async daskdkas() {
let res = await localStorage.getItem(Constant.TOKEN) let res = await localStorage.getItem(Constant.TOKEN)
console.log(res) // console.log(res)
} }
closeEdit() { closeEdit() {
...@@ -91,7 +91,7 @@ export default class UserRole extends Component { ...@@ -91,7 +91,7 @@ export default class UserRole extends Component {
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
console.log(response.data); // console.log(response.data);
let data = response.data.data let data = response.data.data
let listData = data.sort((a, b) => a.user_id - b.user_id).map((item, index) => { let listData = data.sort((a, b) => a.user_id - b.user_id).map((item, index) => {
return [index, item.user_id, item.fullname === null ? '-' : item.fullname, item.email, item.role_name, item.totalCompany, item.status] return [index, item.user_id, item.fullname === null ? '-' : item.fullname, item.email, item.role_name, item.totalCompany, item.status]
...@@ -129,7 +129,7 @@ export default class UserRole extends Component { ...@@ -129,7 +129,7 @@ export default class UserRole extends Component {
menu: "user" menu: "user"
} }
api.create().getPermission(payload).then(response => { api.create().getPermission(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
...@@ -190,7 +190,7 @@ export default class UserRole extends Component { ...@@ -190,7 +190,7 @@ export default class UserRole extends Component {
let fileObj = event let fileObj = event
ExcelRenderer(fileObj, (err, resp) => { ExcelRenderer(fileObj, (err, resp) => {
if (err) { if (err) {
console.log(err); // console.log(err);
} }
else { else {
// let judul = resp.rows[0] // let judul = resp.rows[0]
...@@ -212,7 +212,7 @@ export default class UserRole extends Component { ...@@ -212,7 +212,7 @@ export default class UserRole extends Component {
let body = { let body = {
user: payload user: payload
} }
console.log(resp.rows[1]) // console.log(resp.rows[1])
this.setState({ payload: body, rows: [], judul: resp.rows[1][0] }) this.setState({ payload: body, rows: [], judul: resp.rows[1][0] })
} }
}); });
...@@ -248,7 +248,7 @@ export default class UserRole extends Component { ...@@ -248,7 +248,7 @@ export default class UserRole extends Component {
checkUpload(){ checkUpload(){
api.create().checkUploadUser(this.state.payload).then(response => { api.create().checkUploadUser(this.state.payload).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -275,7 +275,7 @@ export default class UserRole extends Component { ...@@ -275,7 +275,7 @@ export default class UserRole extends Component {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('fullname')) check = tableMeta.rowData[6].findIndex((val) => val.field.includes('fullname'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
console.log('masuk') // console.log('masuk')
} }
} }
return ( return (
...@@ -326,7 +326,7 @@ export default class UserRole extends Component { ...@@ -326,7 +326,7 @@ export default class UserRole extends Component {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('role')) check = tableMeta.rowData[6].findIndex((val) => val.field.includes('role'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
console.log(tableMeta.rowData[6]) // console.log(tableMeta.rowData[6])
} }
} }
return ( return (
...@@ -352,7 +352,7 @@ export default class UserRole extends Component { ...@@ -352,7 +352,7 @@ export default class UserRole extends Component {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('start_date')) check = tableMeta.rowData[6].findIndex((val) => val.field.includes('start_date'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
console.log('masuk') // console.log('masuk')
} }
} }
return ( return (
...@@ -378,7 +378,7 @@ export default class UserRole extends Component { ...@@ -378,7 +378,7 @@ export default class UserRole extends Component {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('end_date')) check = tableMeta.rowData[6].findIndex((val) => val.field.includes('end_date'))
if (check > -1) { if (check > -1) {
this.setState({ buttonError: true }) this.setState({ buttonError: true })
console.log('masuk') // console.log('masuk')
} }
} }
return ( return (
...@@ -434,7 +434,7 @@ export default class UserRole extends Component { ...@@ -434,7 +434,7 @@ export default class UserRole extends Component {
"https://tia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=UserTemplate&&fileType=xlsx" "https://tia.eksad.com/tia-reporting-dev/public/attachment/download_file?fileName=UserTemplate&&fileType=xlsx"
) )
res = await res.blob() res = await res.blob()
console.log(res) // console.log(res)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
...@@ -447,7 +447,7 @@ export default class UserRole extends Component { ...@@ -447,7 +447,7 @@ export default class UserRole extends Component {
downloadDataTables = async () => { downloadDataTables = async () => {
let res = await fetch("https://tia.eksad.com/tia-reporting-dev/public/user/export_user") let res = await fetch("https://tia.eksad.com/tia-reporting-dev/public/user/export_user")
res = await res.blob() res = await res.blob()
console.log(res) // console.log(res)
if (res.size > 0) { if (res.size > 0) {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
...@@ -459,8 +459,8 @@ export default class UserRole extends Component { ...@@ -459,8 +459,8 @@ export default class UserRole extends Component {
updateUser(payload) { updateUser(payload) {
api.create().updateUser(payload).then((response) => { api.create().updateUser(payload).then((response) => {
console.log(response.data.message) // console.log(response.data.message)
console.log(response.data.status) // console.log(response.data.status)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
...@@ -488,9 +488,9 @@ export default class UserRole extends Component { ...@@ -488,9 +488,9 @@ export default class UserRole extends Component {
} }
createUser(payload) { createUser(payload) {
console.log('Mode Create') // console.log('Mode Create')
api.create().createUser(payload).then((response) => { api.create().createUser(payload).then((response) => {
console.log(response.data) // console.log(response.data)
// if (String(response.data.status).toLocaleUpperCase === 'Success' || String(response.data.status).toLocaleUpperCase === 'success') { // if (String(response.data.status).toLocaleUpperCase === 'Success' || String(response.data.status).toLocaleUpperCase === 'success') {
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
...@@ -534,10 +534,10 @@ export default class UserRole extends Component { ...@@ -534,10 +534,10 @@ export default class UserRole extends Component {
} }
uploadUser() { uploadUser() {
console.log(JSON.stringify(this.state.payload)) // console.log(JSON.stringify(this.state.payload))
api.create().uploadUser(this.state.payload).then(response => { api.create().uploadUser(this.state.payload).then(response => {
this.setState({buttonError: false}) this.setState({buttonError: false})
console.log(JSON.stringify(response)) // console.log(JSON.stringify(response))
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
......
...@@ -82,7 +82,7 @@ export default class AddUser extends Component { ...@@ -82,7 +82,7 @@ export default class AddUser extends Component {
// //
} else { } else {
let date = format(new Date, 'yyyy-MM-dd') let date = format(new Date, 'yyyy-MM-dd')
console.log(date); // console.log(date);
this.setState({ this.setState({
startDate: date, startDate: date,
endDate: date endDate: date
...@@ -179,7 +179,7 @@ export default class AddUser extends Component { ...@@ -179,7 +179,7 @@ export default class AddUser extends Component {
msgErrorED: '', msgErrorED: '',
company company
}, () => { }, () => {
console.log(this.state.company) // console.log(this.state.company)
}) })
} }
...@@ -265,7 +265,7 @@ export default class AddUser extends Component { ...@@ -265,7 +265,7 @@ export default class AddUser extends Component {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ listCompany: response.data.data }) this.setState({ listCompany: response.data.data })
console.log(response.data.data) // console.log(response.data.data)
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
......
...@@ -172,7 +172,7 @@ export default class EditUser extends Component { ...@@ -172,7 +172,7 @@ export default class EditUser extends Component {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ tempData: response.data.data, company: response.data.data.company }, ()=> this.setState({ tempData: response.data.data, company: response.data.data.company }, ()=>
this.getRole(response.data.data.role_id)) this.getRole(response.data.data.role_id))
console.log(response.data.data) // console.log(response.data.data)
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -255,7 +255,7 @@ export default class EditUser extends Component { ...@@ -255,7 +255,7 @@ export default class EditUser extends Component {
}; };
let index = roleData.findIndex((val) => val.role_id === id) let index = roleData.findIndex((val) => val.role_id === id)
console.log(index) // console.log(index)
this.setState({ listRole: defaultProps, role: index === -1 ? null : roleData[index], msgErrorRN: index === -1 ? 'Role has been Inactive' : '', errorRoleName: index === -1 ? true : false }) this.setState({ listRole: defaultProps, role: index === -1 ? null : roleData[index], msgErrorRN: index === -1 ? 'Role has been Inactive' : '', errorRoleName: index === -1 ? true : false })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
......
...@@ -101,7 +101,7 @@ class UserRole extends Component { ...@@ -101,7 +101,7 @@ class UserRole extends Component {
menu: "user role" menu: "user role"
} }
api.create().getPermission(payload).then(response => { api.create().getPermission(payload).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
......
...@@ -64,7 +64,7 @@ export default class AddRole extends Component { ...@@ -64,7 +64,7 @@ export default class AddRole extends Component {
// //
} else { } else {
let date = format(new Date, 'yyyy-MM-dd') let date = format(new Date, 'yyyy-MM-dd')
console.log(date); // console.log(date);
this.setState({ this.setState({
startDate: date, startDate: date,
endDate: date endDate: date
...@@ -134,7 +134,7 @@ export default class AddRole extends Component { ...@@ -134,7 +134,7 @@ export default class AddRole extends Component {
} }
// console.log(payload) // console.log(payload)
api.create().addRole(payload).then((response) => { api.create().addRole(payload).then((response) => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
...@@ -193,7 +193,7 @@ export default class AddRole extends Component { ...@@ -193,7 +193,7 @@ export default class AddRole extends Component {
return set return set
} }
}) })
console.log(app) // console.log(app)
this.setState({ application: app, setting: set, isLoad: true }, () => console.log(this.state.application)) this.setState({ application: app, setting: set, isLoad: true }, () => console.log(this.state.application))
// this.setState({ menuData: response.data.data }) // this.setState({ menuData: response.data.data })
} else { } else {
...@@ -300,7 +300,7 @@ export default class AddRole extends Component { ...@@ -300,7 +300,7 @@ export default class AddRole extends Component {
} }
} }
this.setState({ privileges }, () => { this.setState({ privileges }, () => {
console.log(this.state.privileges) // console.log(this.state.privileges)
}) })
} }
...@@ -332,7 +332,7 @@ export default class AddRole extends Component { ...@@ -332,7 +332,7 @@ export default class AddRole extends Component {
item.sub_menu.map((items,indexs) => { item.sub_menu.map((items,indexs) => {
let subIndexID = privileges.findIndex((val) => val.menu_id === items.menu_id) let subIndexID = privileges.findIndex((val) => val.menu_id === items.menu_id)
if (subIndexID === -1) { if (subIndexID === -1) {
console.log('masuk pa eko', subIndexID) // console.log('masuk pa eko', subIndexID)
privileges.push({ privileges.push({
menu_id: items.menu_id, menu_id: items.menu_id,
button_id: [index] button_id: [index]
......
...@@ -102,7 +102,7 @@ export default class EditRole extends Component { ...@@ -102,7 +102,7 @@ export default class EditRole extends Component {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ tempData: response.data.data, privileges: response.data.data.privileges }) this.setState({ tempData: response.data.data, privileges: response.data.data.privileges })
console.log(response.data.data.start_date) // console.log(response.data.data.start_date)
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -161,7 +161,7 @@ export default class EditRole extends Component { ...@@ -161,7 +161,7 @@ export default class EditRole extends Component {
} }
// console.log(payload) // console.log(payload)
api.create().editRole(payload).then((response) => { api.create().editRole(payload).then((response) => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
...@@ -220,7 +220,7 @@ export default class EditRole extends Component { ...@@ -220,7 +220,7 @@ export default class EditRole extends Component {
return set return set
} }
}) })
console.log(app) // console.log(app)
this.setState({ application: app, setting: set, isLoad: true }, () => console.log(this.state.application)) this.setState({ application: app, setting: set, isLoad: true }, () => console.log(this.state.application))
// this.setState({ menuData: response.data.data }) // this.setState({ menuData: response.data.data })
} else { } else {
...@@ -249,7 +249,7 @@ export default class EditRole extends Component { ...@@ -249,7 +249,7 @@ export default class EditRole extends Component {
handleItemClick(item) { handleItemClick(item) {
let indexID = this.state.privileges.findIndex((val) => val.menu_id === item.menu_id) let indexID = this.state.privileges.findIndex((val) => val.menu_id === item.menu_id)
console.log(item) // console.log(item)
let privileges = this.state.privileges let privileges = this.state.privileges
if (indexID === -1) { if (indexID === -1) {
privileges.push({ privileges.push({
...@@ -307,7 +307,7 @@ export default class EditRole extends Component { ...@@ -307,7 +307,7 @@ export default class EditRole extends Component {
item.sub_menu.map((items,indexs) => { item.sub_menu.map((items,indexs) => {
let subIndexID = privileges.findIndex((val) => val.menu_id === items.menu_id) let subIndexID = privileges.findIndex((val) => val.menu_id === items.menu_id)
if (subIndexID === -1) { if (subIndexID === -1) {
console.log('masuk pa eko', subIndexID) // console.log('masuk pa eko', subIndexID)
privileges.push({ privileges.push({
menu_id: items.menu_id, menu_id: items.menu_id,
button_id: [index] button_id: [index]
......
This diff is collapsed.
...@@ -66,7 +66,7 @@ export default class Profile extends Component { ...@@ -66,7 +66,7 @@ export default class Profile extends Component {
handleChange(e) { handleChange(e) {
let data = this.state let data = this.state
this.setState({ ...data, [e.target.name]: e.target.value }) this.setState({ ...data, [e.target.name]: e.target.value })
console.log(e.target.name); // console.log(e.target.name);
if (e.target.name === "password") { if (e.target.name === "password") {
this.setState({ errorPassword: false, msgPassword: 'Consists of 8 Characters with a Combination of Numbers.' }) this.setState({ errorPassword: false, msgPassword: 'Consists of 8 Characters with a Combination of Numbers.' })
} else if (e.target.name === "confirmPassword") { } else if (e.target.name === "confirmPassword") {
...@@ -109,7 +109,7 @@ export default class Profile extends Component { ...@@ -109,7 +109,7 @@ export default class Profile extends Component {
"confirm_password": this.state.confirmPassword "confirm_password": this.state.confirmPassword
} }
api.create().changePassword(body).then(response => { api.create().changePassword(body).then(response => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
...@@ -154,12 +154,12 @@ export default class Profile extends Component { ...@@ -154,12 +154,12 @@ export default class Profile extends Component {
getUser() { getUser() {
let userId = localStorage.getItem(Constant.USER) let userId = localStorage.getItem(Constant.USER)
api.create().getDetailUser(userId).then((response) => { api.create().getDetailUser(userId).then((response) => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ company: response.data.data.company, photo: response.data.data.photo, name: response.data.data.fullname }) this.setState({ company: response.data.data.company, photo: response.data.data.photo, name: response.data.data.fullname })
console.log(response) // console.log(response)
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -181,12 +181,12 @@ export default class Profile extends Component { ...@@ -181,12 +181,12 @@ export default class Profile extends Component {
getPerusahaan() { getPerusahaan() {
api.create().getPerusahaanHierarki().then((response) => { api.create().getPerusahaanHierarki().then((response) => {
console.log(response); // console.log(response);
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
this.setState({ listCompany: response.data.data }) this.setState({ listCompany: response.data.data })
console.log(response.data.data) // console.log(response.data.data)
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) { if (response.data.message.includes("Someone Logged In")) {
...@@ -321,7 +321,7 @@ export default class Profile extends Component { ...@@ -321,7 +321,7 @@ export default class Profile extends Component {
let formData = new FormData() let formData = new FormData()
formData.append('file', this.state.pictures[0]) formData.append('file', this.state.pictures[0])
api.create().uploadFoto(formData).then(response => { api.create().uploadFoto(formData).then(response => {
console.log(response) // console.log(response)
if (response.data) { if (response.data) {
if (response.ok) { if (response.ok) {
if (response.data.status === "success") { if (response.data.status === "success") {
......
...@@ -32,8 +32,8 @@ class Upload extends Component { ...@@ -32,8 +32,8 @@ class Upload extends Component {
componentDidUpdate(prevs, next) { componentDidUpdate(prevs, next) {
if (prevs.percentage > 0 && prevs.percentage <= 100) { if (prevs.percentage > 0 && prevs.percentage <= 100) {
console.log('old percentage', prevs.percentage) // console.log('old percentage', prevs.percentage)
console.log('new percentage', this.state.percentage) // console.log('new percentage', this.state.percentage)
if (this.state.percentage !== prevs.percentage) { if (this.state.percentage !== prevs.percentage) {
this.setState({ percentage: prevs.percentage }) this.setState({ percentage: prevs.percentage })
} }
...@@ -47,7 +47,7 @@ class Upload extends Component { ...@@ -47,7 +47,7 @@ class Upload extends Component {
componentDidMount() { componentDidMount() {
if (this.props.docName !== undefined && this.props.docName !== "") { if (this.props.docName !== undefined && this.props.docName !== "") {
console.log('masuk'); // console.log('masuk');
this.setState({ docName: this.props.docName, docSize: this.props.docSize, inputVisible: false, editVisible: true }) this.setState({ docName: this.props.docName, docSize: this.props.docSize, inputVisible: false, editVisible: true })
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment