Commit 2a780f3a authored by Rifka Kurnia's avatar Rifka Kurnia

Merge branch 'rifka' into 'master'

olpa tp & attch

See merge request !1295
parents 3e88701f 27f39644
...@@ -574,12 +574,12 @@ export default class TaxPlanningOLPA extends Component { ...@@ -574,12 +574,12 @@ export default class TaxPlanningOLPA extends Component {
] ]
}) })
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => {
// this.state.dataTable.map(item => { this.state.dataTable.map(item => {
// if (item[25].length > 0) { if (item[25].length > 0) {
// console.log('masuk') console.log('masuk')
// this.setState({ buttonError: true, errorPreview: true, editable: true }) this.setState({ buttonError: true, errorPreview: true, editable: true })
// } }
// }) })
console.log(this.state.dataTable); console.log(this.state.dataTable);
}) })
} }
......
...@@ -544,6 +544,7 @@ export default class RollingOutlook extends Component { ...@@ -544,6 +544,7 @@ export default class RollingOutlook extends Component {
formData.append("revision", Number(this.state.revision.revision)); formData.append("revision", Number(this.state.revision.revision));
formData.append("companyId", this.state.company.company_id); formData.append("companyId", this.state.company.company_id);
formData.append("periode", Number(this.state.periode.periode)); formData.append("periode", Number(this.state.periode.periode));
formData.append("quartal", this.state.quarter.value);
formData.append("file", event); formData.append("file", event);
this.setState({ formData }) this.setState({ formData })
} }
...@@ -551,7 +552,15 @@ export default class RollingOutlook extends Component { ...@@ -551,7 +552,15 @@ export default class RollingOutlook extends Component {
} }
uploadAttachment(formData) { uploadAttachment(formData) {
// var object = {};
// formData.forEach(function (value, key) {
// object[key] = value;
// });
// var json = JSON.stringify(object);
// console.log(object)
// console.log(json)
api.create().uploadAttachment(formData).then(response => { api.create().uploadAttachment(formData).then(response => {
console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ visibleUpload: false }, () => { this.setState({ visibleUpload: false }, () => {
...@@ -997,7 +1006,7 @@ export default class RollingOutlook extends Component { ...@@ -997,7 +1006,7 @@ export default class RollingOutlook extends Component {
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<Typography style={{ fontSize: '16px', color: '#4b4b4b', fontWeight: 'bold' }}>Attachment: </Typography> <Typography style={{ fontSize: '16px', color: '#4b4b4b', fontWeight: 'bold' }}>Attachment: </Typography>
</div> </div>
{!this.state.isApprover && (this.state.lastStatus === 'SUBMIT' && this.state.lastStatus === 'REVISION') && ( {!this.state.isApprover && (this.state.lastStatus === 'SUBMIT' || this.state.lastStatus === 'REVISION') && (
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
<button <button
style={{ style={{
...@@ -1043,7 +1052,7 @@ export default class RollingOutlook extends Component { ...@@ -1043,7 +1052,7 @@ export default class RollingOutlook extends Component {
: null : null
} }
</div> </div>
{!this.state.isApprover && (this.state.lastStatus === 'SUBMIT' && this.state.lastStatus === 'REVISION') && ( {!this.state.isApprover && (this.state.lastStatus === 'SUBMIT' || this.state.lastStatus === 'REVISION') && (
<div style={{ width: '50%' }}> <div style={{ width: '50%' }}>
{this.state.listAttachment.length > 0 ? {this.state.listAttachment.length > 0 ?
this.state.listAttachment.map((item) => { this.state.listAttachment.map((item) => {
......
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