Commit 550e0882 authored by d.arizona's avatar d.arizona

lebih baik kita usai disini

parent 574b28ed
...@@ -78,7 +78,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -78,7 +78,9 @@ export default class CorporateAnnualTarget extends Component {
buttonDraft: true, buttonDraft: true,
updateBy: '', updateBy: '',
handleTekTekTek: 0, handleTekTekTek: 0,
editable: false editable: false,
dataCustomerPrs: [],
dataInternalBsn: []
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -104,12 +106,35 @@ export default class CorporateAnnualTarget extends Component { ...@@ -104,12 +106,35 @@ export default class CorporateAnnualTarget extends Component {
// console.log(JSON.stringify(payload)) // console.log(JSON.stringify(payload))
api.create().getDetailReportMB(payload).then(response => { api.create().getDetailReportMB(payload).then(response => {
let dataTable = [] let dataTable = []
let dataCustomerPrs = []
let dataInternalBsn = []
// console.log(response) // console.log(response)
let res = response.data.data let res = response.data.data
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
if (indexIDzz === -1) { if (indexIDzz === -1) {
let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE' let parentTrue = item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE' || item.parent_name == 'CUSTOMER PERSPECTIVE'
if (item.parent_name == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
if (item.type_report_id !== 4) {
dataInternalBsn.push({
id: item.id,
name: item.description,
check: false
})
}
}
if (item.parent_name == 'CUSTOMER PERSPECTIVE') {
if (item.type_report_id !== 4) {
dataCustomerPrs.push({
id: item.id,
name: item.description,
check: false
})
}
}
dataTable.push([ dataTable.push([
item.type_report_id, item.type_report_id,
item.id, item.id,
...@@ -192,7 +217,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -192,7 +217,9 @@ export default class CorporateAnnualTarget extends Component {
} }
} }
}) })
this.setState({ dataTable, loading: false, dataReal: res, editable: true }) this.setState({ dataTable, loading: false, dataReal: res, editable: true, dataCustomerPrs, dataInternalBsn }, () => {
console.log(dataCustomerPrs)
})
}) })
} }
...@@ -325,13 +352,37 @@ export default class CorporateAnnualTarget extends Component { ...@@ -325,13 +352,37 @@ export default class CorporateAnnualTarget extends Component {
console.log(JSON.stringify(this.state.payload)) console.log(JSON.stringify(this.state.payload))
api.create().checkUploadMB(this.state.payload).then(response => { api.create().checkUploadMB(this.state.payload).then(response => {
// // console.log(JSON.stringify(this.state.payload)); // // console.log(JSON.stringify(this.state.payload));
// console.log(response) console.log(response)
if (response.data) { if (response.data) {
if (response.data.status === 'success') { if (response.data.status === 'success') {
// this.setState({ visibleUpload: false, visibleCAT: false }) // this.setState({ visibleUpload: false, visibleCAT: false })
this.setState({ visibleUpload: false, visibleCAT: false }) this.setState({ visibleUpload: false, visibleCAT: false })
let dataTable = response.data.data.map((item, index) => { let dataTable = []
return [ let custoId = 0
let bisnsId = 0
let dataDelete = this.state.dataDelete
response.data.data.map((item, index) => {
if (item.item_report == 'CUSTOMER PERSPECTIVE') {
custoId = item.item_report_id
}
if (item.item_report == 'INTERNAL BUSINESS PROCESS PERSPECTIVE') {
bisnsId = item.item_report_id
}
if (item.type_report_id !== 4 && item.parent !== null && (item.parent == custoId || item.parent == bisnsId)) {
let indexCust = this.state.dataCustomerPrs.findIndex((val) => val.name == item.item_report)
let indexBisn = this.state.dataInternalBsn.findIndex((val) => val.name == item.item_report)
if (indexCust !== -1 && item.item_report_id == 0) {
dataDelete.push(this.state.dataCustomerPrs[indexCust].id)
}
if (indexBisn !== -1 && item.item_report_id == 0) {
dataDelete.push(this.state.dataInternalBsn[indexBisn].id)
}
}
dataTable.push([
item.type_report_id, item.type_report_id,
item.item_report_id, item.item_report_id,
item.parent, item.parent,
...@@ -363,11 +414,11 @@ export default class CorporateAnnualTarget extends Component { ...@@ -363,11 +414,11 @@ export default class CorporateAnnualTarget extends Component {
item.strategic, item.strategic,
item.pic, item.pic,
item.error item.error
] ])
}) })
// console.log(dataTable) console.log(dataTable)
// console.log(this.state.buttonError) // console.log(this.state.buttonError)
this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true }, () => { this.setState({ dataTable, dataLoaded: true, loading: false, buttonError: false, editable: true, dataDelete }, () => {
this.state.dataTable.map(item => { this.state.dataTable.map(item => {
if (item[30].length > 0) { if (item[30].length > 0) {
// console.log('masuk') // console.log('masuk')
...@@ -382,8 +433,9 @@ export default class CorporateAnnualTarget extends Component { ...@@ -382,8 +433,9 @@ export default class CorporateAnnualTarget extends Component {
} }
uploadCAT(type) { uploadCAT(type) {
// let dataDelete = this.state.dataDelete
// console.log(dataDelete)
let payload = { "item_report_id": this.state.dataDelete } let payload = { "item_report_id": this.state.dataDelete }
if (this.state.dataDelete.length > 0) { if (this.state.dataDelete.length > 0) {
api.create().deleteAllItemReport(payload).then((response) => { api.create().deleteAllItemReport(payload).then((response) => {
this.functionUpload(type) this.functionUpload(type)
...@@ -436,7 +488,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -436,7 +488,7 @@ export default class CorporateAnnualTarget extends Component {
"cat": data "cat": data
} }
// console.log(data); // console.log(data);
// console.log(JSON.stringify(body)) console.log(JSON.stringify(body))
api.create('UPLOAD').uploadMasterBudget(body).then(response => { api.create('UPLOAD').uploadMasterBudget(body).then(response => {
// console.log(response); // console.log(response);
if (response.data) { if (response.data) {
...@@ -888,7 +940,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -888,7 +940,7 @@ export default class CorporateAnnualTarget extends Component {
} }
const handleTambah = (data, rowIndex) => { const handleTambah = (data, rowIndex) => {
// console.log(dataTable2) console.log(dataTable2)
let newData = [] let newData = []
dataTable2.map((item, index) => { dataTable2.map((item, index) => {
newData.push(item) newData.push(item)
...@@ -932,6 +984,7 @@ export default class CorporateAnnualTarget extends Component { ...@@ -932,6 +984,7 @@ export default class CorporateAnnualTarget extends Component {
this.setState({ dataTable: dataTable2 }, () => { this.setState({ dataTable: dataTable2 }, () => {
setTimeout(() => { setTimeout(() => {
this.setState({ loading: false }) this.setState({ loading: false })
console.log(dataTable2)
}, 500) }, 500)
}) })
} }
......
...@@ -118,6 +118,7 @@ export default class BalanceSheet extends Component { ...@@ -118,6 +118,7 @@ export default class BalanceSheet extends Component {
item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1), item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1), item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1), item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
item.order
]) ])
} }
if (item.children !== null) { if (item.children !== null) {
...@@ -151,6 +152,7 @@ export default class BalanceSheet extends Component { ...@@ -151,6 +152,7 @@ export default class BalanceSheet extends Component {
item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1), item.master_budget.november == "" ? item.master_budget.november : String(item.master_budget.november).indexOf(".") == -1 ? Number(item.master_budget.november) : Number(item.master_budget.november).toFixed(1),
item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1), item.master_budget.december == "" ? item.master_budget.december : String(item.master_budget.december).indexOf(".") == -1 ? Number(item.master_budget.december) : Number(item.master_budget.december).toFixed(1),
item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1), item.master_budget.total_current_year == "" ? item.master_budget.total_current_year : String(item.master_budget.total_current_year).indexOf(".") == -1 ? Number(item.master_budget.total_current_year) : Number(item.master_budget.total_current_year).toFixed(1),
item.order
]) ])
if (item.children !== null) { if (item.children !== null) {
if (item.children.length > 0) { if (item.children.length > 0) {
...@@ -382,6 +384,7 @@ export default class BalanceSheet extends Component { ...@@ -382,6 +384,7 @@ export default class BalanceSheet extends Component {
item.november, item.november,
item.december, item.december,
item.total_current_year, item.total_current_year,
item.order,
item.error item.error
] ]
}) })
...@@ -474,21 +477,25 @@ export default class BalanceSheet extends Component { ...@@ -474,21 +477,25 @@ export default class BalanceSheet extends Component {
return total return total
} }
const handleFormula = (data, tableMeta) => { const handleFormula = (tableMeta) => {
let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g) let arrayFormula = tableMeta.rowData[3].match(/[a-zA-Z]+|[0-9]+|[-!$%^&*()_+|~=`{}\[\]:";'<>?,.\/]+(?:\.[0-9]+@|)/g)
let arrayJumlah = [] let arrayFormulaConvert = []
// console.log(arrayFormula)
arrayFormula.map((item, indexs) => { arrayFormula.map((item, indexs) => {
let index = dataTable2.findIndex((val) => val[1] == item) if (item == '-' || item == '+' || item == '/' || item == '*') {
if (index > 0) { arrayFormulaConvert.push(item)
arrayJumlah.push(dataTable2[index][tableMeta.columnIndex])
} else { } else {
arrayJumlah.push(item) let indexID = dataTable2.findIndex((val) => val[21] == item)
if (indexID !== -1) {
let valuezz = dataTable2[indexID][tableMeta.columnIndex]
// console.log(dataTable2[indexID])
arrayFormulaConvert.push(valuezz == "" ? 0 : valuezz)
}
} }
// if (indexs % 2 !== 0) {
// operator.push(item)
// }
}) })
let array = arrayJumlah // console.log(arrayFormula)
// console.log(arrayFormulaConvert)
let array = arrayFormulaConvert
let total = 0 let total = 0
let opt = "" let opt = ""
array.map((item, index) => { array.map((item, index) => {
...@@ -558,9 +565,9 @@ export default class BalanceSheet extends Component { ...@@ -558,9 +565,9 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 ? {tableMeta.rowData[0] === 4 ?
null null
: :
tableMeta.rowData[21] ? tableMeta.rowData[22] ?
tableMeta.rowData[21].length > 0 ? tableMeta.rowData[22].length > 0 ?
tableMeta.rowData[21][0].field === 'item' ? tableMeta.rowData[22][0].field === 'item' ?
tableMeta.rowData[4] == 0 ? tableMeta.rowData[4] == 0 ?
<a data-tip={tableMeta.rowData[22][0].message} data-for="account"> <a data-tip={tableMeta.rowData[22][0].message} data-for="account">
<span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span> <span style={{ fontSize: 12, fontWeight: 'bold', color: 'red' }}>{String(tableMeta.rowData[0] === 4 ? "" : val).toUpperCase()}</span>
...@@ -682,6 +689,30 @@ export default class BalanceSheet extends Component { ...@@ -682,6 +689,30 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -703,7 +734,7 @@ export default class BalanceSheet extends Component { ...@@ -703,7 +734,7 @@ export default class BalanceSheet extends Component {
/> />
} }
/> />
</div> </div>)
} }
</div> </div>
) )
...@@ -725,6 +756,30 @@ export default class BalanceSheet extends Component { ...@@ -725,6 +756,30 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -736,8 +791,8 @@ export default class BalanceSheet extends Component { ...@@ -736,8 +791,8 @@ export default class BalanceSheet extends Component {
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)} value={Number(value).toFixed(1)}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
decimalScale={1} decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -746,7 +801,7 @@ export default class BalanceSheet extends Component { ...@@ -746,7 +801,7 @@ export default class BalanceSheet extends Component {
/> />
} }
/> />
</div> </div>)
} }
</div> </div>
) )
...@@ -767,6 +822,7 @@ export default class BalanceSheet extends Component { ...@@ -767,6 +822,7 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -774,12 +830,12 @@ export default class BalanceSheet extends Component { ...@@ -774,12 +830,12 @@ export default class BalanceSheet extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1} decimalScale={1}
value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -789,6 +845,29 @@ export default class BalanceSheet extends Component { ...@@ -789,6 +845,29 @@ export default class BalanceSheet extends Component {
} }
/> />
</div> </div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>)
} }
</div> </div>
) )
...@@ -809,6 +888,7 @@ export default class BalanceSheet extends Component { ...@@ -809,6 +888,7 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -816,12 +896,12 @@ export default class BalanceSheet extends Component { ...@@ -816,12 +896,12 @@ export default class BalanceSheet extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1} decimalScale={1}
value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -831,6 +911,29 @@ export default class BalanceSheet extends Component { ...@@ -831,6 +911,29 @@ export default class BalanceSheet extends Component {
} }
/> />
</div> </div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>)
} }
</div> </div>
) )
...@@ -851,6 +954,30 @@ export default class BalanceSheet extends Component { ...@@ -851,6 +954,30 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -861,9 +988,9 @@ export default class BalanceSheet extends Component { ...@@ -861,9 +988,9 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -872,7 +999,7 @@ export default class BalanceSheet extends Component { ...@@ -872,7 +999,7 @@ export default class BalanceSheet extends Component {
/> />
} }
/> />
</div> </div>)
} }
</div> </div>
) )
...@@ -893,6 +1020,7 @@ export default class BalanceSheet extends Component { ...@@ -893,6 +1020,7 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -900,12 +1028,12 @@ export default class BalanceSheet extends Component { ...@@ -900,12 +1028,12 @@ export default class BalanceSheet extends Component {
control={ control={
<NumberFormat <NumberFormat
thousandSeparator={true} thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1} decimalScale={1}
value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -915,6 +1043,29 @@ export default class BalanceSheet extends Component { ...@@ -915,6 +1043,29 @@ export default class BalanceSheet extends Component {
} }
/> />
</div> </div>
:
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>)
} }
</div> </div>
) )
...@@ -935,6 +1086,30 @@ export default class BalanceSheet extends Component { ...@@ -935,6 +1086,30 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -945,9 +1120,9 @@ export default class BalanceSheet extends Component { ...@@ -945,9 +1120,9 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -956,7 +1131,7 @@ export default class BalanceSheet extends Component { ...@@ -956,7 +1131,7 @@ export default class BalanceSheet extends Component {
/> />
} }
/> />
</div> </div>)
} }
</div> </div>
) )
...@@ -977,6 +1152,30 @@ export default class BalanceSheet extends Component { ...@@ -977,6 +1152,30 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -987,9 +1186,9 @@ export default class BalanceSheet extends Component { ...@@ -987,9 +1186,9 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -998,7 +1197,7 @@ export default class BalanceSheet extends Component { ...@@ -998,7 +1197,7 @@ export default class BalanceSheet extends Component {
/> />
} }
/> />
</div> </div>)
} }
</div> </div>
) )
...@@ -1019,6 +1218,30 @@ export default class BalanceSheet extends Component { ...@@ -1019,6 +1218,30 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1029,9 +1252,9 @@ export default class BalanceSheet extends Component { ...@@ -1029,9 +1252,9 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1040,7 +1263,7 @@ export default class BalanceSheet extends Component { ...@@ -1040,7 +1263,7 @@ export default class BalanceSheet extends Component {
/> />
} }
/> />
</div> </div>)
} }
</div> </div>
) )
...@@ -1061,6 +1284,30 @@ export default class BalanceSheet extends Component { ...@@ -1061,6 +1284,30 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1071,9 +1318,9 @@ export default class BalanceSheet extends Component { ...@@ -1071,9 +1318,9 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1082,7 +1329,7 @@ export default class BalanceSheet extends Component { ...@@ -1082,7 +1329,7 @@ export default class BalanceSheet extends Component {
/> />
} }
/> />
</div> </div>)
} }
</div> </div>
) )
...@@ -1103,6 +1350,30 @@ export default class BalanceSheet extends Component { ...@@ -1103,6 +1350,30 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1113,9 +1384,9 @@ export default class BalanceSheet extends Component { ...@@ -1113,9 +1384,9 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1124,7 +1395,7 @@ export default class BalanceSheet extends Component { ...@@ -1124,7 +1395,7 @@ export default class BalanceSheet extends Component {
/> />
} }
/> />
</div> </div>)
} }
</div> </div>
) )
...@@ -1145,6 +1416,30 @@ export default class BalanceSheet extends Component { ...@@ -1145,6 +1416,30 @@ export default class BalanceSheet extends Component {
{tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ? {tableMeta.rowData[0] === 4 || tableMeta.rowData[0] === 1 ?
null null
: :
(tableMeta.rowData[0] == 5 || tableMeta.rowData[0] == 6?
<div style={{ flex: 1 }}>
<FormControlLabel
style={{ margin: 0 }}
value={value}
control={
<NumberFormat
thousandSeparator={true}
style={{ fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text"
placeholder=""
value={Number(handleFormula(tableMeta)).toFixed(1)}
disabled={true}
decimalScale={1}
onBlur={(event) => {
// updateValue(event.target.value)
handleChange(event.target.value, tableMeta)
console.log(dataTable2)
}}
/>
}
/>
</div>
:
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -1155,9 +1450,9 @@ export default class BalanceSheet extends Component { ...@@ -1155,9 +1450,9 @@ export default class BalanceSheet extends Component {
style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }} style={{ color: "#5198ea", fontSize: 12, textAlign: 'right', borderColor: 'transparent', margin: 0, width: 96, backgroundColor: 'transparent' }}
type="text" type="text"
placeholder="" placeholder=""
value={Number(value).toFixed(1)}
decimalScale={1} decimalScale={1}
disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit} disabled={!this.props.permission.create || !this.props.permission.edit || !this.props.isSubmit}
value={Number(value).toFixed(1)}
onBlur={(event) => { onBlur={(event) => {
// updateValue(event.target.value) // updateValue(event.target.value)
handleChange(event.target.value, tableMeta) handleChange(event.target.value, tableMeta)
...@@ -1166,7 +1461,7 @@ export default class BalanceSheet extends Component { ...@@ -1166,7 +1461,7 @@ export default class BalanceSheet extends Component {
/> />
} }
/> />
</div> </div>)
} }
</div> </div>
) )
......
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