Commit 207d6702 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into deni-dev(pc)

parents be142012 fa3f1797
...@@ -346,6 +346,7 @@ export default class FixedAssetsMovement extends Component { ...@@ -346,6 +346,7 @@ export default class FixedAssetsMovement extends Component {
}) })
}) })
let body = { let body = {
submission_id: this.props.submissionID,
company_id: this.props.company.company_id, company_id: this.props.company.company_id,
periode: this.props.periode, periode: this.props.periode,
report_id: this.props.report_id, report_id: this.props.report_id,
...@@ -383,6 +384,50 @@ export default class FixedAssetsMovement extends Component { ...@@ -383,6 +384,50 @@ export default class FixedAssetsMovement extends Component {
} }
} }
handleValidate() {
let data = []
// console.log(this.state.dataTable)
this.state.dataTable.map(i => {
data.push({
item_report_id: i[1],
total_actual_before: String(i[6]),
january: String(i[7]),
february: String(i[8]),
march: String(i[9]),
april: String(i[10]),
may: String(i[11]),
june: String(i[12]),
july: String(i[13]),
august: String(i[14]),
september: String(i[15]),
october: String(i[16]),
november: String(i[17]),
december: String(i[18]),
total_current_year: String(i[19]),
total_next_year: String(i[20]),
total_more_year: String(i[21])
})
})
// console.log(JSON.stringify(data))
let payload = {
submission_id: this.props.submissionID,
company_id: this.props.company.company_id,
periode: this.props.periode,
report_id: this.props.report_id,
fixed_asset_movement: data,
status: "submitted"
}
console.log(payload)
api.create().validateSubmitReport(payload).then((response) => {
console.log(response)
if (response.data.data.result) {
this.setState({ loading: false, buttonError: false, editable: true })
} else {
this.setState({ loading: false, buttonError: true, editable: true })
}
})
}
render() { render() {
let dataTable2 = this.state.dataTable let dataTable2 = this.state.dataTable
const handleChange = (value, tableMeta, type) => { const handleChange = (value, tableMeta, type) => {
...@@ -507,8 +552,6 @@ export default class FixedAssetsMovement extends Component { ...@@ -507,8 +552,6 @@ export default class FixedAssetsMovement extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ width: 300 }}> <div style={{ width: 300 }}>
{/* {console.log(val)} */}
{/* {console.log(tableMeta)} */}
{tableMeta.rowData[22] ? {tableMeta.rowData[22] ?
tableMeta.rowData[22].length > 0 ? tableMeta.rowData[22].length > 0 ?
<div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}> <div style={{ paddingLeft: 20 * Number(tableMeta.rowData[4]) }}>
...@@ -547,8 +590,6 @@ export default class FixedAssetsMovement extends Component { ...@@ -547,8 +590,6 @@ export default class FixedAssetsMovement extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{console.log(tableMeta)}
{console.log(value)}
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: :
...@@ -2012,7 +2053,8 @@ export default class FixedAssetsMovement extends Component { ...@@ -2012,7 +2053,8 @@ export default class FixedAssetsMovement extends Component {
onClick={() => { onClick={() => {
this.setState({ loading: true }, () => { this.setState({ loading: true }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({ loading: false, buttonError: false, editable: true }) // this.setState({ loading: false, buttonError: false, editable: true })
this.handleValidate()
}, 100); }, 100);
}) })
}} }}
......
This diff is collapsed.
...@@ -362,7 +362,7 @@ export default class CreateManagementDoc extends Component { ...@@ -362,7 +362,7 @@ export default class CreateManagementDoc extends Component {
type={this.state.uploadStatus} type={this.state.uploadStatus}
percentage={this.state.percentage} percentage={this.state.percentage}
result={this.state.result} result={this.state.result}
acceptedFiles={["xls", "xlsx", "pdf", "PDF"]} acceptedFiles={["xls", "xlsx", "pdf", "PDF", "docx", "doc", "pptx", "ppt", "ods", "odf" ]}
intent={"management"} intent={"management"}
onHandle={(dt) => { onHandle={(dt) => {
this.fileHandler(dt) this.fileHandler(dt)
......
...@@ -407,7 +407,7 @@ export default class EditManagementDoc extends Component { ...@@ -407,7 +407,7 @@ export default class EditManagementDoc extends Component {
type={this.state.uploadStatus} type={this.state.uploadStatus}
percentage={this.state.percentage} percentage={this.state.percentage}
result={this.state.result} result={this.state.result}
acceptedFiles={["xls", "xlsx", "pdf", "PDF"]} acceptedFiles={["xls", "xlsx", "pdf", "PDF", "docx", "doc", "pptx", "ppt", "ods", "odf" ]}
intent={"management"} intent={"management"}
onHandle={(dt) => { onHandle={(dt) => {
this.fileHandler(dt) this.fileHandler(dt)
......
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